summary refs log tree commit diff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-03-01 11:57:48 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-03-01 11:57:48 +0000
commit7da2604acb610d0c7090b8d279eb8f2688b9e5f1 (patch)
treeeb351806b0962599f1ed308fddf8bc52a713117a /Completion/Unix/Command
parentaf1c6ecdc7a764b0b21b32efdd979a6a0cf77d93 (diff)
downloadzsh-7da2604acb610d0c7090b8d279eb8f2688b9e5f1.tar.gz
zsh-7da2604acb610d0c7090b8d279eb8f2688b9e5f1.tar.xz
zsh-7da2604acb610d0c7090b8d279eb8f2688b9e5f1.zip
20897: complete system printers in _a2ps
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_a2ps15
1 files changed, 13 insertions, 2 deletions
diff --git a/Completion/Unix/Command/_a2ps b/Completion/Unix/Command/_a2ps
index d4e9ee469..c700c205d 100644
--- a/Completion/Unix/Command/_a2ps
+++ b/Completion/Unix/Command/_a2ps
@@ -22,10 +22,14 @@ if [[ "$words[1]" != "$_cache_a2ps_cmd" ]]; then
   )
 fi
 
+integer ret=1
+local context state line expl
+typeset -A opt_args
+
 _arguments \
   '(-E --pretty-print=)'{-E-,--pretty-print=}"[enable pretty-printing]::language:(${_cache_a2ps_values[1]})" \
   \*{-D+,--define=}"[set or unset variable]:variable:(${_cache_a2ps_values[8]})" \
-  '(-d -P --printer)'{-P,--printer=}"[send output to printer]:printer:(${_cache_a2ps_values[6]})" \
+  '(-d -P --printer)'{-P,--printer=}"[send output to printer]:printer:->printers" \
   '(-A --file-align)'{-A,--file-align=}'[specify alignment of separate files]:mode:(virtual rank page sheet)' \
   '(-a --pages)'{-a-,--pages=}'[select pages to print]:page range' \
   '(-q --quiet --silent -v --verbose)'{-q,--quiet,--silent}'[quiet output]' \
@@ -50,4 +54,11 @@ _arguments \
   '--sides=*:mode:(simplex duplex tumble)' \
   '--non-printable-format*:format:(caret space question-mark octal hexa emacs)' \
   "--encoding*:encoding:(${_cache_a2ps_values[2]})" \
-  "--prologue*::prologue:(${_cache_a2ps_values[4]})"
+  "--prologue*::prologue:(${_cache_a2ps_values[4]})" && ret=0
+
+if [[ $state = printers ]]; then
+  _wanted printers expl printer compadd -- ${=_cache_a2ps_values[6]} && ret=0
+  _printers && ret=0
+fi
+
+return ret