Documentation ¶
Overview ¶
Package cli contains utilities for cobra.Command objects.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CobraBindEnvironmentVariables ¶
CobraBindEnvironmentVariables can be used at the root command level of a cobra CLI hierarchy to allow all command-line variables to be set by environment variables as well. Note that skewered-variable-names will automatically be translated to skewered_variable_names for compatibility with environment variables.
In addition, you can pass in an application name prefix such that all environment variables will need to start with PREFIX_ to be picked up as valid environment variables. For example, if you specified the prefix as "availability", then the program would only detect environment variables like "AVAILABILITY_KAFKA_BROKER" and not "KAFKA_BROKER". There is no need to capitalize the prefix name.
Note: CLI arguments (eg --address=127.0.0.1) will always take precedence over environment variables
Types ¶
This section is empty.