summary refs log tree commit diff
diff options
context:
space:
mode:
authordana <dana@dana.is>2018-01-03 15:29:52 -0600
committerOliver Kiddle <opk@zsh.org>2018-01-04 00:05:59 +0100
commit5f68531b5d8b1e6262f34e91bf047909f12dfeb2 (patch)
treef077c45cb80aa0482bd56f21296668a5a39d892a
parent9f8ed9914674f363bb2dbec0943f1ca6d409eadc (diff)
downloadzsh-5f68531b5d8b1e6262f34e91bf047909f12dfeb2.tar.gz
zsh-5f68531b5d8b1e6262f34e91bf047909f12dfeb2.tar.xz
zsh-5f68531b5d8b1e6262f34e91bf047909f12dfeb2.zip
42209: take account of numeric options such as -4 instead of -t4
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_unexpand4
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d03519564..e5ee40b30 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2018-01-03  Oliver Kiddle  <okiddle@yahoo.co.uk>
 
+	* dana: 42209: Completion/Unix/Command/_unexpand: take account
+	of numeric options such as -4 instead of -t4
+
 	* dana: 42209: Completion/Unix/Command/_tr: fix option
 	descriptions for non-GNU variants
 
diff --git a/Completion/Unix/Command/_unexpand b/Completion/Unix/Command/_unexpand
index 13f6ce835..b548b3c3a 100644
--- a/Completion/Unix/Command/_unexpand
+++ b/Completion/Unix/Command/_unexpand
@@ -28,6 +28,10 @@ elif [[ $OSTYPE = (*bsd*|dragonfly*|darwin*) ]]; then
 fi
 [[ $service = *un* ]] && args+=(  "(--all --help --version)-a[$all]" )
 
+# Most (un)expand variants, excluding BusyBox, allow e.g. -4 instead of -t4
+[[ $_cmd_variant[$service] == *busybox* ]] ||
+args+=( '!(-0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -t --tabs)-'{0..9} )
+
 _arguments -s -S "$args[@]" \
   "(--tabs --help)-t+${tabs}" \
   '*:file:_files'