August 2019
Beginner to intermediate
798 pages
17h 2m
English
In this section, we are going to implement a simple command-line utility using cobra and the ~/go/bin/cobra tool that comes with the package. If you execute ~/go/bin/cobra without any command-line arguments, you will get the following output:
$ ~/go/bin/cobra
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 ...Read now
Unlock full access