Help Command Example Defining your own help Help Command Cobra automatically adds a help command to your application when you have subcommands.This will be called when a user...
Example Example In the example below, we have defined three commands. Two are at the top leveland one (cmdTimes) is a child of one of the top commands. In this case the rootis ...
Usage Message Example Defining your own usage Usage Message When the user provides an invalid flag or invalid command, Cobra responds byshowing the user the ‘usage’. Examp...
Installing Installing Using Cobra is easy. First, use go get to install the latest versionof the library. This command will install the cobra generator executablealong with t...
Overview Overview Cobra is a library providing a simple interface to create powerful modern CLIinterfaces similar to git & go tools. Cobra is also an application that will gen...
nirvana 命令 nirvana 命令 Nirvana 命令对应的包在 cmd/nirvana 中,目前包括三个命令: init,用于初始化标准项目目录结构和必要文件 api,用于生成 API 文档(需要确保使用的是标准的项目结构,否则可能无法正常工作) client,用于生成 API 对应的客户端(需要确保使用的是标准的项目结构,否则可能...
Getting Started Getting Started While you are welcome to provide your own organization, typically a Cobra-basedapplication will follow the following organizational structure: ...