Skip to content

Refine command usage statements #1330

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

Open
Octobug opened this issue May 6, 2025 · 0 comments
Open

Refine command usage statements #1330

Octobug opened this issue May 6, 2025 · 0 comments
Labels
enhancement Enhancement request

Comments

@Octobug
Copy link
Contributor

Octobug commented May 6, 2025

Is your enhancement request related to a problem? Please describe

Yes, though it's not a big one. Current command usage statements seem a bit irregular.

...
Available Commands:
  build       used to build answer with plugins
  check       checking the required environment
  completion  Generate the autocompletion script for the specified shell
  config      set some config to default value
  dump        back up data
  help        Help about any command
  i18n        overwrite i18n files
  init        init answer application
  plugin      prints all plugins packed in the binary
  run         Run the application
  upgrade     upgrade Answer version
...

Describe the solution you'd like

Well, I've modified a version with a PR(#1331) as below.

  • There seems no open standard for command-line usage statements.
  • We can see some "styles" from examples from the cobra docs.
    • Command's descriptions are capitalized
    • But flags' are not
$ go run cmd/answer/main.go --help
Answer is a minimalist open source Q&A community.
To run answer, use:
        - 'answer init' to initialize the required environment.
        - 'answer run' to launch application.

Usage:
  answer [command]

Available Commands:
  build       Build Answer with plugins
  check       Check the required environment
  completion  Generate the autocompletion script for the specified shell
  config      Set some config to default value
  dump        Back up data
  help        Help about any command
  i18n        Overwrite i18n files
  init        Initialize Answer
  plugin      Print all plugins packed in the binary
  run         Run Answer
  upgrade     Upgrade Answer

Flags:
  -C, --data-path string   data path, eg: -C ./data/ (default "/data/")
  -h, --help               help for answer
  -v, --version            version for answer

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

Describe alternatives you've considered

A discussion might be needed.

@Octobug Octobug added the enhancement Enhancement request label May 6, 2025
Octobug added a commit to Octobug/answer that referenced this issue May 6, 2025
Octobug added a commit to Octobug/answer that referenced this issue May 6, 2025
Octobug added a commit to Octobug/answer that referenced this issue May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement request
Projects
None yet
Development

No branches or pull requests

1 participant