From 1ecc42490edabc207bcdad2efb91225a094d0620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Br=C3=B8nner?= Date: Tue, 9 Aug 2016 17:21:36 +0200 Subject: [PATCH] Only complete device files (and directories) + Some cleanup --- src/_lsblk | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/_lsblk b/src/_lsblk index 46c0646..f1d6718 100644 --- a/src/_lsblk +++ b/src/_lsblk @@ -1,11 +1,8 @@ #compdef lsblk -# zsh completions for 'lsblk' -# automatically generated with http://github.com/RobSis/zsh-completion-generator local arguments - -local LSBLK_COLS_ALL=( +local lsblk_cols_all=( NAME KNAME MAJ:MIN FSTYPE MOUNTPOINT LABEL UUID PARTTYPE PARTLABEL PARTUUID PARTFLAGS RA RO RM @@ -16,10 +13,9 @@ local LSBLK_COLS_ALL=( RAND PKNAME HCTL TRAN REV VENDOR) _lsblk_columns() { - compadd $@ $LSBLK_COLS_ALL + compadd $@ $lsblk_cols_all } - arguments=( '(-a --all)'{-a,--all}'[print all devices]' '(-b --bytes)'{-b,--bytes}'[print size in bytes rather than in human readable format]' @@ -44,7 +40,7 @@ arguments=( '(-x --sort)'{-x,--sort}'=[sort output by specified column]:Sort column:_lsblk_columns' '(-h --help)'{-h,--help}'[display this help and exit]' '(-V --version)'{-V,--version}'[output version information and exit]' - '*:filename:_files' + '*:device:_path_files -g "*(N-%) *(N-/)"' ) _arguments -s $arguments