mkideal / cli

CLI - A package for building command line app with go
MIT License
730 stars 43 forks source link

Customize Desc #12

Closed suntong closed 8 years ago

suntong commented 8 years ago

Hey again 仕晋,

Any way for user to customize their own function description?

Please take a look at my such customization in demo how to handle none-option parameters,

My own function description customization looks good this way:

$ gogo build
Build golang application

Usage:
  gogo build [Options] Arch(i386|amd64)

Options:

  -h, --help
      display help information

  --dir[=./]
...

But it will have side-effects:

$ gogo
Golang package manager

  gogo is a new golang package manager
  very very good

Options:

  -h, --help
      display help information

  -v, --version
      display version

  -l, --list[=false]
      list all sub commands or not

Commands:
  build     Build golang application

Usage:
  gogo build [Options] Arch(i386|amd64)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  clean     Clean build data

Hope that you can provide a way for user to customize their function descriptions.

Thanks

suntong commented 8 years ago

Reposing the answer,

Desc is a brief description of command and Text is recommed for the detailed description. e.g.

Desc: "Build golang application"
Text: "Usage:\n  gogo build [Options] Arch(i386|amd64)",