-
go get github.com/spf13/cobra/cobra
-
cobra add -t github.com/dcos/dcos-checks/cmd/checks/<subcommand> <subcommand>
-
edit
cmd/checks/<subcommand>.go
-
rename
init()
tofunc Add(root *cobra.Command)
and change it accordingly:func Add(root *cobra.Command) { root.AddCommand(<subcommand>) // other flag and configuration goes here }
-
Modify
cmd/subcommands.go
to add your check.
see https://github.com/spf13/cobra for more details