diff mbox series

[08/24] qconfig: Move arg checking a little higher

Message ID 20240717155712.2913651-9-sjg@chromium.org
State Accepted
Commit fd385b3b013d13f567f3016c8c8da6667301b8ea
Delegated to: Simon Glass
Headers show
Series qconfig: Tidy up main() and add a small feature | expand

Commit Message

Simon Glass July 17, 2024, 3:56 p.m. UTC
Check for scan_source as one of the possible operations for this tool,
moving the check above the scan_source implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/qconfig.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Simon Glass July 26, 2024, 12:59 p.m. UTC | #1
Check for scan_source as one of the possible operations for this tool,
moving the check above the scan_source implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/qconfig.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/tools/qconfig.py b/tools/qconfig.py
index d8f0a716fe9..6d263ce30db 100755
--- a/tools/qconfig.py
+++ b/tools/qconfig.py
@@ -1534,14 +1534,15 @@  def main():
     col = terminal.Color(terminal.COLOR_NEVER if args.nocolour
                          else terminal.COLOR_IF_TERMINAL)
 
+    if not any((args.force_sync, args.build_db, args.imply, args.find,
+                args.scan_source)):
+        parser.print_usage()
+        sys.exit(1)
+
     if args.scan_source:
         do_scan_source(os.getcwd(), args.update)
         return 0
 
-    if not any((args.force_sync, args.build_db, args.imply, args.find)):
-        parser.print_usage()
-        sys.exit(1)
-
     # prefix the option name with CONFIG_ if missing
     configs = [prefix_config(cfg) for cfg in args.configs]