west: main: tweak external command help

The current output looks kind of silly. Tweak it and add a TODO
comment for further noncritical improvements.

Signed-off-by: Marti Bolivar <marti@foundries.io>
This commit is contained in:
Marti Bolivar 2019-01-24 22:07:08 -07:00
parent 2908ede7a7
commit 0d39b6b77a
1 changed files with 12 additions and 2 deletions

View File

@ -140,10 +140,20 @@ class WestArgumentParser(argparse.ArgumentParser):
self.format_command(append, command, width)
append('')
# TODO we may want to be more aggressive about loading
# command modules by default: the current implementation
# prevents us from formatting one-line help here.
#
# Perhaps a commands.external_paranoid that if set, uses
# thunks, and otherwise just loads the modules and
# provides help for each command.
#
# This has its own wrinkle: we can't let a failed
# import break the built-in commands.
if self.west_externals:
for path, specs in self.west_externals.items():
append('commands from project {} at path "{}":'.
format(specs[0].project.name, path))
append('commands from project at "{}":'.
format(path))
for spec in specs:
self.format_external_spec(append, spec, width)
append('')