From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14909 invoked by alias); 3 Jan 2018 23:40:55 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42211 Received: (qmail 22590 invoked by uid 1010); 3 Jan 2018 23:40:55 -0000 X-Qmail-Scanner-Diagnostics: from park01.gkg.net 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(205.235.26.22):SA:0(-1.4/5.0):. Processed in 9.850449 secs); 03 Jan 2018 23:40:55 -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=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS,T_DKIM_INVALID,T_RP_MATCHES_RCVD autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: SRS0=BPsE=D6=yahoo.co.uk=okiddle@bounces.park01.gkg.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Virus-Scanned: by amavisd-new at gkg.net Authentication-Results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1515022828; bh=jdFure6YtN3lDf/WPp8h1IPLPfyMB2GSwhfFVI5QZP0=; h=From:References:To:Subject:Date:From:Subject; b=tlECXW1LtMNLlZqpFsQqLCO94TpkUQbowDUqaeveORJWkjwuDs2Q+MkxqQuG8nRCq5iTx/uyXJHW+HMo260/0et6y/vzzjWFwPZYAXZOybjC2MwP8ckv8U9vnv6SfJdbb0TplduC57zhhtJcSzio693yVz7avlYX6jblPdTumu6b4WMAjvjLX/2HrrvLHaIpo5wdjI9qqWh3kWVW2p8k0qJzUGSx10jTSAXAcLE2u7RzxDnkEGNwDR3hFfz+IdTzzKcMitgNBEPbhXoVmlvyqawpGrityoP/ajKW4P/Wl30f/1Tvh6wizA8pa+Gij3Qcele/Dr/EH29nLiWzYMdcxw== X-YMail-OSG: oJWwhB8VM1k4hYqk5pdgD3Fk.V17zNRYJsdTfjmbNUj4e.m8zsWeoliKVzN38EM wyDqirouSxsjV6VSBrlFCIcHLon19.MbTa1wv85V.tocH2sZ7jfA2xc4Va1mxHKyRkTJwrTEimD4 vt470P13JdQ3HSaQY1_vQv5gptBpgDEd5oT7nxYssZVsN7.5ESbXguE2Utn1ZddEXZ1qD8755HGV UXN._CkLuzdDTnsrlVlArQYOz9quAi9y1BQ5PlRz2DD8z0MY0gCayokGveLtyNnMajyd6nqRJiWt 7Wn6CJA3Nawg0qBHrahEO20rFvLDd4x8iWUJeQVVstmF_cAwOibkQ2gDBYVY9PXor8DuLGeSqXMw 2LFnKxk9xsbOTC.NTa5n_JdVVAJg1Rli14PczIHjI3byBKKfHl4httOhLJeDWviB3RVlaDMAvs7x .OEqTbS6nl0weUVU7jRfx59UKeLH4WCtaJGE2ZXz9UxSbBeECdmSh2HneKpi6YxNkBqV6 In-reply-to: <289FC0FD-FDAB-4575-8882-E9F8F3FFE4C5@dana.is> From: Oliver Kiddle References: <289FC0FD-FDAB-4575-8882-E9F8F3FFE4C5@dana.is> To: zsh-workers@zsh.org Subject: Re: [PATCH] Completion batch #2: Misc. trivial fixes MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18173.1515022825.1@thecus.kiddle.eu> Date: Thu, 04 Jan 2018 00:40:25 +0100 Message-ID: <18174.1515022825@thecus.kiddle.eu> dana wrote: > 2. I updated `expand` and `unexpand` completion to account for numeric options > as in `expand -4` (instead of `expand -t4`); most variants support this. I > +# Most (un)expand variants, excluding BusyBox, allow e.g. -4 instead of -t4 > +[[ $_cmd_variant[$service] == *busybox* ]] || Digging around in $_cmd_variant is essentially looking into the internals of _pick_variant. The documented interface is to use the -r option to _pick_variant. Also, it is not saving the full output of expand --version, it will either have the value "gnu" or "unix". This needs to do something like: local variant _pick_variant -r variant gnu="Free Soft" busybox=busybox unix --version > +args+=( '!(-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -t --tabs)-'{0..9} ) Given that these are hidden options, excluding other numeric options is pointless. It is also arguably wrong because the tab width can be more than 9 characters wide: e.g. expand -20 is valid. I've applied the patch in full because it is probably easier that way.