1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-31 10:11:17 +00:00

framework/entrypoint: Fix help information for subcommands

Previously only the top level help message would ever be displayed,
this was caused by 'parse_known_commands' automatically displaying the
default help message and exiting before any of the custom plugins are
loaded. Now ensure this flag is never passed into the method.
This commit is contained in:
Marc Bonnici 2017-12-01 15:04:44 +00:00 committed by setrofim
parent bfb9dd2c43
commit b85098d5b2

View File

@ -81,7 +81,15 @@ def main():
# full argument parse cannot be complted until the commands are loaded; so # full argument parse cannot be complted until the commands are loaded; so
# parse just the base args for know so we can get verbosity. # parse just the base args for know so we can get verbosity.
argv = split_joined_options(sys.argv[1:]) argv = split_joined_options(sys.argv[1:])
args, _ = parser.parse_known_args(argv)
# 'Parse_known_args' automatically displays the default help and exits
# if '-h' is detected, we want our custom help messages so ensure this
# is never passed as a parameter.
filtered_argv = list(argv)
if '-h' in filtered_argv:
filtered_argv.remove('-h')
args, _ = parser.parse_known_args(filtered_argv)
settings.set("verbosity", args.verbose) settings.set("verbosity", args.verbose)
log.init(settings.verbosity) log.init(settings.verbosity)