mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
Add a warning to the docs about $args in ExecAlias (#5033)
This commit is contained in:
parent
81e3bdd207
commit
d173ad7f3b
1 changed files with 10 additions and 0 deletions
|
@ -1264,6 +1264,16 @@ or by the index in ``$arg<n>`` environment variables.
|
|||
>>> aliases['piu'] = 'pip install -U @($args)'
|
||||
>>> aliases['cdls'] = 'cd $arg0 && ls'
|
||||
|
||||
.. warning:: That means, if you need ``@()`` in your alias, you can't rely on
|
||||
automatic argument handling anymore. Any alias involving it needs
|
||||
to add ``$args`` at the end manually if you don't want your alias
|
||||
to ignore supplied arguments.
|
||||
|
||||
.. code-block:: xonshcon
|
||||
|
||||
>>> aliases['careful'] = 'echo @("all args will be ignored")'
|
||||
>>> aliases['better'] = 'echo @("the arguments are: ") @($args)'
|
||||
|
||||
.. note::
|
||||
|
||||
To add multiple aliases there is merge operator: ``aliases |= {'e': 'echo', 'g': 'git'}``.
|
||||
|
|
Loading…
Add table
Reference in a new issue