-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
main: handle ManifestImportError from extensions better
The default west manifest file in zephyrproject-rtos/zephyr recently added a project with an 'import'. That means that 'west build' will fail with the confusing 'invalid choice: "build"' error if you pull zephyr without running 'west update'. This is a worse experience than what happens when you run e.g. 'west list': running a built-in command that needs the manifest to do its work will happily tell you you need to run 'west update' to resolve the failed import. This is confusing people who pull and run 'west build', and we do have enough information to do better from WestArgumentParser.error(), which is the official argparse callback API invoked when parse_known_arguments() fails in this situation. Extract the error message formatting for this situation into a helper function and use it from error() to print the same message when we get ManifestImportError in these situations. Make the error message take up fewer lines while we are here. Signed-off-by: Martí Bolívar <[email protected]>
- Loading branch information
1 parent
51ad886
commit b6b130b
Showing
1 changed file
with
47 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters