Commit graph

4 commits

Author SHA1 Message Date
Martí Bolívar 6e4c2b9be9 scripts: clean up west build/flash/debug help
Just changes to the west help output; no functional changes expected.

Make option descriptions lowercase to match the argparse module's
conventions. When multiple sentences are required, move them to parser
prolog/epilog or argument group description sections.

Clarify some points that have confused multiple people.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-06-29 08:47:04 -04:00
Martí Bolívar eb95bed552 scripts: west_commands: fix argument handling with runners.yaml
Refactor the code to support the new runners.yaml file created by the
build system.

Compared to fishing around in the CMake cache, this makes it trivial
to put all the command line arguments to a runner-based command on
equal footing, regardless of if they're defined in the runners package
proper or defined in run_common.py.

This allows board.cmake files to do things like this:

   board_set_runner_args(foo
     --bin-file=${PROJECT_BINARY_DIR}/my-signed.bin)

While at it, make some other cleanups:

- Stop using the obsolete and deprecated west.cmake module while we're
  here in favor of the zcmake.py module which was added to Zephyr a long
  time ago. Yikes. I had forgotten this was still here.

- Stop using west.util's wrap function in favor of raw use of
  textwrap. The west function splits on hyphens, which is breaking
  runner names like "em-starterkit".

- Clean up the --context output a bit

Fixes: #22563
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-20 09:06:09 +02:00
Marti Bolivar 808028b46f scripts: west commands: add text for "west --help"
Although each of these command implementations has good output for
"west <command> --help", the "west --help" output is missing the
one-line descriptions.

Add them by modifying west-commands.yml to use a new 'help' key in
each command name. These need to be kept in sync with the Python
sources. For now just do that by copy/pasting. We could add fancy
logic to load the help from west-commands.yml later if we want.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2019-01-29 10:15:01 +01:00
Marti Bolivar ab82264ace scripts: add west build, flash, and debug commands
West now supports a mechanism for extension commands. Use it to move
the command implementations that are tightly coupled with boards and
the zephyr build system back into the Zephyr repository.

This patch doesn't include test cases. Those will be moved over in a
subsequent patch.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2019-01-29 10:15:01 +01:00