From 0d39b6b77a5ff059f69019d2d9167423e8cf258d Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Thu, 24 Jan 2019 22:07:08 -0700 Subject: [PATCH] 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 --- src/west/main.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/west/main.py b/src/west/main.py index bec1266..c174cc3 100755 --- a/src/west/main.py +++ b/src/west/main.py @@ -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('')