Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: fix uses of literal % characters in completion descriptions



With some helper functions like _description and _arguments, the
descriptions pass via zformat so care is needed to double any %
characters to avoid them being interpreted.

I found some where where an intended literal % is getting lost and a
couple of functions that use %B...%b for bold rather than leaving that
to user style preferences.

Oliver

diff --git a/Completion/Linux/Command/_valgrind b/Completion/Linux/Command/_valgrind
index 4a710e7f7..23a8cd734 100644
--- a/Completion/Linux/Command/_valgrind
+++ b/Completion/Linux/Command/_valgrind
@@ -20,7 +20,7 @@ common_own_malloc=(
   '--alignment=-[set minimum alignment of heap allocations]:number [16]'
   '--redzone-size=-[set minimum size of redzones added before/after heap blocks]:size (bytes) [16]'
   '--xtree-memory=-[profile heap memory in an xtree [none]:(none allocs full)'
-  '--xtree-memory-file=-[specify xtree memory report file]:file [xtmemory.kcg.%p]:_files'
+  '--xtree-memory-file=-[specify xtree memory report file]:file [xtmemory.kcg.%%p]:_files'
 )
 
 common_read_varinfo=(
@@ -67,7 +67,7 @@ args_addrcheck=(
   '(--show-leak-kinds)--show-reachable=-[show reachable blocks in leak check]:enable:(yes no)'
   '(--show-leak-kinds)--show-possibly-lost=-:enable:(yes no)'
   '--xtree-leak=-[output leak result in xtree format]:enable [no]:(yes no)'
-  '--xtree-leak-file=-[specify xtree leak report file]:file [xtleak.kcg.%p]:_files'
+  '--xtree-leak-file=-[specify xtree leak report file]:file [xtleak.kcg.%%p]:_files'
   '--undef-value-errors=-[check for undefined value errors]:enable [yes]:(yes no)'
   '--track-origins=-[show origins of undefined values]:enable [no]:(yes no)'
   $common_partial
@@ -123,7 +123,7 @@ args_cachegrind=(
   '--LL=-[set LL cache manually]:size,assoc,line_size'
   '--cache-sim=-[collect cache stats]:enable [yes]:(yes no)'
   '--branch-sim=-[collect branch prediction stats]:enable [no]:(yes no)'
-  '--cachegrind-out-file=-[specify output file name]:file name [cachegrind.out.%p]:_files'
+  '--cachegrind-out-file=-[specify output file name]:file name [cachegrind.out.%%p]:_files'
 )
 
 args_helgrind=(
@@ -169,7 +169,7 @@ args_massif=(
   ))"
   '--detailed-freq=-[every Nth snapshot should be detailed]:snapshot interval [10]'
   '--max-snapshots=-[specofy maximum number of snapshots recorded]:maximum [100]'
-  '--massif-out-file=-[specify output file name]:filename [massif.out.%p]:_files'
+  '--massif-out-file=-[specify output file name]:filename [massif.out.%%p]:_files'
 )
 
 args_exp_bbv=(
diff --git a/Completion/Unix/Command/_baz b/Completion/Unix/Command/_baz
index 4dfcdf882..0acdc4639 100644
--- a/Completion/Unix/Command/_baz
+++ b/Completion/Unix/Command/_baz
@@ -64,7 +64,7 @@ _baz_config () {
 
   if [[ -d "$root/configs" ]]; then
     configdir=("$root/configs")
-    _description files expl '%Bconfig file%b'
+    _description files expl 'config file'
     _files -W configdir "$expl[@]" && ret=0
   else
     _message -e messages "No configs/ directory in tree whose root is $root"
diff --git a/Completion/Unix/Command/_opustools b/Completion/Unix/Command/_opustools
index c860a170f..1fd97798a 100644
--- a/Completion/Unix/Command/_opustools
+++ b/Completion/Unix/Command/_opustools
@@ -14,7 +14,7 @@ case $service in
       '--cvbr[use constrained variable bitrate encoding]' \
       '--downmix-mono[downmix to mono]' \
       '--downmix-stereo[downmix to stereo (if >2 channels)]' \
-      '--expect-loss[set expected packet loss]:expected packet loss (%) (0-100) [0]' \
+      '--expect-loss[set expected packet loss]:expected packet loss (%%) (0-100) [0]' \
       '--framesize[set maximum frame size]:maximum frame size (milliseconds) [20]:(2.5 5 10 20 40 60)' \
       '--hard-cbr[use hard constant bitrate encoding]' \
       '--max-delay[set maximum container delay]:maximum container delay (milliseconds) (0-1000) [1000]' \
@@ -57,7 +57,7 @@ case $service in
       '--no-dither[do not dither 16-bit output]' \
       '--float[output 32-bit floating-point samples]' \
       '--force-wav[force RIFF wav header on output]' \
-      '--packet-loss[simulate random packet loss]:packet loss probability (%) (0-100)' \
+      '--packet-loss[simulate random packet loss]:packet loss probability (%%) (0-100)' \
       '--save-range[save check values for every frame to a file]:output for check values:_files'
   ;;
   opusinfo)
diff --git a/Completion/Unix/Command/_tla b/Completion/Unix/Command/_tla
index 33dfc005f..ec7e76d44 100644
--- a/Completion/Unix/Command/_tla
+++ b/Completion/Unix/Command/_tla
@@ -73,7 +73,7 @@ _tla_config () {
 
   if [[ -d "$root/configs" ]]; then
     configdir=("$root/configs")
-    _description files expl '%Bconfig file%b'
+    _description files expl 'config file'
     _files -W configdir "$expl[@]" && ret=0
   else
     _message -e messages "No configs/ directory in tree whose root is $root"




Messages sorted by: Reverse Date, Date, Thread, Author