mirror of
https://github.com/apricote/hcloud-upload-image.git
synced 2026-01-13 21:31:03 +00:00
feat(cli): docs grouping and version
This commit is contained in:
parent
d8e39159f0
commit
847b696c74
4 changed files with 29 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ import (
|
|||
"github.com/apricote/hcloud-upload-image/hcloudimages/backoff"
|
||||
"github.com/apricote/hcloud-upload-image/hcloudimages/contextlogger"
|
||||
"github.com/apricote/hcloud-upload-image/internal/ui"
|
||||
"github.com/apricote/hcloud-upload-image/internal/version"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -34,6 +35,8 @@ var rootCmd = &cobra.Command{
|
|||
Long: `Manage custom OS images on Hetzner Cloud.`,
|
||||
SilenceUsage: true,
|
||||
|
||||
Version: version.Version,
|
||||
|
||||
PersistentPreRun: func(cmd *cobra.Command, _ []string) {
|
||||
ctx := cmd.Context()
|
||||
|
||||
|
|
@ -100,4 +103,9 @@ func init() {
|
|||
rootCmd.SetErrPrefix("\033[1;31mError:")
|
||||
|
||||
rootCmd.PersistentFlags().CountVarP(&verbose, flagVerbose, "v", "verbose debug output, can be specified up to 2 times")
|
||||
|
||||
rootCmd.AddGroup(&cobra.Group{
|
||||
ID: "primary",
|
||||
Title: "Primary Commands:",
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue