Skip to content

Allow downstream impl of mbed dm to print help #751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 14, 2018

Conversation

theotherjimmy
Copy link
Contributor

@theotherjimmy theotherjimmy commented Sep 10, 2018

The mbed dm subcommand has a complicated invocation. Instead of
duplicated the argument parser, I elected to pass the implementation
of mbed dm --help to the "downsteam implementation" (the python
script in mbed-os).

Resolves help issues in #747

The mbed dm subcommand has a complicated invocation. Instead of
duplicated the argument parser, I elected to pass the implementation
of `mbed dm --help` to the "downsteam implementation" (the python
script in mbed-os).
@screamerbg
Copy link
Contributor

Single line implementation! Love it! 👍

Copy link
Contributor

@screamerbg screamerbg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarceloSalazar Please try and review.

@MarceloSalazar
Copy link
Contributor

MarceloSalazar commented Sep 12, 2018

Thanks for looking into this. Now there is some help :)

However, as user I'm confused on which command I need to run.
See output:

C:\mbed>mbed dm -h
[mbed] Auto-installing missing Python modules...
usage: device_management.py [-h] [-l {debug,info,warning,exception}]
                            [--version]
                            {create,parse,verify,cert,init,sign,update} ...

Create or transform a manifest. Use C:\mbed\mbed-
os\tools\device_management.py [command] -h for help on each command.

positional arguments:
  {create,parse,verify,cert,init,sign,update}
    create              Create a new manifest
    parse               Parse an existing manifest
    verify              Verify an existing manifest
    cert                Create or examine a certificate
    init                Set default values for manifests
    sign                Sign an existing manifest
    update              Work with the Mbed Cloud Update service

optional arguments:
  -h, --help            show this help message and exit
  -l {debug,info,warning,exception}, --log-level {debug,info,warning,exception}
  --version             display the version

Why do I need to care about "device_management.py" ?
I'm not interested in the internals of Mbed OS tools.

My interface is (and should continue to be) Mbed CLI

@theotherjimmy
Copy link
Contributor Author

@MarceloSalazar That's something that should be changed in device_management.py.

@theotherjimmy
Copy link
Contributor Author

@MarceloSalazar I'll create a PR to have the device_managment.py help print correctly. My prototype does this:

$  mbed dm -h
[mbed] Auto-installing missing Python modules...
---
usage: mbed device-management [-h] [-l {debug,info,warning,exception}]
                              [--version]
                              {create,parse,verify,cert,init,sign,update} ...

Create or transform a manifest. Use mbed device-management [command] -h for
help on each command.

positional arguments:
  {create,parse,verify,cert,init,sign,update}
    create              Create a new manifest
    parse               Parse an existing manifest
    verify              Verify an existing manifest
    cert                Create or examine a certificate
    init                Set default values for manifests
    sign                Sign an existing manifest
    update              Work with the Mbed Cloud Update service

optional arguments:
  -h, --help            show this help message and exit
  -l {debug,info,warning,exception}, --log-level {debug,info,warning,exception}
  --version             display the version

@theotherjimmy
Copy link
Contributor Author

@MarceloSalazar Mbed OS PR up: ARMmbed/mbed-os#8104

@theotherjimmy theotherjimmy merged commit 58c5557 into ARMmbed:master Sep 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants