zsh-workers
 help / color / Atom feed
* [PATCH] Improve _lz4 level ordering
@ 2020-03-12  2:10 dana
  0 siblings, 0 replies; only message in thread
From: dana @ 2020-03-12  2:10 UTC (permalink / raw)
  To: Zsh hackers list

This is from way back in workers/43758, the whole reason Oliver added this -o
thing for me...

dana


diff --git a/Completion/Unix/Command/_lz4 b/Completion/Unix/Command/_lz4
index 2697c4d11..6676943c4 100644
--- a/Completion/Unix/Command/_lz4
+++ b/Completion/Unix/Command/_lz4
@@ -42,8 +42,8 @@ args=(
   '(b t -k --keep)--rm[remove source file]'
   '!(b t -c --stdout)--to-stdout'
   + b # Benchmark-mode options
-  "(C c d t)-b-[benchmark file using specified compression level]::compression level:(${(j< >)levels//-/})"
-  "(C c d t)-e-[specify upper compression level limit (with -b)]:compression level:(${(j< >)levels//-/})"
+  "(C c d t)-b-[benchmark file using specified compression level]:: :->levels"
+  "(C c d t)-e-[specify upper compression level limit (with -b)]: :->levels"
   '(C c d t)-i-[specify minimum evaluation time (with -b)]:evaluation time (seconds)'
   + c # Compress-mode options
   "(b d t ${(j< >)levels} -c0 -c1 -c2 -hc)"${^levels}
@@ -98,6 +98,11 @@ case $state in
       _message 'no more arguments' && ret=0
     fi
     ;;
+  levels)
+    _wanted levels expl 'compression level' \
+      compadd -o numeric - ${levels/#-/} \
+    && ret=0
+    ;;
 esac
 
 return ret


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-12  2:10 [PATCH] Improve _lz4 level ordering dana

zsh-workers

Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.zsh.workers


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git