diff --git a/cmd/pinniped/cmd/cobra_util.go b/cmd/pinniped/cmd/cobra_util.go index 9b153a72..c861dabf 100644 --- a/cmd/pinniped/cmd/cobra_util.go +++ b/cmd/pinniped/cmd/cobra_util.go @@ -13,3 +13,12 @@ func mustMarkRequired(cmd *cobra.Command, flags ...string) { } } } + +// mustMarkHidden marks the given flags as hidden on the provided cobra.Command. If any of the names are wrong, it panics. +func mustMarkHidden(cmd *cobra.Command, flags ...string) { + for _, flag := range flags { + if err := cmd.Flags().MarkHidden(flag); err != nil { + panic(err) + } + } +}