usage

package
v0.1.69 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisarmRequiredFlags added in v0.1.68

func DisarmRequiredFlags(cmd *cobra.Command)

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 EmitBodySchema added in v0.1.68

func EmitBodySchema(w io.Writer, operationID string) error

func EmitSchema

func EmitSchema(cmd *cobra.Command, w io.Writer) error

func GroupMadeRunnable added in v0.1.68

func GroupMadeRunnable(cmd *cobra.Command) bool

func Intercept added in v0.1.68

func Intercept(root *cobra.Command)

func MarkDynamic added in v0.1.68

func MarkDynamic(cmd *cobra.Command)

MarkDynamic makes --usage render the command's schema live from its cobra definition.

func RearmRequiredFlags added in v0.1.68

func RearmRequiredFlags(cmd *cobra.Command)

RearmRequiredFlags restores the annotations DisarmRequiredFlags removed.

func UsageRequested

func UsageRequested(cmd *cobra.Command) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL