zsh-users
 help / color / mirror / code / Atom feed
* Alias command /and/ flags
@ 2016-11-22 18:31 Yuri D'Elia
  2016-11-22 21:11 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Yuri D'Elia @ 2016-11-22 18:31 UTC (permalink / raw)
  To: zsh-users

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?


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-23 10:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-22 18:31 Alias command /and/ flags Yuri D'Elia
2016-11-22 21:11 ` Bart Schaefer
2016-11-23 10:12   ` Yuri D'Elia

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).