Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Completion batch #2: Misc. trivial fixes
- X-seq: zsh-workers 42209
- From: dana <dana@xxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] Completion batch #2: Misc. trivial fixes
- Date: Wed, 3 Jan 2018 15:29:52 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=M7tCCk0jm3VGCKlsUBavC2uHxU3TmG+YuTjbM6j5Hrg=; b=TmQotGsamb6xhUUnxLSI8jhVoyCXR2KR6I94VKYrrMQomb/52jhhMutkNXI7jGhq7e fR39pcmFzwNHmZmAO4qv/0R5hBjn89bC15AUr4X5bE2wYvWqLniuAFxofgRzaQHRSm34 /QD3SdxjhKnq0XNP2DVVo2QUccmRd4h8J7QtTcgFm9z00GPKX4lteqywFn3QAJ2sVGSK 4G1RWOqqWG6DRp/kqdVpd2Dg/q2D3qWF4yei7YcqRfKTD8cPXCT1CJObd1xyLgM821uC eGZHQtUR+W82Hgr40hf5ymOqOv4K/Z99txLXbLFgwWA10lCFi7QL1qbaQ4+dLPFiJcgb KYrg==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Some trivial/miscellaneous changes to existing functions:
1. I fixed a bug in `tr` completion — it wasn't showing the option descriptions
for non-GNU variants.
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
excluded BusyBox, even though the function doesn't currently make any effort
to check for it, because i plan to gradually add support for BusyBox variants
when it's not too irritating (will show up in later batches).
The changes after this one will be more complex.
dana
diff --git a/Completion/Unix/Command/_tr b/Completion/Unix/Command/_tr
index d244bf875..1cfe1200a 100644
--- a/Completion/Unix/Command/_tr
+++ b/Completion/Unix/Command/_tr
@@ -28,7 +28,7 @@ case $variant in
;|
*)
for k in c d s; do
- args+=( -$k$descr[$k] )
+ args+=( -$k$descr[-$k] )
done
;;
esac
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'
Messages sorted by:
Reverse Date,
Date,
Thread,
Author