From 4ae030fec1de8accc456543baba4e1404a94947f Mon Sep 17 00:00:00 2001 From: Diego Pino Date: Wed, 4 Oct 2023 16:22:12 +0000 Subject: [PATCH] automate-git: Print out invalid options on error --- tools/automate/automate-git.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/tools/automate/automate-git.py b/tools/automate/automate-git.py index 4f4d7265c..f1ec60b17 100644 --- a/tools/automate/automate-git.py +++ b/tools/automate/automate-git.py @@ -461,6 +461,11 @@ def check_pattern_matches(output_file=None): # Don't continue when we know the build will be wrong. sys.exit(1) +def invalid_options_combination(a, b): + print("Invalid combination of options: '%s' and '%s'" % (a, b)) + parser.print_help(sys.stderr) + sys.exit(1) + ## # Program entry point. @@ -808,14 +813,18 @@ if options.noupdate: if options.runtests: options.buildtests = True -if (options.nochromiumupdate and options.forceupdate) or \ - (options.nocefupdate and options.forceupdate) or \ - (options.nobuild and options.forcebuild) or \ - (options.nodistrib and options.forcedistrib) or \ - ((options.forceclean or options.forcecleandeps) and options.fastupdate): - print("Invalid combination of options.") - parser.print_help(sys.stderr) - sys.exit(1) +if (options.nochromiumupdate and options.forceupdate): + invalid_options_combination('--no-chromium-update', '--force-update') +if (options.nocefupdate and options.forceupdate): + invalid_options_combination('--no-cef-update', '--force-update') +if (options.nobuild and options.forcebuild): + invalid_options_combination('--no-build', '--force-build') +if (options.nodistrib and options.forcedistrib): + invalid_options_combination('--no-distrib', '--force-distrib') +if (options.forceclean and options.fastupdate): + invalid_options_combination('--force-clean', '--fast-update') +if (options.forcecleandeps and options.fastupdate): + invalid_options_combination('--force-clean-deps', '--fast-update') if (options.noreleasebuild and \ (options.minimaldistrib or options.minimaldistribonly or \