中文帮助
a simple library to build golang command line (cli / cmd)apps
go get github.com/seastart/cli-go
respect cobra urfave cli
./app [-main_opt1=1] [command] [-cmd_opt1=1] [-cmd_opt2=2] [subcommands/args]
app
is the application
command
is sub command, no prefix -
opt
is options, start with -
one app may have some main options, such as environment config, like main_opt1 of above example
one app may have some commands, like command of above example
one command may have some command options, like cmd_opt1 cmd_opt2 of above example
one command may have some subcommands(arguments), like subcommands of above example
app := cli.NewCliApp
app.AddCommand
app.Run
./main
./main -start=2
./main
./main test -start=2
./main list -page=3
./main
./main test live
./main test -start=2 live
// set default env and then run list command
./main -env=prod list -page=3
each app have a default help command
./main help
- support i18n
- support persistentRun