Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Alias command /and/ flags



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