I need to start working on command line tool, and I’ve few questions
we have decided to use cobra for go https://github.com/spf13/cobra
From the help :
$ cobra help
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.
Usage:
cobra [command]
Available Commands:
add Add a command to a Cobra Application
help Help about any command
init Initialize a Cobra Application
Flags:
-a, --author string author name for copyright attribution (default "YOUR NAME")
--config string config file (default is $HOME/.cobra.yaml)
-h, --help help for cobra
-l, --license string name of license for the project
--viper use Viper for configuration (default true)
Use "cobra [command] --help" for more information about a command.
My questions are:
- what is the relations/diff between commands and flags (Available Commands) semantic ….
- is there is relations between command and flags
- Are single command should support flags
- in case in Need to provide command like deploy to x should it be ‘deploy -x’