Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { // Automation enables automation-friendly JSON output. Automation bool `short:"A" long:"automation" description:"Whether to output in automation friendly JSON format." optional:"yes"` // Parameters are a set of <key>:<value> or <key>=<value> pairs, that ca be used for substitution in inputs. Parameters []Parameter `short:"P" long:"parameter" description:"A set of parameters, in <key>:<value> format." optional:"yes"` }
Command collects the base set of options in common to all commands.
func (*Command) BindVariables ¶
BindVariables provides a way to bind variables in strings with parameters provided either in the environment, or on the command line as '--parameter' pairs. In order to bind all variables in a string do as follows:
cmd.Bind("{env:SOME_ENV_VAR}={cli:key1}+{cli:key2}")
and it will be bound according to the following rules:
- variables of the form {env:<ENVVAR>} are bound to the corresponding environment variable
- variables of the forma {cli:<PARAM>} are bound to the corresponding parameter as provided on the command line via the command line switch.
Click to show internal directories.
Click to hide internal directories.