From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29154 invoked by alias); 17 Apr 2018 22:09:20 -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: 42676 Received: (qmail 8421 invoked by uid 1010); 17 Apr 2018 22:09:20 -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 0.89469 secs); 17 Apr 2018 22:09:20 -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, RCVD_IN_DNSWL_NONE,SPF_PASS,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: SRS0=VIZ7=HG=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=1524002951; bh=Pk1Yt8CISZ3LuKwLedMbNXx38CXYX0VCpPWEcUlgDys=; h=From:To:Subject:Date:From:Subject; b=iQgcyZ0JT1e5SSV2PLKDgXdM4EtOrvXyC/pTn/e0V/ZiGwOUcjyaEDqf8aFfvEJFS9jLY23VFliLOgHH7CoDH5XielJ5BjRkkD+n1he+bJ3fWTIkuzK2QLx0QfLHPtnDigmO2SOogundb9cy0V4aRUVmowh+/hUz9VKcj4XYOY0zvZ800qNpZaNEm6HctyNSs8npWJ0zozmeS4V/RfcuaBNjfiOB9vLSG7E2lTMqA5HE6Tg/Os+LjQNU8WFwa2vTdFYsUC7bE5eslRidvwq11oJC669W2IcZ/4dGx9ehro/e6uLfBaqDCFjV+ovYCibeTScZ1vbZJLaohusKM4En0w== X-YMail-OSG: 1kyPBA8VM1mSFIREBC.xcCddO53JlsrMNDn2AJAklkiBhHUevmZ_pPJBDwQh5I4 TK227J4qUfxuOHTEL0XCCwK18UUpl_WA0Epj8tmLxDE6QWuwSRWuCHuSKvA5leAQnrDXbXhTcPC3 1Efwg03WpGOTPG9HK0BwZedmxl0H01y0o3N.Cz_aEtCTiTvaHC4Y0Y.PQ7kRHI6XzRokDB8VAL3L 4vW69ascirDgV9QKPMEWcP6i3nvRLeRIiEC.CVraK27gjkhKVOu1N0eWivxDJ4wWFO4Hj4KQIPug 2UyiS4H9VNDUg6g7j60nbyPAzGx85ZK.Er2eNuIe7UDkvDTGeVEqmeOA.arywIohyw_kPLjbEHMR 1FbqpzXum_cuxWyxnxxvVJmOYI0UaODF43uPei1tlodAG7N4yQuAFy8SG0xK.cY0m5e_I09IA9IP VxWtDCf2M9URg4mEHS0.N_Rxa3MojsxbNV6EjsljTdQKoBEMjEIy8eX1chIbevcZE9Ls60w4OaUv qZ0N_05pK1Q-- From: Oliver Kiddle To: Zsh workers Subject: PATCH: handle system specific arguments in _dd MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13742.1524002937.1@thecus> Date: Wed, 18 Apr 2018 00:08:57 +0200 Message-ID: <13743.1524002937@thecus> This expands dd completion to deal with system specifics. Oliver diff --git a/Completion/Unix/Command/_dd b/Completion/Unix/Command/_dd index e51337f21..e5c5e63ce 100644 --- a/Completion/Unix/Command/_dd +++ b/Completion/Unix/Command/_dd @@ -1,17 +1,99 @@ #compdef dd gdd -_values -w 'option' \ - 'if[specify input file]:input file:_tilde_files' \ - 'of[specify output file]:output file:_tilde_files' \ - '(bs)ibs[input block size]:block size (bytes)' \ - '(bs)obs[output block size]:block size (bytes)' \ - '(ibs obs)bs[block size]:block size (bytes)' \ - 'cbs[conversion buffer size]:buffer size (bytes)' \ - 'skip[input blocks initially skipped]:blocks' \ - 'seek[output blocks initially skipped]:blocks' \ - 'files[specify number of input files to copy and concatenate]:number of files' \ - 'count[number of input blocks to copy]:blocks' \ - 'conv[specify conversions to apply]:conversion:_values -s , conversion - "(ebcdic ibm)ascii" "(ascii ibm)ebcdic" "(ascii ebcdic)ibm" - "(unblock)block" "(block)unblock" - "(ucase)lcase" "(lcase)ucase" swab noerror sync' +local -a vals conv flags +local variant + +_pick_variant -r variant gnu=GNU $OSTYPE --version + +vals=( + '(ibs obs)bs[block size]:block size (bytes)' + 'cbs[conversion buffer size]:buffer size (bytes)' + 'conv[specify conversions to apply]: :_values -s , conversion $conv' + 'count[number of input blocks to copy]:blocks' + '(bs)ibs[input block size]:block size (bytes)' + 'if[specify input file]:input file:_tilde_files' + '(bs)obs[output block size]:block size (bytes)' + 'of[specify output file]:output file:_tilde_files' + 'seek[output blocks initially skipped]:blocks' + 'skip[input blocks initially skipped]:blocks' +) +conv=( + '(ascii asciib oldascii ebcdic ebcdicb oldebcdic ibm ibmb oldibm)'{ascii,ebcdic,ibm} + '(unblock)block' '(block)unblock' + '(ucase)lcase' '(lcase)ucase' + swab sync noerror notrunc +) + +case $variant in + ^gnu) + vals+=( + 'files[specify number of input files to copy and concatenate]:number of files' + ) + ;| + (gnu|darwin|dragonfly|(free|net)bsd*) + conv+=( sparse ) + ;| + gnu|netbsd*) + vals+=( + '*iflag[specify read flags]:flag:_sequence compadd - $flags' + '*oflag[specify write flags]:flag:_sequence compadd - $flags' + ) + flags=( append direct directory dsync sync nonblock noctty nofollow ) + ;| + darwin*|dragonfly*|(free|net)bsd*) + vals+=( + 'oseek[output blocks initially skipped]:blocks' + ) + conv+=( + '(ascii oldascii ebcdic oldebcdic oldibm)'old{ascii,ebcdic,ibm} + ) + ;| + (darwin|dragonfly|freebsd|netbsd|solaris)*) + vals+=( + 'iseek[input blocks initially skipped]:blocks' + ) + ;| + (open|free)bsd*) + vals+=( + 'status[specify level of information to print to stderr]:level:(none noxfer)' + ) + conv+=( osync ) + ;| + + freebsd*) + vals+=( + 'fillchar[specify padding character]:character' + 'speed[limit copying speed]:speed (bytes/second)' + ) + conv+=( + '(pareven parnone parodd parset)'{pareven,parnone,parodd,parset} + ) + ;; + gnu) + vals+=( + 'status[specify level of information to print to stderr]:level:(none noxfer progress)' + ) + flags+=( fullblock noatime nocache count_bytes skip_bytes seek_bytes ) + conv+=( excl nocreat fdatasync fsync ) + ;; + netbsd*) + vals+=( + 'msgfmt[specify format for information summary]:format:(quiet posix human)' + 'progress[enable progress display]:enable:(1)' + ) + flags+=( + wronly rdwr creat trunc excl shlock exlock cloexec nosigpipe rsync alt_io async + ) + ;; + solaris*) + vals+=( + 'files[specify number of input files to copy and concatenate]:number of files' + 'oseek[output blocks initially skipped (via seek, not NUL-padding)]:blocks' + ) + conv+=( + '(ascii asciib ebcdic ebcdicb ibmb)'{ascii,ebcdic,ibm}b + ) + ;; +esac + +_values -w 'option' $vals