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

Improve CLI --help documentation #497

Merged
merged 1 commit into from Jun 6, 2018

Conversation

cdrage
Copy link
Member

@cdrage cdrage commented May 31, 2018

Separates the commands into appropriate categories.

Example:

Usage:
  odo [command]

Examples:
  # Creating and deploying a Node.js project
  git clone https://github.com/openshift/nodejs-ex && cd nodejs-ex
  odo create nodejs
  odo push

  # Accessing your Node.js component
  odo url create

Component Commands:
  component   Components of application.
  create      Create a new component
  delete      Delete an existing component
  describe    Describe the given component
  link        Link target component to source component
  list        List all components in the current application
  log         Retrieve the log for the given component.
  push        Push source code to a component
  update      Update the source code path of a component
  watch       Watch for changes, update component on change

Other Commands:
  app         Perform application operations
  catalog     Catalog related operations
  project     Perform project operations
  storage     Perform storage operations
  url         Expose component to the outside world

Utility Commands:
  completion  Output shell completion code
  help        Help about any command
  version     Print the client version information

Flags:
  -h, --help      help for odo
  -v, --verbose   Verbose output

Use "odo [command] --help" for more information about a command.

@cdrage
Copy link
Member Author

cdrage commented May 31, 2018

Closes #470

Ping @kadel

@surajnarwade
Copy link
Contributor

@cdrage , component commands, Other Commands etc options should not be printed if there's nothing into it

$ odo url
Expose component to the outside world.
....
....
Component Commands:

Other Commands:

Utility Commands:
...
...

Separates the commands into appropriate categories.

Example:

```sh
Usage:
  odo [command]

Examples:
  # Creating and deploying a Node.js project
  git clone https://github.com/openshift/nodejs-ex && cd nodejs-ex
  odo create nodejs
  odo push

  # Accessing your Node.js component
  odo url create

Component Commands:
  component   Components of application.
  create      Create a new component
  delete      Delete an existing component
  describe    Describe the given component
  link        Link target component to source component
  list        List all components in the current application
  log         Retrieve the log for the given component.
  push        Push source code to a component
  update      Update the source code path of a component
  watch       Watch for changes, update component on change

Other Commands:
  app         Perform application operations
  catalog     Catalog related operations
  project     Perform project operations
  storage     Perform storage operations
  url         Expose component to the outside world

Utility Commands:
  completion  Output shell completion code
  help        Help about any command
  version     Print the client version information

Flags:
  -h, --help      help for odo
  -v, --verbose   Verbose output

Use "odo [command] --help" for more information about a command.
```
@cdrage
Copy link
Member Author

cdrage commented Jun 1, 2018

@surajnarwade @kadel

This should work normal now 👍

Problem was that setting setUsageTemplate to rootCmd changes all the children, when we just want to change it for doing odo --help.

Setting a standard cmdUsageTemplate to each child, fixed it!

@surajnarwade
Copy link
Contributor

@cdrage , LGTM now

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.

None yet

3 participants