diff options
author | Simon Glass | 2024-07-17 16:57:11 +0100 |
---|---|---|
committer | Simon Glass | 2024-07-26 08:01:06 -0600 |
commit | c57d406134d6c1cd6a5471df04ef27b4ff28d1ff (patch) | |
tree | 9018816f1fb6e1ef0e5253b57a161694374bd283 | |
parent | e23a5839403608bf42048e9b2da1e6a4fee6fda1 (diff) |
qconfig: Move operation check into parse_args()
Put the check for an operation being provided into the parse_args()
function, to reduce the size of main().
Signed-off-by: Simon Glass <sjg@chromium.org>
-rwxr-xr-x | tools/qconfig.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/qconfig.py b/tools/qconfig.py index dd24e4b398b..408807931ff 100755 --- a/tools/qconfig.py +++ b/tools/qconfig.py @@ -1552,7 +1552,13 @@ doc/develop/moveconfig.rst for documentation.''' help='show any build errors as boards are built') parser.add_argument('configs', nargs='*') - return parser, parser.parse_args() + args = parser.parse_args() + if not any((args.force_sync, args.build_db, args.imply, args.find, + args.scan_source, args.test)): + parser.print_usage() + sys.exit(1) + + return parser, args def imply(args): @@ -1660,11 +1666,6 @@ def do_tests(): def main(): """Main program""" parser, args = parse_args() - if not any((args.force_sync, args.build_db, args.imply, args.find, - args.scan_source, args.test)): - parser.print_usage() - sys.exit(1) - check_top_directory() # prefix the option name with CONFIG_ if missing |