From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10969 invoked by alias); 28 Oct 2017 22:46:00 -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: 41958 Received: (qmail 23393 invoked by uid 1010); 28 Oct 2017 22:46:00 -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.7/5.0):. Processed in 1.257581 secs); 28 Oct 2017 22:46:00 -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.7 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RP_MATCHES_RCVD,SPF_PASS,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: SRS0=Cx+/=B3=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=1509230744; bh=m3bq0rfxvCmupW4ePGrY2useG51+K/HPct8hTaG0Ghw=; h=From:To:Subject:Date:From:Subject; b=RSL2Ds36CXwHqhcQi1kEtsWKZia29Pb7Go8WS+qgByHjvpHMAy17d7iUmtc7RjWIowPuRtU7f3F4XaEwo7Vgs8VHXgGytij+dmNw2B6rdt6swGuzjzJiGyAHdJOxKevEEsLemueC/sv9kzLPB2+gKws+nXwn14iGuxgKySFknBQ32dm+aiLep7GN84rMeTYFvvydcuCdbVpvwaprdCL4vHDbPWm2vVnvQkktxcJK3nuotK+r7y7CuHz3ppk9+gLGmfWIV74VC4JQC0m22Udz36R3ztf4nyuuq6EdRsUe5xaoB1yafGuk8LCQ0T8ijFXH6WTAH43kweoNvedAj9bqdA== X-YMail-OSG: Dwp59oAVM1nUjNexXjdJcdhvYNsUiNlFjC2vtupiw3Qrt4.w0h6cmyrKUSTUuj2 h6MU8Lwq.6YflmLhjellODFPbdLi3.WhUD22MINuaa0wWYCEwWJC_LZulvDXbLQ7bIbuJWk8lVmW a8NuXsVyrvlJh16ZF7x3_m28UzZBtys_GKAHGncIi0sHSOjAEcVk88vXQxcItpRgF0bF7_JT9S5V ..NGDq6vm6tlBpA3s.6Bc9kqq.uDfQF02lDX9vz5aZj5DbN.aI9H9xBA10aeAU5YNAo7WhdDewiF 6Ema60kxaI0j4r6NG4TkDEuroyFhakHEYQhcnwZHKXty2VmT_n.dC1eek6_t0MUNXTcnd.k65sKd P8AdG_XgOa8ajGhyGvXYpEN912D_4dNrjqvmfgvIETOrm3BetML_3DO4GskwBgtJeI27cb3kFgpU aaIeabThBwAEu0R7HU808MF9mb4ro7th1BNL7NAp0t5b0_LcIElPHBjUHzpQoHNQWEw0rVlhFQiU 70RlLnGVHaPiqnsVHxM2egpGN0VA0A0g_e44K X-Yahoo-Newman-Id: 451707.77705.bm@smtp138.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Dwp59oAVM1nUjNexXjdJcdhvYNsUiNlFjC2vtupiw3Qrt4. w0h6cmyrKUSTUuj2h6MU8Lwq.6YflmLhjellODFPbdLi3.WhUD22MINuaa0w WYCEwWJC_LZulvDXbLQ7bIbuJWk8lVmWa8NuXsVyrvlJh16ZF7x3_m28UzZB tys_GKAHGncIi0sHSOjAEcVk88vXQxcItpRgF0bF7_JT9S5V..NGDq6vm6tl BpA3s.6Bc9kqq.uDfQF02lDX9vz5aZj5DbN.aI9H9xBA10aeAU5YNAo7WhdD ewiF6Ema60kxaI0j4r6NG4TkDEuroyFhakHEYQhcnwZHKXty2VmT_n.dC1ee k6_t0MUNXTcnd.k65sKdP8AdG_XgOa8ajGhyGvXYpEN912D_4dNrjqvmfgvI ETOrm3BetML_3DO4GskwBgtJeI27cb3kFgpUaaIeabThBwAEu0R7HU808MF9 mb4ro7th1BNL7NAp0t5b0_LcIElPHBjUHzpQoHNQWEw0rVlhFQiU70RlLnGV HaPiqnsVHxM2egpGN0VA0A0g_e44K X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- From: Oliver Kiddle To: Zsh workers Subject: PATCH: update util-linux completions to 2.31 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10369.1509230728.1@thecus.kiddle.eu> Date: Sun, 29 Oct 2017 00:45:28 +0200 Message-ID: <10370.1509230728@thecus.kiddle.eu> A few commands gained extra options in util-linux 2.31. Linux's last has changed a bit. It was previously part of sysvinit-utils and another GNU psacct implementation is also around. I think the util-linux implementation is the only one we need to care about going forward but let me know if not. There's also a new completion for hexdump which was a BSD thing. It looks like for util-linux, they've perhaps taken the BSD code and not changed much besides adding long options. Oliver diff --git a/Completion/Linux/Command/_losetup b/Completion/Linux/Command/_losetup index 05ef7c56c..9cfaaf5bf 100644 --- a/Completion/Linux/Command/_losetup +++ b/Completion/Linux/Command/_losetup @@ -18,7 +18,7 @@ _arguments -s -S \ - 'info' \ '(-v --verbose)'{-v,--verbose}'[verbose mode]' \ '(-o --offset -a --all)'{-a,--all}'[show the status of all loop devices]' \ - '(-O --output)'{-O+,--output=}'[specify columns to be printed with --list]:column:_sequence -s , compadd - name autoclear back-file back-ino back-maj\:min maj\:min offset partscan ro sizelimit dio' \ + '(-O --output)'{-O+,--output=}'[specify columns to be printed with --list]:column:_sequence -s , compadd - name autoclear back-file back-ino back-maj\:min maj\:min offset partscan ro sizelimit dio log-sec' \ '(-J --json --raw -O --output -n --noheadings)'{-J,--json}'[use JSON --list output format]' \ '(-l --list)'{-l,--list}'[list currently used loop devices]' \ '(-J --json)--raw[raw output format]' \ @@ -36,6 +36,7 @@ _arguments -s -S \ '(-L --nooverlap)'{-L,--nooverlap}'[avoid possible conflict between devices]' \ '(-P --partscan)'{-P,--partscan}'[scan the partition table of newly created loop devices]' \ '--sizelimit[limit device to specified size]:size (bytes)' \ + '(-b --sector-size)'{-b+,--sector-size=}'[set logical sector size of loop device]:size (bytes)' \ '--show[print device name after setup]' \ '(-r --read-only)'{-r,--read-only}'[set up a read-only loop device]' \ '1:file:_files' \ diff --git a/Completion/Linux/Command/_lsblk b/Completion/Linux/Command/_lsblk index c8fbb27c7..f37305445 100644 --- a/Completion/Linux/Command/_lsblk +++ b/Completion/Linux/Command/_lsblk @@ -29,6 +29,7 @@ _arguments -C -s -S \ '(H)'{-i,--ascii}'[output ascii characters only]' \ '(H)'{-J,--json}'[use JSON output format]' \ '(H)'{-l,--list}'[use list format output]' \ + '(H)'{-t,--tree}'[use tree format output]' \ '(H)'{-P,--pairs}'[use key="value" output format]' \ '(H)'{-r,--raw}'[use raw output format]' \ + 'H' \ diff --git a/Completion/Linux/Command/_wipefs b/Completion/Linux/Command/_wipefs index 6e8507978..5142def8a 100644 --- a/Completion/Linux/Command/_wipefs +++ b/Completion/Linux/Command/_wipefs @@ -4,9 +4,19 @@ _arguments -s -S \ '(H -a --all)'{-a,--all}'[wipe all magic strings]' \ '(H -b --backup)'{-b,--backup}'[create a signature backup in $HOME]' \ '(H -f --force)'{-f,--force}'[force erasure]' \ + '(H -i --no-headings -J --json -p --parsable)'{-i,--no-headings}"[don't print headings]" \ + '(H -J --json -i --no-headings -p --parsable)'{-J,--json}'[use JSON output format]' \ '(H -n --no-act)'{-n,--no-act}'[do everything except the actual write() call]' \ '(H -o --offset)'{-o+,--offset=}'[specify offset to erase]:offset (bytes)' \ - '(H -p --parsable)'{-p,--parsable}'[print out in parsable instead of printable format]' \ + '(H -O --output)'{-O+,--output=}'[specify columns to display]: : _values -s, "column" + "uuid[partition/filesystem UUID]" + "label[filesystem label]" + "length[magic string length]" + "type[superblock type]" + "offset[magic string offset]" + "usage[type description]" + "device[block device name]"' \ + '(H -p --parsable -i --no-headings -J --json)'{-p,--parsable}'[print out in parsable instead of printable format]' \ '(H -q --quiet)'{-q,--quiet}'[suppress output messages]' \ '(H -t --types)'{-t+,--types=}'[limit the set of filesystem, RAIDs or partition tables]:type:_file_systems' \ '(H)*:disk device:_files -g "*(-%)" -P / -W /' \ diff --git a/Completion/Unix/Command/_hexdump b/Completion/Unix/Command/_hexdump index e69de29bb..f700ca683 100644 --- a/Completion/Unix/Command/_hexdump +++ b/Completion/Unix/Command/_hexdump @@ -0,0 +1,35 @@ +#compdef hexdump hd + +local -a args fmts optpar +fmts=( + {--one-byte-octal,-b}'[one-byte octal display]' + {--one-byte-char,-c}'[one-byte character display]' + {--two-bytes-decimal,-d}'[two-byte decimal display]' + {--two-bytes-octal,-o}'[two-byte octal display]' + {--two-bytes-hex,-x}'[two-byte hexadecimal display]' + {--format=,-e+}'[specify format string to be used for displaying data]:format' + {--format-file=,-f+}'[specify file that contains format strings]:file:_files' +) +args=( + '(H -n --length)'{--length=,-n+}'[interpret only specified amount of input]:length (bytes)' + '(H -s --skip)'{--skip=,-s+}'[skip specified bytes at the beginning]:offset (bytes)' + '(H -v --no-squeezing)'{--no-squeezing,-v}'[output identical lines]' +) + +[[ $service = hexdump ]] && fmts+=( {--canonical,-C}'[canonical hex+ASCII display]' ) + +if [[ $OSTYPE = linux* ]]; then + args+=( + '(-L --color)'{-L+,--color=}'[interpret color formatting specifiers colors are enabled by default]:mode' + + H + '(- *)'{-h,--help}'[display usage information]' + '(- *)'{-V,--version}'[display version information]' + ) +else + # strip long options by taking every second element + print -v fmts -f '%2$s' -- "$fmts[@]" + print -v args -f '%2$s' -- "$args[@]" + optpar=( -A "-*" ) +fi + +_arguments -s -S $optpar '*:file:_files' $args + '(formats)' '(H)'$^fmts diff --git a/Completion/Unix/Command/_last b/Completion/Unix/Command/_last index f198e0fff..2013cc1c2 100644 --- a/Completion/Unix/Command/_last +++ b/Completion/Unix/Command/_last @@ -4,19 +4,20 @@ local pattern arg args ttys ttys=( /dev/tty*(N) /dev/pts/*(N) reboot ) ttys=( ${ttys#/dev/} ) +[[ $OSTYPE = linux-gnu ]] || args=( -A "-*" ) for pattern arg in \ - '(solaris*|linux-gnu)' '-a[display hostname in last column]' \ - '((free|net|open)bsd*|darwin*|dragonfly*|linux-gnu)' '-h[limit sessions by hostname]:host:_hosts' \ - '((free|open)bsd*|linux-gnu)' '-s[report duration in seconds]' \ - '(freebsd*|openbsd*)' '-d[limit sessions to those active at snapshot time]:time ([[CC]YY][MMDD]hhmm[.SS])' \ - '((net|free|open)bsd*|darwin*|dragonfly*)' '-t[limit sessions by tty]:tty:_ttys -D' \ + '(solaris*|linux-gnu)' '(--hostlast)-a[display hostname in last column]' \ + '((free|net|open)bsd*|darwin*|dragonfly*)' '-h+[limit sessions by hostname]:host:_hosts' \ + '((free|open)bsd*)' '-s[report duration in seconds]' \ + '(freebsd*|openbsd*)' '-d+[limit sessions to those active at snapshot time]:time ([[CC]YY][MMDD]hhmm[.SS])' \ + '((net|free|open)bsd*|darwin*|dragonfly*)' '-t+[limit sessions by tty]:tty:_ttys -D' \ 'openbsd*' '-c[calculate total time]' \ - '^darwin*' '-f[specify account file]:file:_files' \ - '(solaris*|linux-gnu|freebsd*|openbsd*)' '-n[specify number of lines to show]:number' \ + '^darwin*' '(--file)-f+[specify account file]:file:_files' \ + '(solaris*|linux-gnu|freebsd*|openbsd*)' '(--limit)-n+[specify number of lines to show]:number' \ '((open|net)bsd*|dragonfly*)' '-T[show more detailed time information including year and seconds]' \ 'netbsd*' '-x[assume file is in wtmpx(5) format]' \ 'netbsd*' '-n[show IP of remote hosts]' \ - 'freebsd*' '-w[show seconds in durarion field]' \ + 'freebsd*' '-w[show seconds in duration field]' \ 'freebsd*' '-y[show year in session start time]' do [[ $OSTYPE = $~pattern ]] && args+=( $arg ) @@ -32,14 +33,21 @@ case $OSTYPE in ;; linux-gnu) args+=( - '-R[suppress display of hostname field]' - '-d[translate IP to hostname]' - '-F[show full login and logout times and dates]' - '-i[show IP of remote hosts]' - '-o[read old-format wtmp]' - '-t[limit sessions to those active at snapshot time]:time (YYYYMMDDhhmmss)' - '-w[show full user and domain names]' - '-x[display shutdown/runlevel entries]' + '(-a)--hostlast[display hostname in last column]' + '(-d --dns -i --ip)'{-d,--dns}'[translate IP to hostname]' + '(-f)--file=[specify account file]:file:_files' + '(-F --fulltimes)'{-F,--fulltimes}'[show full login and logout times and dates]' + '(-i --ip -d --dns)'{-i,--ip}'[show IP of remote hosts]' + '(-n)--limit=[specify number of lines to show]:number' + '(-R --nohostname)'{-R,--nohostname}'[suppress display of hostname field]' + '(-s --since)'{-s+,--since=}'[display lines since the specified time]:time (YYYYMMDDhhmmss)' + '(-t --until)'{-t+,--until=}'[display lines until the specified time]:time (YYYYMMDDhhmmss)' + '(-p --present)'{-p+,--present=}'[display who were present at the specified time]:time (YYYYMMDDhhmmss)' + '(-w --fullnames)'{-w,--fullnames}'[show full user and domain names]' + '(-x --system)'{-x,--system}'[display shutdown/runlevel entries]' + '--time-format=[show timestamps in the specified format]:format:(notime short full iso)' + '(- *)'{-h,--help}'[display usage information]' + '(- *)'{-V,--version}'[display version information]' ) ;; esac @@ -50,4 +58,4 @@ else args+=( '*:user:_users' ) fi -_arguments -s $args +_arguments -s -S $args