mirror of
https://github.com/apricote/hcloud-upload-image.git
synced 2026-01-13 21:31:03 +00:00
docs: add generated CLI help output to repo
This commit is contained in:
parent
6d8d2a02df
commit
3f5ab06409
11 changed files with 188 additions and 18 deletions
20
cmd/root.go
20
cmd/root.go
|
|
@ -28,11 +28,13 @@ var (
|
|||
// The pre-authenticated client. Set in the root command PersistentPreRun
|
||||
var client *hcloudimages.Client
|
||||
|
||||
// rootCmd represents the base command when called without any subcommands
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "hcloud-upload-image",
|
||||
Long: `Manage custom OS images on Hetzner Cloud.`,
|
||||
SilenceUsage: true,
|
||||
// RootCmd represents the base command when called without any subcommands
|
||||
var RootCmd = &cobra.Command{
|
||||
Use: "hcloud-upload-image",
|
||||
Short: `Manage custom OS images on Hetzner Cloud.`,
|
||||
Long: `Manage custom OS images on Hetzner Cloud.`,
|
||||
SilenceUsage: true,
|
||||
DisableAutoGenTag: true,
|
||||
|
||||
Version: version.Version,
|
||||
|
||||
|
|
@ -98,18 +100,18 @@ func initClient(cmd *cobra.Command, _ []string) {
|
|||
}
|
||||
|
||||
func Execute() {
|
||||
err := rootCmd.Execute()
|
||||
err := RootCmd.Execute()
|
||||
if err != nil {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.SetErrPrefix("\033[1;31mError:")
|
||||
RootCmd.SetErrPrefix("\033[1;31mError:")
|
||||
|
||||
rootCmd.PersistentFlags().CountVarP(&verbose, flagVerbose, "v", "verbose debug output, can be specified up to 2 times")
|
||||
RootCmd.PersistentFlags().CountVarP(&verbose, flagVerbose, "v", "verbose debug output, can be specified up to 2 times")
|
||||
|
||||
rootCmd.AddGroup(&cobra.Group{
|
||||
RootCmd.AddGroup(&cobra.Group{
|
||||
ID: "primary",
|
||||
Title: "Primary Commands:",
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue