mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-07-03 05:33:42 +01: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:
@ -81,7 +81,15 @@ def main():
|
||||
# full argument parse cannot be complted until the commands are loaded; so
|
||||
# parse just the base args for know so we can get verbosity.
|
||||
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)
|
||||
log.init(settings.verbosity)
|
||||
|
||||
|
Reference in New Issue
Block a user