Assuming we're going to have below commands in our app:
app serve
app config
app config create
$cobraaddserve$cobraaddconfig$cobraaddcreate-p'configCmd'# `create` is a sub command of `config` named `configCmd` $tree..├──LICENSE├──cmd│├──config.go│├──create.go│├──root.go│└──serve.go└──main.go
Try it out
$gorunmain.goAlongerdescriptionthatspansmultiplelinesandlikelycontainsexamplesandusageofusingyourapplication.Forexample:CobraisaCLIlibraryforGothatempowersapplications.ThisapplicationisatooltogeneratetheneededfilestoquicklycreateaCobraapplication.Usage:corbra-app [command]AvailableCommands:configAbriefdescriptionofyourcommandhelpHelpaboutanycommandserveAbriefdescriptionofyourcommandFlags:--configstringconfigfile (default is $HOME/.corbra-app.yaml)-h,--helphelpforcorbra-app-t,--toggleHelpmessagefortoggleUse"corbra-app [command] --help"formoreinformationaboutacommand.$gorunmain.goserveservecalled$gorunmain.goconfigconfigcalled$gorunmain.goconfigcreatecreatecalled