Expand description
§shvar
shvar is the SHell VARiable expansion library.
§Status
Maintenance track. The library is considered stable and will be put into maintenance mode if unchanged for one year.
§Scope
This library provides the quote
, split
, expand
, and rcvar
functions.
§Warts
- A string with
'{'
and'}'
characters outside the variable declarations won’t parse right now.
§Documentation
The latest documentation is always available at docs.rs.
Structs§
- Environment
Provider - A VariableProvider that reads variable values from the environment.
- Prefixing
Variable Provider - A VariableProvider that prepends a prefix before lookup.
Enums§
- Error
- An error occurred during expansion or quoting operations.
Traits§
- Variable
Provider - A VariableProvider provides a way to lookup the value of a variable.
- Variable
Witness - A VariableWitness collects the identifiers of variables in use in a string.
Functions§
- awkward_
quote_ string - Awkwardly quote the string.
- double_
quote_ string - Put the string in double quotes, escaping ‘$’, ‘`’, ‘“’, ‘\’, and ‘\n’.
- expand
- Expand the input to a shell-quoted string suitable for passing to
split
. - expand_
recursive - quote
- Quote the pieces in such a way that splitting the quoted string will return the original pieces.
- quote_
string - Quote the string using double quotes, single quotes, or awkward quotes.
- rcvar
- Return a vector of the variables in use by this script.
- single_
quote_ string - Single quote the provided string, if it contains no single-quote characters.
- split
- Split the string in a way that respects quoting rules.