Did you know ... | Search Documentation: |
Pack execution_context -- prolog/execution_context.pl |
Type can be one of the atom, bool, number, string, list, list(atom)
, list(number)
.
in case of list types, the list can be specified as a list of atoms or numbers separate by comma (,)
or semicolon, and optionally enclosed into parenthesis or brackets (e.g. [ a, b,c, e]
,
or (1;2; 3 ; 4)
, or o, p ; q, r
) will work. Elements in the list are trimmed of left and right spaces.
Options can be one of:
describe(Message)
- provides human readable information about the command that is printed when
the CLI help is invoked (for cli options).long(Long)
- specifies the long name of the command line parameter prefixed with two dashes. If not provided then the
Long name is assumed to be based on the name with characters ' ', '_', ':' replaced by the dash. Value of the
variable can be either concatenated into argument with '=' character, or separated by space. For example if the long(some_option)
is given then the argument `--some-option=value`, or `--some-option value` will both assign value
to context variable of the Name.short(Short)
- specifies short variant of the command line argument prefixed by '-'. Value must be provided after the space. For
example if the option short(s)
is given then the argument `-s value` will assign 'value' to context variable of the Nameis_flag(Bool)
- if Bool is true, then the system recognize the options with out value and `--no-long options, where
long` correspnds to the
long(Atom)
option value. Variables of type bool
are implicitly considered to be flagsenv(EnvName)
- specifies the name of the environment variable to check for the value of the context variable. If not provided then the
EnvName name is assumed to be based on the name with characters ' ', '_', ':' replaced by the undescore.default(Value)
- Specifies the default values if no other means provides a value. If the Value is of the form context(Variable)
, then
context variable Variable is evaluated for the default value. Infinite dependency cycles are not resolved, so be carefull here.cli_command(Commands)
- Commands is list of CLI commands (see execute_cli/1), for which the variable is intended. This information
is only used to describe usage of the command. Either option short
or `long˙, and option `describe˙ must be provided to provide any
help information about the variable. The option cli_command([])
is interpreted as the option for all CLI commands. To resolve the contextual variable following steps are executed. The first step that succed will determine the Value
config.env
files are looked up in the file search paths defined as
config(config.env)
. This module resolves config path to the current working directory or into the config
directory of the current working
directory. The name variants are provided by the options of the predicate context_variable/2 or derived from the context variable
name. context_variable(OptionFunctor, OptionArg)
.
Options are checked for the module specific or local name of the option.