main: tweak 'west help' text for extensions

Use the phrase "extension commands" and print the project path along
with its name.

We don't use {name_and_path} here because users probably aren't used
to that format yet.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Marti Bolivar 2019-09-26 13:15:22 -06:00
parent a335ea0510
commit 88d750bed5
2 changed files with 7 additions and 5 deletions

View File

@ -168,8 +168,10 @@ class WestArgumentParser(argparse.ArgumentParser):
if not specs:
continue
append('commands from project at "{}":'.
format(path))
project = specs[0].project # they're all from this project
append(project.format(
'extension commands from project '
'{name} (path: {path}):'))
for spec in specs:
self.format_extension_spec(append, spec, width)

View File

@ -362,11 +362,11 @@ def test_extension_command_multiproject(repos_tmpdir):
# The newline shenanigans are for Windows.
help_text = '\n'.join(cmd('-h').splitlines())
expected = '\n'.join([
'commands from project at "{}":'.format(os.path.join('subdir',
'Kconfiglib')),
'extension commands from project Kconfiglib (path: {}):'.
format(os.path.join('subdir', 'Kconfiglib')),
' kconfigtest: (no help provided; try "west kconfigtest -h")', # noqa: E501
'',
'commands from project at "net-tools":',
'extension commands from project net-tools (path: net-tools):',
' test-extension: test-extension-help'])
assert expected in help_text, help_text