Documentation
¶
Index ¶
- func DisarmRequiredFlags(cmd *cobra.Command)
- func EmitBodySchema(w io.Writer, operationID string) error
- func EmitSchema(cmd *cobra.Command, w io.Writer) error
- func GroupMadeRunnable(cmd *cobra.Command) bool
- func Intercept(root *cobra.Command)
- func MarkDynamic(cmd *cobra.Command)
- func RearmRequiredFlags(cmd *cobra.Command)
- func UsageRequested(cmd *cobra.Command) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisarmRequiredFlags ¶ added in v0.1.68
DisarmRequiredFlags clears cobra's required-flag annotations so a --usage invocation answers with the command's schema even when required inputs are absent: requiredness is part of the answer, not a precondition for asking. Cobra validates the same annotations itself after the pre-run hooks, so skipping the CLI's own eager validation alone would not be enough. The cleared annotations are kept aside for RearmRequiredFlags, so a reused command tree keeps enforcing requiredness on later executions.
func GroupMadeRunnable ¶ added in v0.1.68
func MarkDynamic ¶ added in v0.1.68
MarkDynamic makes --usage render the command's schema live from its cobra definition.
func RearmRequiredFlags ¶ added in v0.1.68
RearmRequiredFlags restores the annotations DisarmRequiredFlags removed.
func UsageRequested ¶
Types ¶
This section is empty.