Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Alias command /and/ flags
- X-seq: zsh-users 22124
- From: Yuri D'Elia <wavexx@xxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Alias command /and/ flags
- Date: Tue, 22 Nov 2016 19:31:59 +0100
- Cancel-lock: sha1:WeH1ItiEj9yOr6mq8CoOUKSC5Ww=
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Let's imagine I want to alias the specific invocation of "cmd flag" with
"cmd2 flag2". Is it possible to alias commands with arguments (that is,
only in command position and *not* global replacements)?
I'm of course looking for an *exact* match of the positional parameters,
no more.
I can think of a way by defining a "cmd" function and do the checking on
the arguments myself, which is definitely more generalizable, although
seems a bit overkill for a simple scenario I had in mind.
Any reason:
alias "cmd flag"="cmd2 flag2"
shouldn't work at least in principle?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author