From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6414 invoked by alias); 22 Nov 2016 22:12:39 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22125 Received: (qmail 26992 invoked from network); 22 Nov 2016 22:12:39 -0000 X-Qmail-Scanner-Diagnostics: from mail-qk0-f173.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.220.173):SA:0(-0.7/5.0):. Processed in 1.05873 secs); 22 Nov 2016 22:12:39 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.220.173 as permitted sender) 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=USHvWRMVxXYzMeIbbO4zQ6OmH0d+ybifLV2ZuFjvrkI=; b=IdbR3e6wlKKJK6gXURGXdNpCHqDdIDnTUY+6O1xrFEFsW4Duxwqfom5nIPqr+GE99t vEUIaSPPHfA2//iMv5QTEsfxajDIZcGkyr4jrA6g/hm4NMZ6g6F1QaHWYBRRoHqGNZhc ZW5rsKzr/dAofMLQw6oV/bdyvmzf4yTmYdhFiVuud9ZlH6tuytulWa5qp+2ZPBDXspCg XORW/sR39k/9+dDqOpQW3nXglOQCuFNzaGq4igTQYJUWInl0+RAF1FPQTh/Fk22gK5lT TVJAEtb1WgHOEYQ0TSL78y2+y1eoESnaG817lrikLaJnGsU8xOy4fa6TWJ9faq5WSTjo XrgQ== X-Gm-Message-State: AKaTC00QjPJ2zH2cffBlwfzIsYg9ZuBUqVRjOAAYitAtGlGrJWsRPwcMsDKQtuE1tnjePqvnfXQNVZIDOXK05A== X-Received: by 10.55.78.147 with SMTP id c141mr27949911qkb.4.1479849061560; Tue, 22 Nov 2016 13:11:01 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <878tsbfjs0.fsf@wavexx.thregr.org> References: <878tsbfjs0.fsf@wavexx.thregr.org> From: Bart Schaefer Date: Tue, 22 Nov 2016 13:11:01 -0800 Message-ID: Subject: Re: Alias command /and/ flags To: Zsh Users Cc: "Yuri D'Elia" Content-Type: text/plain; charset=UTF-8 On Tue, Nov 22, 2016 at 10:31 AM, Yuri D'Elia 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.