about summary refs log tree commit diff
path: root/Completion/Debian/_apt
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-09-25 11:12:08 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-09-25 11:12:08 +0000
commite3e37114832539fb915f0c44125eae492d7b1491 (patch)
treeb263c78f334bb9fcefbc53843ff819b6740d3252 /Completion/Debian/_apt
parent9b85146a0884c3d5025392bae4911efff391731e (diff)
downloadzsh-e3e37114832539fb915f0c44125eae492d7b1491.tar.gz
zsh-e3e37114832539fb915f0c44125eae492d7b1491.tar.xz
zsh-e3e37114832539fb915f0c44125eae492d7b1491.zip
zsh-workers/8044
Diffstat (limited to 'Completion/Debian/_apt')
-rw-r--r--Completion/Debian/_apt73
1 files changed, 37 insertions, 36 deletions
diff --git a/Completion/Debian/_apt b/Completion/Debian/_apt
index f4ed69a45..503d42a56 100644
--- a/Completion/Debian/_apt
+++ b/Completion/Debian/_apt
@@ -54,7 +54,7 @@ _apt_arguments () {
   case \$current_option in
   ${comp_hasarg}esac"
 
-  local short_seq false true bool bool_prefix intlevel word word1 nul
+  local short_seq false true bool bool_prefix intlevel word word1 nul qnul
   local comp_bool comp_intlevel comp_configfile comp_arbitem comp_long comp_opt
   local regex_short regex_long regex_all
 
@@ -73,6 +73,7 @@ _apt_arguments () {
   word=$'[^\0]#\0'
   word1=$'[^\0]##\0'
   nul=$'\0'
+  qnul="\$'\\0'"
 
   comp_bool='compadd "$expl_bool[@]" '"$bool"
   comp_intlevel= #"_message 'intlevel'"
@@ -119,7 +120,7 @@ _describe -o option tmp2 -- tmp3 -S='
     )
     regex_long_prefix=("$regex_long_prefix[@]"
       /"(${(j:|:)short_hasarg})$nul"/
-	-'_apt_consume_short ${match[1][-2]}; current_option=${canonicalize[-${${match[1]%$nul}[-1]}]}'
+	-'_apt_consume_short ${match[1][-2]}; current_option=${canonicalize[-${${match[1]%'$qnul'}[-1]}]}'
 	/"$word"/ :"$comp_hasarg" \|
       /"(${(j:|:)short_hasarg})="/
 	-'_apt_consume_short ${match[1][-2]}; current_option=${canonicalize[-${${match[1]%=}[-1]}]}'
@@ -130,17 +131,17 @@ _describe -o option tmp2 -- tmp3 -S='
   if (( $#short_bool )); then
     regex_short=("$regex_short[@]"
       /"$short_seq(${(j:|:)short_bool})($nul(${(j:|:)bool})|(${(j:|:)bool})|)$nul"/
-	-"_apt_consume_short \${match[1]%%($nul(${(j:|:)bool})|(${(j:|:)bool})|)$nul}" \|
+	-'_apt_consume_short ${match[1]%%('$qnul'('${(j:|:)bool}')|('${(j:|:)bool}')|)'$qnul'}' \|
       /"$short_seq(${(j:|:)short_bool})="/
-	-"_apt_consume_short \${match[1]%=}"
+	-'_apt_consume_short ${match[1]%=}'
 	\( /"$word1"/ :"$comp_bool" \| /"$nul"/ /"$word"/ :"$comp_bool" \) \|
     )
     regex_long_prefix=("$regex_long_prefix[@]"
       /"(${(j:|:)short_bool})="/
-	-"_apt_consume_short \${match[1][-2]}"
+	-'_apt_consume_short ${match[1][-2]}'
 	\( /"$word1"/ :"$comp_bool" \| /"$nul"/ /"$word"/ :"$comp_bool" \) \|
       /"(${(j:|:)short_bool})$nul"/
-	-"_apt_consume_short \${match[1][-2]}"
+	-'_apt_consume_short ${match[1][-2]}'
 	/"((${(j:|:)bool})$nul|)"/ :"$comp_bool" \|
     )
   fi
@@ -148,17 +149,17 @@ _describe -o option tmp2 -- tmp3 -S='
   if (( $#short_intlevel )); then
     regex_short=("$regex_short[@]"
       /"$short_seq(${(j:|:)short_intlevel})($nul$intlevel|$intlevel|)$nul"/
-	-"_apt_consume_short \${match[1]%%($nul$intlevel|$intlevel|)$nul}" \|
+	-'_apt_consume_short ${match[1]%%'"($qnul$intlevel|$intlevel|)$qnul"'}' \|
       /"$short_seq(${(j:|:)short_intlevel})="/
-	-"_apt_consume_short \${match[1]%=}"
+	-'_apt_consume_short ${match[1]%=}'
 	\( /"$word1"/ :"$comp_intlevel" \| /"$nul"/ /"$word"/ :"$comp_intlevel" \) \|
     )
     regex_long_prefix=("$regex_long_prefix[@]"
       /"(${(j:|:)short_intlevel})="/
-	-"_apt_consume_short \${match[1][-2]}"
+	-'_apt_consume_short ${match[1][-2]}'
 	\( /"$word1"/ :"$comp_intlevel" \| /"$nul"/ /"$word"/ :"$comp_intlevel" \) \|
       /"(${(j:|:)short_intlevel})$nul"/
-	-"_apt_consume_short \${match[1][-2]}"
+	-'_apt_consume_short ${match[1][-2]}'
 	/"($intlevel$nul|)"/ :"$comp_intlevel" \|
     )
   fi
@@ -166,15 +167,15 @@ _describe -o option tmp2 -- tmp3 -S='
   if (( $#short_configfile )); then
     regex_short=("$regex_short[@]"
       /"$short_seq(${(j:|:)short_configfile})(=|)"/
-	-"_apt_consume_short \${match[1]%=}"
+	-'_apt_consume_short ${match[1]%=}'
 	\( /"$word1"/ :"$comp_configfile" \| /"$nul"/ /"$word"/ :"$comp_configfile" \) \|
     )
     regex_long_prefix=("$regex_long_prefix[@]"
       /"(${(j:|:)short_configfile})$nul"/
-	-"_apt_consume_short \${match[1][-2]}"
+	-'_apt_consume_short ${match[1][-2]}'
 	/"$word"/ :"$comp_configfile" \|
       /"(${(j:|:)short_configfile})="/
-	-"_apt_consume_short \${match[1][-2]}"
+	-'_apt_consume_short ${match[1][-2]}'
 	\( /"$word1"/ :"$comp_configfile" \| /"$nul"/ /"$word"/ :"$comp_configfile" \) \|
     )
   fi
@@ -182,15 +183,15 @@ _describe -o option tmp2 -- tmp3 -S='
   if (( $#short_arbitem )); then
     regex_short=("$regex_short[@]"
       /"$short_seq(${(j:|:)short_arbitem})(=|)"/
-	-"_apt_consume_short \${match[1]%=}"
+	-'_apt_consume_short ${match[1]%=}'
 	\( /"$word1"/ :"$comp_arbitem" \| /"$nul"/ /"$word"/ :"$comp_arbitem" \) \|
     )
     regex_long_prefix=("$regex_long_prefix[@]"
       /"(${(j:|:)short_arbitem})$nul"/
-	-"_apt_consume_short \${match[1][-2]}"
+	-'_apt_consume_short ${match[1][-2]}'
 	/"$word"/ :"$comp_arbitem" \|
       /"(${(j:|:)short_arbitem})="/
-	-"_apt_consume_short \${match[1][-2]}"
+	-'_apt_consume_short ${match[1][-2]}'
 	\( /"$word1"/ :"$comp_arbitem" \| /"$nul"/ /"$word"/ :"$comp_arbitem" \) \|
     )
   fi
@@ -198,18 +199,18 @@ _describe -o option tmp2 -- tmp3 -S='
   if (( $#long_hasarg )); then
     regex_long=("$regex_long[@]"
       /"(${(j:|:)long_hasarg})$nul"/
-	-"_apt_consume_long \${match[1]%$nul}; current_option=\${canonicalize[--\${match[1]%$nul}]}"
+	-'_apt_consume_long ${match[1]%'$qnul'}; current_option=${canonicalize[--${match[1]%'$qnul'}]}'
 	/"$word"/ :"$comp_hasarg" \|
       /"(${(j:|:)long_hasarg})="/
-	-"_apt_consume_long \${match[1]%=}; current_option=\${canonicalize[--\${match[1]%=}]}"
+	-'_apt_consume_long ${match[1]%=}; current_option=${canonicalize[--${match[1]%=}]}'
 	\( /"$word1"/ :"$comp_hasarg" \| /"$nul"/ /"$word"/ :"$comp_hasarg" \) \|
     )
     regex_long_prefix=("$regex_long_prefix[@]"
       /"(${(j:|:)long_hasarg})$nul"/
-	-"_apt_consume_long \${match[1]%$nul}; current_option=\${canonicalize[--\${match[1]%$nul}]}"
+	-'_apt_consume_long ${match[1]%'$qnul'}; current_option=${canonicalize[--${match[1]%'$qnul'}]}'
 	/"$word"/ :"$comp_hasarg" \|
       /"(${(j:|:)long_hasarg})="/
-	-"_apt_consume_long \${match[1]%=}; current_option=\${canonicalize[--\${match[1]%=}]}"
+	-'_apt_consume_long ${match[1]%=}; current_option=${canonicalize[--${match[1]%=}]}'
 	\( /"$word1"/ :"$comp_hasarg" \| /"$nul"/ /"$word"/ :"$comp_hasarg" \) \|
     )
   fi
@@ -217,18 +218,18 @@ _describe -o option tmp2 -- tmp3 -S='
   if (( $#long_bool )); then
     regex_long=("$regex_long[@]"
       /"(${(j:|:)long_bool})="/
-	-"_apt_consume_long xxx \${match[1]%=}"
+	-'_apt_consume_long ${match[1]%=}'
 	\( /"$word1"/ :"$comp_bool" \| /"$nul"/ /"$word"/ :"$comp_bool" \) \|
       /"(${(j:|:)long_bool})$nul"/
-	-"_apt_consume_long \${match[1]%$nul}"
+	-'_apt_consume_long ${match[1]%'$qnul'}'
 	/"((${(j:|:)bool})$nul|)"/ :"$comp_bool" \|
     )
     regex_long_prefix=("$regex_long_prefix[@]"
       /"(${(j:|:)long_bool})="/
-	-"_apt_consume_long \${match[1]%=}"
+	-'_apt_consume_long ${match[1]%=}'
 	\( /"$word1"/ :"$comp_bool" \| /"$nul"/ /"$word"/ :"$comp_bool" \) \|
       /"(${(j:|:)long_bool})$nul"/
-	-"_apt_consume_long \${match[1]%$nul}"
+	-'_apt_consume_long ${match[1]%'$qnul'}'
 	/"((${(j:|:)bool})$nul|)"/ :"$comp_bool" \|
     )
   fi
@@ -236,18 +237,18 @@ _describe -o option tmp2 -- tmp3 -S='
   if (( $#long_intlevel )); then
     regex_long=("$regex_long[@]"
       /"(${(j:|:)long_intlevel})="/
-	-"_apt_consume_long \${match[1]%=}"
+	-'_apt_consume_long ${match[1]%=}'
 	\( /"$word1"/ :"$comp_intlevel" \| /"$nul"/ /"$word"/ :"$comp_intlevel" \) \|
       /"(${(j:|:)long_intlevel})$nul"/
-	-"_apt_consume_long \${match[1]%$nul}"
+	-'_apt_consume_long ${match[1]%'$qnul'}'
 	/"($intlevel$nul|)"/ :"$comp_intlevel" \|
     )
     regex_long_prefix=("$regex_long_prefix[@]"
       /"(${(j:|:)long_intlevel})="/
-	-"_apt_consume_long \${match[1]%=}"
+	-'_apt_consume_long ${match[1]%=}'
 	\( /"$word1"/ :"$comp_intlevel" \| /"$nul"/ /"$word"/ :"$comp_intlevel" \) \|
       /"(${(j:|:)long_intlevel})$nul"/
-	-"_apt_consume_long \${match[1]%$nul}"
+	-'_apt_consume_long ${match[1]%'$qnul'}'
 	/"($intlevel$nul|)"/ :"$comp_intlevel" \|
     )
   fi
@@ -255,18 +256,18 @@ _describe -o option tmp2 -- tmp3 -S='
   if (( $#long_configfile )); then
     regex_long=("$regex_long[@]"
       /"(${(j:|:)long_configfile})$nul"/
-	-"_apt_consume_long \${match[1]%$nul}"
+	-'_apt_consume_long ${match[1]%'$qnul'}'
 	/"$word"/ :"$comp_configfile" \|
       /"(${(j:|:)long_configfile})="/
-	-"_apt_consume_long \${match[1]%=}"
+	-'_apt_consume_long ${match[1]%=}'
 	\( /"$word1"/ :"$comp_configfile" \| /"$nul"/ /"$word"/ :"$comp_configfile" \) \|
     )
     regex_long_prefix=("$regex_long_prefix[@]"
       /"(${(j:|:)long_configfile})$nul"/
-	-"_apt_consume_long \${match[1]%$nul}"
+	-'_apt_consume_long ${match[1]%'$qnul'}'
 	/"$word"/ :"$comp_configfile" \|
       /"(${(j:|:)long_configfile})="/
-	-"_apt_consume_long \${match[1]%=}"
+	-'_apt_consume_long ${match[1]%=}'
 	\( /"$word1"/ :"$comp_configfile" \| /"$nul"/ /"$word"/ :"$comp_configfile" \) \|
     )
   fi
@@ -274,18 +275,18 @@ _describe -o option tmp2 -- tmp3 -S='
   if (( $#long_arbitem )); then
     regex_long=("$regex_long[@]"
       /"(${(j:|:)long_arbitem})$nul"/
-	-"_apt_consume_long \${match[1]%$nul}"
+	-'_apt_consume_long ${match[1]%'$qnul'}'
 	/"$word"/ :"$comp_arbitem" \|
       /"(${(j:|:)long_arbitem})="/
-	-"_apt_consume_long \${match[1]%=}"
+	-'_apt_consume_long ${match[1]%=}'
 	\( /"$word1"/ :"$comp_arbitem" \| /"$nul"/ /"$word"/ :"$comp_arbitem" \) \|
     )
     regex_long_prefix=("$regex_long_prefix[@]"
       /"(${(j:|:)long_arbitem})$nul"/
-	-"_apt_consume_long \${match[1]%$nul}"
+	-'_apt_consume_long ${match[1]%'$qnul'}'
 	/"$word"/ :"$comp_arbitem"/ \|
       /"(${(j:|:)long_arbitem})="/
-	-"_apt_consume_long \${match[1]%=}"
+	-'_apt_consume_long ${match[1]%=}'
 	\( /"$word1"/ :"$comp_arbitem" \| /"$nul"/ /"$word"/ :"$comp_arbitem" \) \|
     )
   fi