Documentation
¶
Overview ¶
Package flags provides reusable flag helpers for CLI commands.
This package should only contain common flags that can be used by multiple commands to ensure unified naming and consistent behavior across the CLI. Command-specific flags should be defined locally in the command file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Environment ¶
Environment adds the required --environment/-e flag to a command. Retrieve the value with cmd.Flags().GetString("environment").
Usage:
flags.Environment(cmd)
// later in RunE:
env, _ := cmd.Flags().GetString("environment")
func MustBool ¶
MustBool returns the bool value, ignoring the error. Safe to use with registered flags where GetBool cannot fail.
func MustString ¶
MustString returns the string value, ignoring the error. Safe to use with registered flags where GetString cannot fail.
Types ¶
This section is empty.