Package for creating command-oriented command line interfaces in Go.
The gocmdctrl package aims to make it easier to create command line
interfaces that have several commands. E.g.:
example-cli import
example-cli export
It includes a help command which prints information about the
available commands. A simple example that has a "help" and an "echo"
command:
import "fmt"
import "os"
import "launchpad.
func Echo(ctrl *gocmdctrl.CmdCtrl, args []string) int {
for _, arg := range args {
}
return 0
}
ctrl := gocmdctrl.
ctrl.
ctrl.
"hello")
os.
A more complete example can be found in the example/ folder.
There are Out and Err io.Writer objects to use for writing information.
By default they are stdout and stderr, but they can be overridden to
make testing easier.
Project information
- Maintainer:
- Björn Tillenius
- Driver:
- Not yet selected
- Licence:
- Simplified BSD Licence
View full history Series and milestones
trunk series is the current focus of development.
All code Code
- Version control system:
- Bazaar
- Programming languages:
- go,golang