Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: minor fix to compset usage
- X-seq: zsh-workers 41831
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: minor fix to compset usage
- Date: Mon, 09 Oct 2017 01:10:36 +0200
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1507504241; bh=lhYBpE+hRcfs6EPJc6Azv7dShL2dkowyKF6jGFa7Xvg=; h=From:To:Subject:Date:From:Subject; b=lzsS2DB9JJawHRrw7Of469jU8S2PbZCYLNHu5Ljfxa+Pn6RuoGxN1toaFV6yQwqkcHrwAtQE6haRxMZZ3KF8tVEMqEad6UxvIU+1bKtLqpWK25dGSM0enK4jU+wgr5Kvu+W3HFXZgmq3XbaZqoz3Byj/9gNc4PRyrpmL8X0JkZzvPX1U+wy3aOJJKfdHxGRKZkiPKESePPy9rIJXREu/kbXuzE7E0Yf131XAyg+DE8litzSAIoyspW0HDTH4t43Xf/BFPvAItHSRYnTL+aDjz2lGLAlBSpFKSSKT3V9k+zBguX9ruF+tBZMkP7Kme4AEz7VZ/YB/rzW3CMqr36n8aw==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
ogg123 completion does compset -p '*:' which is a typo. The intention
seems to have been -P.
We've also got a few cases where we do compset -P \?. There's nothing as
such wrong with that but compset -p 1 ought to be a more efficient way
to do the same thing. And as I tweaked them anyway to give me a few more
test cases for the previous patch, I've included that in this patch.
Oliver
diff --git a/Completion/Unix/Command/_less b/Completion/Unix/Command/_less
index 9092010f2..7f01952d2 100644
--- a/Completion/Unix/Command/_less
+++ b/Completion/Unix/Command/_less
@@ -91,7 +91,7 @@ _arguments -S -s -A "[-+]*" \
if [[ -n "$state" ]]; then
case $state in
prompts)
- if compset -P \?; then
+ if compset -p 1; then
_message -e prompt
else
_describe 'prompt' '(
diff --git a/Completion/Unix/Command/_vorbis b/Completion/Unix/Command/_vorbis
index eee4f7a5e..cb3e3f9d8 100644
--- a/Completion/Unix/Command/_vorbis
+++ b/Completion/Unix/Command/_vorbis
@@ -79,7 +79,7 @@ case $service in
esac
if [[ $state = devopts ]]; then
- if compset -p '*:'; then
+ if compset -P '*:'; then
_message -e value value
else
_wanted devopts expl 'device option' \
diff --git a/Completion/Unix/Type/_tilde_files b/Completion/Unix/Type/_tilde_files
index b1b3b37f0..0ee12332b 100644
--- a/Completion/Unix/Type/_tilde_files
+++ b/Completion/Unix/Type/_tilde_files
@@ -29,7 +29,7 @@ case "$PREFIX" in
_files "$@" -W "$user"
;;
\~*)
- compset -P '?'
+ compset -p 1
local -a expl=( "$@" )
_alternative -O expl users:user:_users named-directories:'named directory':'compadd -k nameddirs'
;;
diff --git a/Completion/Zsh/Type/_globquals b/Completion/Zsh/Type/_globquals
index a904bdf0d..c855b540e 100644
--- a/Completion/Zsh/Type/_globquals
+++ b/Completion/Zsh/Type/_globquals
@@ -167,7 +167,7 @@ while [[ -n $PREFIX ]]; do
([oO])
# complete/skip sort spec
- if ! compset -P "?"; then
+ if ! compset -p 1; then
alts=(
"n:lexical order of name"
"L:size of file"
Messages sorted by:
Reverse Date,
Date,
Thread,
Author