Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Alias command /and/ flags
- X-seq: zsh-users 22125
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Alias command /and/ flags
- Date: Tue, 22 Nov 2016 13:11:01 -0800
- Cc: "Yuri D'Elia" <wavexx@xxxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=USHvWRMVxXYzMeIbbO4zQ6OmH0d+ybifLV2ZuFjvrkI=; b=ntjDlXylFImHRJzCeGk52XIj7H8Yp5yAJWwuaEvq+9B4QHnIqdh/mEjMbyyhWHHVQb WpLa5tcPXKbE9YtlomyIv9yLYqFqrm1xl9R1/1BvdJBFJNcpXlv5yHcMxExzvLbnWCN5 49UX7EqKrHMs2UxpC3ibJip0EOPDak42I7nCmbtT31YtlJIf2oxw4RhohjWVXrOIVLo1 UisPWkxMnsPiDL2TLbqB5jiRz1fOpHr2JvAw45M169hdeZDNXaapNaxywu+IVqq9wjuQ dR99OLZPMoZPZfjvDIGTFSiqFbfPvL2qhIEPM2nuk18lsUzUUO950Icob2vFyDGeAmPq 9xYw==
- In-reply-to: <878tsbfjs0.fsf@wavexx.thregr.org>
- 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
- References: <878tsbfjs0.fsf@wavexx.thregr.org>
On Tue, Nov 22, 2016 at 10:31 AM, Yuri D'Elia <wavexx@xxxxxxxxxx> wrote:
>
> Any reason:
>
> alias "cmd flag"="cmd2 flag2"
>
> shouldn't work at least in principle?
Sorry, no. Aliases (even "alias -g" global ones) operate on shell
syntax words, which in the most straightforward case means strings of
non-whitespace separated by whitespace. You can't create an alias for
something that has any word-delimiting space in the middle of it.
> I can think of a way by defining a "cmd" function and do the checking on
> the arguments myself
This is probably going to be the simplest option that will cover your
requirements. There are also various ways to attack this through
custom ZLE widgets but that would get even more esoteric.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author