rbtools.utils.aliases¶
Utilities for working with command aliases.
Functions
|
Expand the given alias. |
|
Do parameter substitution for the given command. |
|
Run the alias with the given arguments after expanding parameters. |
- rbtools.utils.aliases.replace_arguments(cmd, args, posix)[source]¶
Do parameter substitution for the given command.
Occurrances of variables
$1
,$2
, etc. are replaced with the nth element ofargs
(1-indexed). The special variable$*
is expanded to contain all arguments.If neither of these are present in the command, all arguments will be appended to the end.
- Parameters:
- Returns:
The command and its arguments.
- Return type:
- Raises:
ValueError – An invalid escape or missing quote was encountered.
- rbtools.utils.aliases.expand_alias(alias, args)[source]¶
Expand the given alias.
This function returns a tuple of the list of command line arguments and whether or not shell execution is required for the alias.