##// END OF EJS Templates
alias: fix shell alias documentation (issue3374)...
Patrick Mezard -
r16513:aa252059 stable
parent child Browse files
Show More
@@ -211,7 +211,7 b' An alias can start with an exclamation p'
211 211 shell alias. A shell alias is executed with the shell and will let you
212 212 run arbitrary commands. As an example, ::
213 213
214 echo = !echo
214 echo = !echo $@
215 215
216 216 will let you do ``hg echo foo`` to have ``foo`` printed in your
217 217 terminal. A better example might be::
@@ -221,11 +221,17 b' terminal. A better example might be::'
221 221 which will make ``hg purge`` delete all unknown files in the
222 222 repository in the same manner as the purge extension.
223 223
224 Shell aliases are executed in an environment where ``$HG`` expand to
224 Positional arguments like ``$1``, ``$2``, etc. in the alias definition
225 expand to the command arguments. Unmatched arguments are
226 removed. ``$0`` expands to the alias name and ``$@`` expands to all
227 arguments separated by a space. These expansions happen before the
228 command is passed to the shell.
229
230 Shell aliases are executed in an environment where ``$HG`` expands to
225 231 the path of the Mercurial that was used to execute the alias. This is
226 232 useful when you want to call further Mercurial commands in a shell
227 233 alias, as was done above for the purge alias. In addition,
228 ``$HG_ARGS`` expand to the arguments given to Mercurial. In the ``hg
234 ``$HG_ARGS`` expands to the arguments given to Mercurial. In the ``hg
229 235 echo foo`` call above, ``$HG_ARGS`` would expand to ``echo foo``.
230 236
231 237 .. note:: Some global configuration options such as ``-R`` are
General Comments 0
You need to be logged in to leave comments. Login now