{"record":{"id":"57e709fdf72d5d91","repo":"grosser/parallel_tests","slug":"both-options-are-mutually-exclusive-verbose-qui","errorCode":null,"errorMessage":"Both options are mutually exclusive: verbose & quiet","messagePattern":"Both options are mutually exclusive: verbose & quiet","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"lib/parallel_tests/cli.rb","lineNumber":347,"sourceCode":"          TEXT\n        ) { |limit| options[:test_file_limit] = limit }\n\n        opts.on(\"--verbose\", \"Print debug output\") { options[:verbose] = true }\n        opts.on(\"--verbose-command\", \"Combines options --verbose-process-command and --verbose-rerun-command\") { options.merge! verbose_process_command: true, verbose_rerun_command: true }\n        opts.on(\"--verbose-process-command\", \"Print the command that will be executed by each process before it begins\") { options[:verbose_process_command] = true }\n        opts.on(\"--verbose-rerun-command\", \"After a process fails, print the command executed by that process\") { options[:verbose_rerun_command] = true }\n        opts.on(\"--quiet\", \"Print only tests output\") { options[:quiet] = true }\n        opts.on(\"-v\", \"--version\", \"Show Version\") do\n          puts ParallelTests::VERSION\n          exit 0\n        end\n        opts.on(\"-h\", \"--help\", \"Show this.\") do\n          puts opts\n          exit 0\n        end\n      end.parse!(argv)\n\n      raise \"Both options are mutually exclusive: verbose & quiet\" if options[:verbose] && options[:quiet]\n\n      if options[:count] == 0\n        options.delete(:count)\n        options[:non_parallel] = true\n      end\n\n      files, remaining = extract_file_paths(argv)\n      unless options[:execute]\n        if files.empty?\n          default_test_folder = @runner.default_test_folder\n          if File.directory?(default_test_folder)\n            files = [default_test_folder]\n          else\n            abort \"Pass files or folders to run\"\n          end\n        end\n        options[:files] = files.map { |file_path| Pathname.new(file_path).cleanpath.to_s }\n      end","sourceCodeStart":329,"sourceCodeEnd":365,"githubUrl":"https://github.com/grosser/parallel_tests/blob/a06047856d3564ee77848e230d61cb6503037ad7/lib/parallel_tests/cli.rb#L329-L365","documentation":"parallel_tests validates its CLI options right after OptionParser parses the command line. --verbose turns on debug output while --quiet suppresses everything except the raw test output, so the two verbosity levels contradict each other and parse_options! raises a plain RuntimeError when both options hash keys are set.","triggerScenarios":"Run the CLI with both flags, e.g. `parallel_test --verbose --quiet spec/`, or set both via an option string like PARALLEL_TEST_OPTS=\"--verbose --quiet\" feeding `rake parallel:spec`; programmatically, `ParallelTests::CLI.new.run(['--verbose', '--quiet'])` hits the same raise at lib/parallel_tests/cli.rb:347.","commonSituations":"CI option strings that accreted flags over time (--quiet added for clean logs, --verbose added later while debugging and never removed); rake tasks in lib/tasks that merge arguments from several ENV vars; command lines copy-pasted from runbooks or other CI jobs.","solutions":["Remove one of the two flags from the command / PARALLEL_TEST_OPTS string -- decide whether you want debug output or clean output","If you need targeted verbosity, replace --verbose with --verbose-process-command or --verbose-rerun-command, which are compatible with --quiet","Grep the repo (CI yaml, .rake files, Makefile, scripts/) for both flags so the fix covers every entry point"],"exampleFix":"# before\nPARALLEL_TEST_OPTS=\"--verbose --quiet\" rake parallel:spec\n\n# after\nPARALLEL_TEST_OPTS=\"--quiet\" rake parallel:spec","handlingStrategy":"validation","validationCode":"# Ruby: reject the contradictory pair before invoking the CLI\nopts = ENV.fetch('PARALLEL_TEST_OPTS', '').shellsplit\nif opts.include?('--verbose') && opts.include?('--quiet')\n  abort 'parallel_tests: --verbose and --quiet are mutually exclusive'\nend\nsystem('parallel_test', *opts)","typeGuard":"# Predicate guarding an argv meant for parallel_tests\ndef parallel_tests_args_valid?(argv)\n  !(argv.include?('--verbose') && argv.include?('--quiet'))\nend","tryCatchPattern":"begin\n  ParallelTests::CLI.new.run(args)\nrescue RuntimeError => e\n  abort \"parallel_tests option error: #{e.message}\" # fail fast, surface the CLI's own hint\nend","preventionTips":["Keep all parallel_tests flags in one shared constant or ENV var instead of concatenating several sources","Prefer the narrow --verbose-process-command / --verbose-rerun-command flags over --verbose in CI so they cannot collide with --quiet","Add a CI lint step that greps option strings for known conflicting pairs"],"tags":["ruby","parallel-tests","cli","mutually-exclusive-options","verbosity"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"a06047856d3564ee77848e230d61cb6503037ad7","analyzedAt":"2026-08-23T10:12:36.391Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}