updated version flag to internal/flags (#369)

This commit is contained in:
Zack Brady
2024-12-04 14:29:51 -05:00
committed by GitHub
parent 01faf396bb
commit f5e3b38a6d
2 changed files with 15 additions and 3 deletions

12
internal/flags/version.go Normal file
View File

@@ -0,0 +1,12 @@
package flags
import "github.com/spf13/cobra"
type VersionOpts struct {
JSON bool
}
func (o *VersionOpts) AddFlags(cmd *cobra.Command) {
f := cmd.Flags()
f.BoolVar(&o.JSON, "json", false, "Set the output format to JSON")
}