Skip to content
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

Command Help #10

Open
jobala opened this issue Sep 3, 2022 · 0 comments
Open

Command Help #10

jobala opened this issue Sep 3, 2022 · 0 comments

Comments

@jobala
Copy link
Owner

jobala commented Sep 3, 2022

Command help is shown when a user adds the --help flag after a command. For Commando, I want to separate concerns between registering commands and command groups and their help information. Developers will define help in help.yaml file then commando will load the file and add help to the commands.

The yaml file should have the following format

parent child grand-child
    type: command
    short-summary: "grand-child help"
    parameters:
      - name: --body
        short-summary: "itemBody"
        long-summary: |
            Usage: --body content=XX content-type=XX
            content: The content of the item.
      - name: --end
        short-summary: "dateTimeTimeZone"
        long-summary: |
            Usage: --end date-time=XX time-zone=XX

Running parent child grand-child --help will result in the output below

usage: parent child grand-child [-h|--help] --body <string> --end <string>

Arguments:

  -h  --help      Print help information
       --body      itemBody
       --end        dateTimeTimeZone
@jobala jobala changed the title Load help information from help.yaml Command Help Sep 4, 2022
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

No branches or pull requests

1 participant