From 67ef9605f12969b5eab407f83fb117867b15655f Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Mon, 20 Jun 2011 02:24:56 +0000 Subject: unposted: clean up completion descriptions as per Etc/completion-style-guide --- Completion/Unix/Command/_lp | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'Completion/Unix/Command/_lp') diff --git a/Completion/Unix/Command/_lp b/Completion/Unix/Command/_lp index 5d46a75bb..def9aed87 100644 --- a/Completion/Unix/Command/_lp +++ b/Completion/Unix/Command/_lp @@ -133,7 +133,7 @@ _lp() case $service in (lpq) _arguments \ - '-E[Force encryption]' \ + '-E[force encryption]' \ '-U:username (for connection to server):_users' \ '-h:alternate server:_hosts' \ '(-a)-P+[destination printer]:printers:_printers' \ @@ -144,7 +144,7 @@ _lp() (lprm) _arguments \ - '-E[Force encryption]' \ + '-E[force encryption]' \ '-U:username (for connection to server):_users' \ '-h:alternate server:_hosts' \ '-P+[destination printer]:printers:_printers' \ @@ -153,7 +153,7 @@ _lp() (lpoptions) _arguments \ - '-E[Force encryption]' \ + '-E[force encryption]' \ '-U:username (for connection to server):_users' \ '-h:alternate server:_hosts' \ '(-p -l -r -x)-d[set default printer]:printers:_printers' \ @@ -166,58 +166,58 @@ _lp() (lpstat) _arguments \ - '-E[Force encryption]' \ - '-R[Shows print job ranking]' \ + '-E[force encryption]' \ + '-R[shows print job ranking]' \ '-U:username (for connection to server):_users' \ '-W:which jobs:(completed not-completed)' \ - '-a[Show accepting state]:printers:_printers' \ + '-a[show accepting state]:printers:_printers' \ '-c:printer classes:' \ - '-d[Show current default destination]' \ + '-d[show current default destination]' \ '-h:hostname (alternate server):_hosts' \ '-l[long listing]' \ '-o[destinations]:printers:_printers' \ '-p:printers:_printers' \ '-r[CUPS server running status]' \ - '-s[Status summary]' \ - '-t[All status info]' \ + '-s[status summary]' \ + '-t[all status info]' \ '-u[list jobs by users]:users:_users' \ '-v[show devices]:printers:_printers' ;; (lpr) _arguments \ - '-E[Force encryption]' \ + '-E[force encryption]' \ '-H:hostname (alternate server):_hosts' \ '(-C -J -T)'-{C,J,T}':job name:' \ '-P+[destination printer]:printers:_printers' \ '-U:username (for connection to server):_users' \ - '-#[Copies]:copies (1--100):' \ - '-h[Disables banner printing]' \ + '-#[copies]:copies (1--100):' \ + '-h[disables banner printing]' \ '-l[raw file]' \ - '-m[Send an email on job completion]' \ + '-m[send an email on job completion]' \ '*-o:print job options:_lp_job_options' \ '-p[format with shaded header incl. date, time etc.]' \ - '-q[Hold job for printing.]' \ + '-q[hold job for printing]' \ '-r[delete files after printing]' \ '*:PS/PDF files:_pspdf' ;; (lp) _arguments \ - '-E[Force encryption]' \ + '-E[force encryption]' \ '-U[username (for connection to server)]:username:_users' \ '-c[(OBSOLETE) copy to spool dir before printing]' \ '-d[destination printer]:printers:_printers' \ '-h:hostname (alternate server):_hosts' \ '-i[job id to modify]:job id:' \ - '-m[Send an email on job completion]' \ - '-n[Copies]:copies (1--100):' \ + '-m[send an email on job completion]' \ + '-n[copies]:copies (1--100):' \ '*-o:print job options:_lp_job_options' \ - '-q[Job priority -- 1 (lowest) to 100 (highest)]:priority:' \ - '-s[Dont report resulting job IDs]' \ - '-t[Sets the job name]:job name:' \ + '-q[job priority -- 1 (lowest) to 100 (highest)]:priority:' \ + '-s[dont report resulting job IDs]' \ + '-t[sets the job name]:job name:' \ '-u[job submission username]:username:_users' \ - '-H[Time to print]:print time (or enter hh\:mm):(hold immediate restart resume)' \ + '-H[time to print]:print time (or enter hh\:mm):(hold immediate restart resume)' \ '-P:page range list:' \ '*:PS/PDF files:_pspdf' ;; -- cgit v1.2.3 From c6722cf086b09ed63d1441986d0c7774a9280861 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 14 Nov 2011 09:51:06 +0000 Subject: g1242: printing completion improvements --- ChangeLog | 7 ++- Completion/Unix/Command/_lp | 113 ++++++++++++++++++++++++++++++++------------ 2 files changed, 88 insertions(+), 32 deletions(-) (limited to 'Completion/Unix/Command/_lp') diff --git a/ChangeLog b/ChangeLog index 70e82baa4..0182247df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-11-14 Peter Stephenson + + * gi1242: users/16578: Completion/Unix/Command/_lp: lpadmin, + lpinfo and other changes. + 2011-11-09 Frank Terbeck * Akinori MUSHA: 29900: @@ -15565,5 +15570,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5497 $ +* $Revision: 1.5498 $ ***************************************************** diff --git a/Completion/Unix/Command/_lp b/Completion/Unix/Command/_lp index def9aed87..f05fded42 100644 --- a/Completion/Unix/Command/_lp +++ b/Completion/Unix/Command/_lp @@ -1,9 +1,9 @@ -#compdef lp lpr lpq lprm lpoptions lpstat +#compdef lp lpr lpq lprm lpoptions lpstat lpinfo lpadmin _lp_get_printer() { - # No reason to call _lp_get_printer when service == lpstat. Others matched - # below. + # No reason to call _lp_get_printer when service == lpstat or lpinfo. Others + # matched below. case $service in (lpr|lpq|lprm) [[ "$words" == (#I)*-P* ]] && printer="${${words##*(#I)-P( |)}%% *}" @@ -11,6 +11,9 @@ _lp_get_printer() (lp) [[ "$words" == (#I)*-d* ]] && printer="${${words##*(#I)-d( |)}%% *}" ;; + (lpadmin) + [[ "$words" == (#I)*-p* ]] && printer="${${words##*(#I)-p( |)}%% *}" + ;; (lpoptions) [[ "$words" == (#I)*-(d|p)* ]] && \ printer="${${words##*(#I)-(d|p)( |)}%% *}" @@ -29,6 +32,13 @@ _lp_job_options() lopts_no_args=(fitplot landscape) + if [[ $service == 'lpadmin' ]]; then + # Extra options from lpadmin man page. + lopts_with_args+=(cupsIPPSupplies cupsSNMPSupplies job-k-limit + job-page-limit job-quota-period job-sheets-default name name-default + port-monitor printer-error-policy printer-is-shared printer-op-policy) + fi + _lp_get_printer [[ -n "$printer" ]] && printer=(-p $printer) @@ -53,6 +63,12 @@ _lp_job_options() (scaling|cpi|lpi|page-(bottom|left|right|top)) return 0; # Don't complete anything ;; + (cupsIPPSupplies|cupsSNMPSupplies|printer-is-shared) + compadd "$@" true false + ;; + (printer-error-policy) + compadd "$@" abort-job retry-job retry-current-job stop-printer + ;; (*) compadd "$@" \ $(_call_program list-printer-options lpoptions $printer -l | \ @@ -133,7 +149,7 @@ _lp() case $service in (lpq) _arguments \ - '-E[force encryption]' \ + '-E[Force encryption]' \ '-U:username (for connection to server):_users' \ '-h:alternate server:_hosts' \ '(-a)-P+[destination printer]:printers:_printers' \ @@ -144,7 +160,7 @@ _lp() (lprm) _arguments \ - '-E[force encryption]' \ + '-E[Force encryption]' \ '-U:username (for connection to server):_users' \ '-h:alternate server:_hosts' \ '-P+[destination printer]:printers:_printers' \ @@ -153,74 +169,109 @@ _lp() (lpoptions) _arguments \ - '-E[force encryption]' \ + '-E[Force encryption]' \ '-U:username (for connection to server):_users' \ '-h:alternate server:_hosts' \ - '(-p -l -r -x)-d[set default printer]:printers:_printers' \ + '(-p -l -r -x)-d+[set default printer]:printers:_printers' \ '(-l -x)*-o:job options:_lp_job_options' \ - '(-d -x)-p[destination printer for options]:printers:_printers' \ + '(-d -x)-p+[destination printer for options]:printers:_printers' \ '(-d -o -r -x)-l[list options]' \ '(-d -l -x)*-r:remove option:_lp_job_options' \ - '(-d -l -r -o)-x[remove all options]:printers:_printers' + '(-d -l -r -o)-x+[remove all options]:printers:_printers' ;; (lpstat) _arguments \ - '-E[force encryption]' \ - '-R[shows print job ranking]' \ + '-E[Force encryption]' \ + '-R[Shows print job ranking]' \ '-U:username (for connection to server):_users' \ '-W:which jobs:(completed not-completed)' \ - '-a[show accepting state]:printers:_printers' \ + '-a+[Show accepting state]:printers:_printers' \ '-c:printer classes:' \ - '-d[show current default destination]' \ + '-d[Show current default destination]' \ '-h:hostname (alternate server):_hosts' \ '-l[long listing]' \ - '-o[destinations]:printers:_printers' \ - '-p:printers:_printers' \ + '-o+[destinations]:printers:_printers' \ + '-p+:printers:_printers' \ '-r[CUPS server running status]' \ - '-s[status summary]' \ - '-t[all status info]' \ + '-s[Status summary]' \ + '-t[All status info]' \ '-u[list jobs by users]:users:_users' \ - '-v[show devices]:printers:_printers' + '-v+[show devices]:printers:_printers' ;; (lpr) _arguments \ - '-E[force encryption]' \ + '-E[Force encryption]' \ '-H:hostname (alternate server):_hosts' \ '(-C -J -T)'-{C,J,T}':job name:' \ '-P+[destination printer]:printers:_printers' \ '-U:username (for connection to server):_users' \ - '-#[copies]:copies (1--100):' \ - '-h[disables banner printing]' \ + '-#[Copies]:copies (1--100):' \ + '-h[Disables banner printing]' \ '-l[raw file]' \ - '-m[send an email on job completion]' \ + '-m[Send an email on job completion]' \ '*-o:print job options:_lp_job_options' \ '-p[format with shaded header incl. date, time etc.]' \ - '-q[hold job for printing]' \ + '-q[Hold job for printing.]' \ '-r[delete files after printing]' \ '*:PS/PDF files:_pspdf' ;; (lp) _arguments \ - '-E[force encryption]' \ + '-E[Force encryption]' \ '-U[username (for connection to server)]:username:_users' \ '-c[(OBSOLETE) copy to spool dir before printing]' \ - '-d[destination printer]:printers:_printers' \ + '-d+[destination printer]:printers:_printers' \ '-h:hostname (alternate server):_hosts' \ '-i[job id to modify]:job id:' \ - '-m[send an email on job completion]' \ - '-n[copies]:copies (1--100):' \ + '-m[Send an email on job completion]' \ + '-n[Copies]:copies (1--100):' \ '*-o:print job options:_lp_job_options' \ - '-q[job priority -- 1 (lowest) to 100 (highest)]:priority:' \ - '-s[dont report resulting job IDs]' \ - '-t[sets the job name]:job name:' \ + '-q[Job priority -- 1 (lowest) to 100 (highest)]:priority:' \ + '-s[Dont report resulting job IDs]' \ + '-t[Sets the job name]:job name:' \ '-u[job submission username]:username:_users' \ - '-H[time to print]:print time (or enter hh\:mm):(hold immediate restart resume)' \ + '-H[Time to print]:print time (or enter hh\:mm):(hold immediate restart resume)' \ '-P:page range list:' \ '*:PS/PDF files:_pspdf' ;; + + (lpinfo) + _arguments \ + '-E[Force encryption]' \ + '-U[username (for connection to server)]:username:_users' \ + '-h:hostname (alternate server):_hosts' \ + '-l[Shows a "long" listing of devices or drivers]' \ + {--exclude-schemes,--include-schemes}'[device/PPD schemes to filter from results]:scheme-list:' \ + '(-v --timeout)--device-id[IEEE-1284 device ID to match]:device-id-string:' \ + '(-v --timeout)--language:locale:' \ + '(-v --timeout)--product[product to match]:name:' \ + '(-v --timeout)--make-and-model[make and model to match]:name:' \ + '(-v --timeout)-m[list available drivers]' \ + '(-m --device-id --language --make-and-model --product)--timeout[timeout when listing devices with -v]:timeout (seconds):' \ + '(-m --device-id --language --make-and-model --product)-v[list available devices]' + ;; + + (lpadmin) + _arguments \ + '-E[Force encryption/Enable destination]' \ + '-U[username (for connection to server)]:username:_users' \ + '-h:hostname (alternate server):_hosts' \ + '(-p -R -x -o)-d+[default printer]:printers:_printers' \ + '(-d -x)-p+[configure printer]:printers:_printers' \ + '(-p -R -d -o)-x+[delete printer]:printers:_printers' \ + '(-x -d)-R[name-default]:name-default:' \ + '-c:printer classes:' \ + '-m:model:' \ + '(-x -d)*-o:options:_lp_job_options' \ + '-r[remove from class]:class:' \ + '-u[access policy]:access policy:' \ + '-v[device-uri of printer queue]:device-uri:' \ + '-D[Text description of destination]:info:' \ + '-L[Location of the printer]:location:' \ + '-P[PPD file to use]:PPD file:_files "*.(#i)ppd(-.)"' esac } -- cgit v1.2.3 From 5d1b11027bd3827e04a87d6846278be9b80bc8e8 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sun, 20 Nov 2011 21:47:10 +0000 Subject: gi1242: users/16587: _lp tidy up --- ChangeLog | 6 +++- Completion/Unix/Command/_lp | 70 ++++++++++++++++++++++----------------------- 2 files changed, 40 insertions(+), 36 deletions(-) (limited to 'Completion/Unix/Command/_lp') diff --git a/ChangeLog b/ChangeLog index b72cb695c..75f4816aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-11-20 Peter Stephenson + + * gi1242+zsh: users/16587: Completion/Unix/Command_lp: tidy up. + 2011-11-18 Peter Stephenson * 29908: Doc/Zsh/contrib.yo, Functions/MIME/.distfiles, @@ -15589,5 +15593,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5501 $ +* $Revision: 1.5502 $ ***************************************************** diff --git a/Completion/Unix/Command/_lp b/Completion/Unix/Command/_lp index f05fded42..e0654e711 100644 --- a/Completion/Unix/Command/_lp +++ b/Completion/Unix/Command/_lp @@ -152,9 +152,9 @@ _lp() '-E[Force encryption]' \ '-U:username (for connection to server):_users' \ '-h:alternate server:_hosts' \ - '(-a)-P+[destination printer]:printers:_printers' \ - '(-P)-a[all printers]' \ - '-l[long listing]' \ + '(-a)-P+[Destination printer]:printers:_printers' \ + '(-P)-a[All printers]' \ + '-l[Long listing]' \ '*:poll interval (+seconds):' ;; @@ -163,7 +163,7 @@ _lp() '-E[Force encryption]' \ '-U:username (for connection to server):_users' \ '-h:alternate server:_hosts' \ - '-P+[destination printer]:printers:_printers' \ + '-P+[Destination printer]:printers:_printers' \ '*:job ids:_lp_list_jobs' ;; @@ -172,12 +172,12 @@ _lp() '-E[Force encryption]' \ '-U:username (for connection to server):_users' \ '-h:alternate server:_hosts' \ - '(-p -l -r -x)-d+[set default printer]:printers:_printers' \ + '(-p -l -r -x)-d+[Set default printer]:printers:_printers' \ '(-l -x)*-o:job options:_lp_job_options' \ - '(-d -x)-p+[destination printer for options]:printers:_printers' \ - '(-d -o -r -x)-l[list options]' \ + '(-d -x)-p+[Destination printer for options]:printers:_printers' \ + '(-d -o -r -x)-l[List options]' \ '(-d -l -x)*-r:remove option:_lp_job_options' \ - '(-d -l -r -o)-x+[remove all options]:printers:_printers' + '(-d -l -r -o)-x+[Remove all options]:printers:_printers' ;; (lpstat) @@ -190,14 +190,14 @@ _lp() '-c:printer classes:' \ '-d[Show current default destination]' \ '-h:hostname (alternate server):_hosts' \ - '-l[long listing]' \ - '-o+[destinations]:printers:_printers' \ + '-l[Long listing]' \ + '-o+[Destinations]:printers:_printers' \ '-p+:printers:_printers' \ '-r[CUPS server running status]' \ '-s[Status summary]' \ '-t[All status info]' \ - '-u[list jobs by users]:users:_users' \ - '-v+[show devices]:printers:_printers' + '-u[List jobs by users]:users:_users' \ + '-v+[Show devices]:printers:_printers' ;; (lpr) @@ -205,34 +205,34 @@ _lp() '-E[Force encryption]' \ '-H:hostname (alternate server):_hosts' \ '(-C -J -T)'-{C,J,T}':job name:' \ - '-P+[destination printer]:printers:_printers' \ + '-P+[Destination printer]:printers:_printers' \ '-U:username (for connection to server):_users' \ '-#[Copies]:copies (1--100):' \ '-h[Disables banner printing]' \ - '-l[raw file]' \ + '-l[Raw file]' \ '-m[Send an email on job completion]' \ '*-o:print job options:_lp_job_options' \ - '-p[format with shaded header incl. date, time etc.]' \ + '-p[Format with shaded header incl. date, time etc.]' \ '-q[Hold job for printing.]' \ - '-r[delete files after printing]' \ + '-r[Delete files after printing]' \ '*:PS/PDF files:_pspdf' ;; (lp) _arguments \ '-E[Force encryption]' \ - '-U[username (for connection to server)]:username:_users' \ + '-U[Username (for connection to server)]:username:_users' \ '-c[(OBSOLETE) copy to spool dir before printing]' \ - '-d+[destination printer]:printers:_printers' \ + '-d+[Destination printer]:printers:_printers' \ '-h:hostname (alternate server):_hosts' \ - '-i[job id to modify]:job id:' \ + '-i[Job id to modify]:job id:' \ '-m[Send an email on job completion]' \ '-n[Copies]:copies (1--100):' \ '*-o:print job options:_lp_job_options' \ '-q[Job priority -- 1 (lowest) to 100 (highest)]:priority:' \ '-s[Dont report resulting job IDs]' \ '-t[Sets the job name]:job name:' \ - '-u[job submission username]:username:_users' \ + '-u[Job submission username]:username:_users' \ '-H[Time to print]:print time (or enter hh\:mm):(hold immediate restart resume)' \ '-P:page range list:' \ '*:PS/PDF files:_pspdf' @@ -241,34 +241,34 @@ _lp() (lpinfo) _arguments \ '-E[Force encryption]' \ - '-U[username (for connection to server)]:username:_users' \ + '-U[Username (for connection to server)]:username:_users' \ '-h:hostname (alternate server):_hosts' \ '-l[Shows a "long" listing of devices or drivers]' \ - {--exclude-schemes,--include-schemes}'[device/PPD schemes to filter from results]:scheme-list:' \ + {--exclude-schemes,--include-schemes}'[Device/PPD schemes to filter from results]:scheme-list:' \ '(-v --timeout)--device-id[IEEE-1284 device ID to match]:device-id-string:' \ '(-v --timeout)--language:locale:' \ - '(-v --timeout)--product[product to match]:name:' \ - '(-v --timeout)--make-and-model[make and model to match]:name:' \ - '(-v --timeout)-m[list available drivers]' \ - '(-m --device-id --language --make-and-model --product)--timeout[timeout when listing devices with -v]:timeout (seconds):' \ - '(-m --device-id --language --make-and-model --product)-v[list available devices]' + '(-v --timeout)--product[Product to match]:name:' \ + '(-v --timeout)--make-and-model[Make and model to match]:name:' \ + '(-v --timeout)-m[List available drivers]' \ + '(-m --device-id --language --make-and-model --product)--timeout[Timeout when listing devices with -v]:timeout (seconds):' \ + '(-m --device-id --language --make-and-model --product)-v[List available devices]' ;; (lpadmin) _arguments \ '-E[Force encryption/Enable destination]' \ - '-U[username (for connection to server)]:username:_users' \ + '-U[Username (for connection to server)]:username:_users' \ '-h:hostname (alternate server):_hosts' \ - '(-p -R -x -o)-d+[default printer]:printers:_printers' \ - '(-d -x)-p+[configure printer]:printers:_printers' \ - '(-p -R -d -o)-x+[delete printer]:printers:_printers' \ - '(-x -d)-R[name-default]:name-default:' \ + '(-p -R -x -o)-d+[Default printer]:printers:_printers' \ + '(-d -x)-p+[Configure printer]:printers:_printers' \ + '(-p -R -d -o)-x+[Delete printer]:printers:_printers' \ + '(-x -d)-R[Name-default]:name-default:' \ '-c:printer classes:' \ '-m:model:' \ '(-x -d)*-o:options:_lp_job_options' \ - '-r[remove from class]:class:' \ - '-u[access policy]:access policy:' \ - '-v[device-uri of printer queue]:device-uri:' \ + '-r[Remove from class]:class:' \ + '-u[Access policy]:access policy:' \ + '-v[Device-uri of printer queue]:device-uri:' \ '-D[Text description of destination]:info:' \ '-L[Location of the printer]:location:' \ '-P[PPD file to use]:PPD file:_files "*.(#i)ppd(-.)"' -- cgit v1.2.3