$ifarg:wyvesque$endif$
$ifarg:wyvesque$else$pinkfish$endif$
$ifarg2:wyvesque$else$pinkfish$endif$
These three are rather complex. The first function will do the
following: if any arguments are given to the alias command, it will
be replaced with 'wyvesque', but if no arguments are given, it will
not be replaced with anything. The second also checks if there is
an argument, but unlike the first example, if there are no arguments
it will be replaced with 'pinkfish'. The third example is the same
as the second but it concentrates on argument 2 instead of the
entire argument chain. Meaning that if there is a second argument to
your alias, replace it with 'wyvesque', else if there is only one
argument, replace it with 'pinkfish'.
Note that you can put other functions inside such $ifarg$ aliases.
For example:
$ifarg3:t $1$ There are three arguments in this alias. Those
arguments are "$1$", "$2$", and "$3$". $else$ifarg2:t $1$ There are
two arguments in this alias! The first is "$1$" and the second is
"$2$". $else$ifarg1:t $1$ Only one argument in this alias. It is
"$1$".$endif$
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment