summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-07-10 14:47:46 -0600
committerTom Rini <trini@konsulko.com>2017-07-22 22:22:46 -0400
commitdee36c74ea39f3b9160759b850a22d53222ab4ce (patch)
tree6c1f871a72458de7a303b33e37af5c19b31c5a2d
parent7fe463f54f36b583f8577b321ab9f4c09c1a1a5d (diff)
downloadu-boot-dee36c74ea39f3b9160759b850a22d53222ab4ce.tar.gz
moveconfig: Tidy up imply flag parsing
Add an option to specify 'all' to enable all flags. Also print an error if an unrecognised flag is used. At present it just prints usage information which is not very helpful. Signed-off-by: Simon Glass <sjg@chromium.org>
-rwxr-xr-xtools/moveconfig.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/tools/moveconfig.py b/tools/moveconfig.py
index eb4927f278..4fd9387c84 100755
--- a/tools/moveconfig.py
+++ b/tools/moveconfig.py
@@ -1886,14 +1886,21 @@ def main():
if options.imply:
imply_flags = 0
- for flag in options.imply_flags.split():
- if flag == 'help' or flag not in IMPLY_FLAGS:
- print "Imply flags: (separate with ',')"
- for name, info in IMPLY_FLAGS.iteritems():
- print ' %-15s: %s' % (name, info[1])
- parser.print_usage()
- sys.exit(1)
- imply_flags |= IMPLY_FLAGS[flag][0]
+ if options.imply_flags == 'all':
+ imply_flags = -1
+
+ elif options.imply_flags:
+ for flag in options.imply_flags.split(','):
+ bad = flag not in IMPLY_FLAGS
+ if bad:
+ print "Invalid flag '%s'" % flag
+ if flag == 'help' or bad:
+ print "Imply flags: (separate with ',')"
+ for name, info in IMPLY_FLAGS.iteritems():
+ print ' %-15s: %s' % (name, info[1])
+ parser.print_usage()
+ sys.exit(1)
+ imply_flags |= IMPLY_FLAGS[flag][0]
do_imply_config(configs, options.add_imply, imply_flags,
options.skip_added)