Documentation
¶
Index ¶
- func Bool(cmd *cobra.Command, name string) bool
- func Changed(cmd *cobra.Command, name string) bool
- func Int(cmd *cobra.Command, name string) int
- func RegisterFlags(cmd *cobra.Command, defs []api.FlagDef, opName string, opts *FlagOpts)
- func RequireAll(cmd *cobra.Command, names ...string) error
- func RequireStr(cmd *cobra.Command, name string) (string, error)
- func Str(cmd *cobra.Command, name string) string
- type FlagOpts
- type PatchHelper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterFlags ¶
RegisterFlags registers CLI flags from generated FlagDef definitions. opName is stored as a Cobra annotation so --schema can look it up at runtime. The Args validator is wrapped to allow --schema to bypass checks.
Types ¶
type PatchHelper ¶
type PatchHelper struct {
// contains filtered or unexported fields
}
PatchHelper tracks which flags were explicitly set, reducing boilerplate in PATCH command handlers that conditionally set body fields.
func NewPatchHelper ¶
func NewPatchHelper(cmd *cobra.Command) *PatchHelper
func (*PatchHelper) AnyChanged ¶
func (p *PatchHelper) AnyChanged() bool
func (*PatchHelper) Bool ¶
func (p *PatchHelper) Bool(flag string, target *bool)
func (*PatchHelper) Int ¶
func (p *PatchHelper) Int(flag string, target *int)
func (*PatchHelper) Str ¶
func (p *PatchHelper) Str(flag string, target *string)
func (*PatchHelper) Strs ¶
func (p *PatchHelper) Strs(flag string, target *[]string)
Click to show internal directories.
Click to hide internal directories.