From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22617 invoked by alias); 16 Jan 2011 03:02:21 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28629 Received: (qmail 16673 invoked from network); 16 Jan 2011 03:02:18 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_MED,T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: neutral (ns1.primenet.com.au: 128.2.11.96 is neither permitted nor denied by SPF record at _spf.google.com) Date: Sat, 15 Jan 2011 21:48:33 -0500 From: gi1242+zsh@gmail.com To: zsh-workers@zsh.org Subject: Re: Various completion contributions Message-ID: <20110116024833.GA14758@andrew.cmu.edu> Mail-Followup-To: gi1242+zsh@gmail.com, zsh-workers@zsh.org References: <20110108014215.GA10852@andrew.cmu.edu> <20110108210312.207ce517@pws-pc.ntlworld.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="yrj/dFKFPuw6o+aM" Content-Disposition: inline In-Reply-To: <20110108210312.207ce517@pws-pc.ntlworld.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-PMX-Version: 5.5.9.388399, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2010.4.9.4220 X-SMTP-Spam-Clean: 34% ( RDNS_SUSP_FORGED_FROM 3.5, FORGED_FROM_GMAIL 0.1, MIME_TEXT_ONLY_MP_MIXED 0.05, BODY_SIZE_10000_PLUS 0, NO_REAL_NAME 0, RDNS_BROADBAND 0, RDNS_GENERIC_POOLED 0, RDNS_POOLED 0, RDNS_SUSP 0, RDNS_SUSP_GENERIC 0, RDNS_SUSP_SPECIFIC 0, TO_NO_NAME 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CD 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __CTYPE_MULTIPART_MIXED 0, __FRAUD_BODY_WEBMAIL 0, __FRAUD_CONTACT_NAME 0, __FRAUD_CONTACT_NUM 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FROM_GMAIL 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __PHISH_SPEAR_ACCOUNT_1 0, __PHISH_SPEAR_STRUCTURE_1 0, __RDNS_BROADBAND_5 0, __RDNS_POOLED_11 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0) X-SMTP-Spam-Score: 34% X-Scanned-By: MIMEDefang 2.60 on 128.2.11.96 --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jan 08, 2011 at 09:03:12PM +0000, Peter Stephenson wrote: > On Fri, 7 Jan 2011 20:42:15 -0500 gi1242+zsh@gmail.com wrote: > >> I updated/modified a couple of default completion scripts, and wrote a >> couple of new ones. I'm attaching them to this message in case they >> would be useful. (Please let me know the "official" way to submit >> patches / bugs, and I will do so in future). > > Thanks for those. You need to send things as "diff -u"s, preferably > against the latest CVS or git archive, Thanks for letting me know. I've made a couple of changes following your suggestions, and have attached a diff this time. >> _tex New completion file > > There's already one in Completion/Unix/Type/_tex, so I've ignored > this. That only completes file types. I'd remove it and replace it with the version attached (in Completion/Unix/Command instead). >> _unison New completion file >> _xournal New completion file (only completes filenames). > > No idea what these are but put them in Completion/Unix/Command (again, a > diff would have shown where it should go). Sorry. _xournal should go in Completion/X/Command. I did some "git trickery" to try and generate the diffs. If they don't work, I can regenerate by hand and resend. Let me know, Thanks, GI -- If we don't succeed, we run the risk of failure. --George W. Bush --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=zsh-lp diff --git a/Completion/Unix/Command/_lp b/Completion/Unix/Command/_lp index e6bff64..5d46a75 100644 --- a/Completion/Unix/Command/_lp +++ b/Completion/Unix/Command/_lp @@ -1,7 +1,5 @@ #compdef lp lpr lpq lprm lpoptions lpstat -local expl ret=1 printer list disp strs shown - _lp_get_printer() { # No reason to call _lp_get_printer when service == lpstat. Others matched @@ -22,6 +20,7 @@ _lp_get_printer() _lp_job_options() { + local expl printer local -a lopts_with_args lopts_no_args # Generic options (from lp manual page) @@ -84,6 +83,9 @@ _lp_job_options() _lp_list_jobs() { + local ret=1 printer shown + local -a list disp strs + _lp_get_printer [[ -n "$printer" ]] && printer=(-P $printer) @@ -125,95 +127,101 @@ _lp_list_jobs() return 1 } -case $service in - (lpq) - _arguments \ - '-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]' \ - '*:poll interval (+seconds):' - ;; - - (lprm) - _arguments \ - '-E[Force encryption]' \ - '-U:username (for connection to server):_users' \ - '-h:alternate server:_hosts' \ - '-P+[destination printer]:printers:_printers' \ - '*:job ids:_lp_list_jobs' - ;; - - (lpoptions) - _arguments \ - '-E[Force encryption]' \ - '-U:username (for connection to server):_users' \ - '-h:alternate server:_hosts' \ - '(-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 -l -x)*-r:remove option:_lp_job_options' \ - '(-d -l -r -o)-x[remove all options]:printers:_printers' - ;; - - (lpstat) - _arguments \ - '-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' \ - '-c:printer classes:' \ - '-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]' \ - '-u[list jobs by users]:users:_users' \ - '-v[show devices]:printers:_printers' - ;; - - (lpr) - _arguments \ - '-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]' \ - '-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.]' \ - '-q[Hold job for printing.]' \ - '-r[delete files after printing]' \ - '*:PS/PDF files:_pspdf' - ;; - - (lp) - _arguments \ - '-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):' \ - '*-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' \ - '-H[Time to print]:print time (or enter hh\:mm):(hold immediate restart resume)' \ - '-P:page range list:' \ - '*:PS/PDF files:_pspdf' - ;; -esac + +_lp() +{ + case $service in + (lpq) + _arguments \ + '-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]' \ + '*:poll interval (+seconds):' + ;; + + (lprm) + _arguments \ + '-E[Force encryption]' \ + '-U:username (for connection to server):_users' \ + '-h:alternate server:_hosts' \ + '-P+[destination printer]:printers:_printers' \ + '*:job ids:_lp_list_jobs' + ;; + + (lpoptions) + _arguments \ + '-E[Force encryption]' \ + '-U:username (for connection to server):_users' \ + '-h:alternate server:_hosts' \ + '(-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 -l -x)*-r:remove option:_lp_job_options' \ + '(-d -l -r -o)-x[remove all options]:printers:_printers' + ;; + + (lpstat) + _arguments \ + '-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' \ + '-c:printer classes:' \ + '-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]' \ + '-u[list jobs by users]:users:_users' \ + '-v[show devices]:printers:_printers' + ;; + + (lpr) + _arguments \ + '-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]' \ + '-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.]' \ + '-q[Hold job for printing.]' \ + '-r[delete files after printing]' \ + '*:PS/PDF files:_pspdf' + ;; + + (lp) + _arguments \ + '-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):' \ + '*-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' \ + '-H[Time to print]:print time (or enter hh\:mm):(hold immediate restart resume)' \ + '-P:page range list:' \ + '*:PS/PDF files:_pspdf' + ;; + esac +} + +_lp "$@" diff --git a/Completion/Unix/Command/_xournal b/Completion/Unix/Command/_xournal deleted file mode 100644 index 066ef55..0000000 --- a/Completion/Unix/Command/_xournal +++ /dev/null @@ -1,6 +0,0 @@ -#compdef xournal - -local expl - -_description files expl 'PDF and Xournal files' -_files "$@" "$expl[@]" -g '*.(#i){xoj,pdf}(-.)' diff --git a/Completion/Unix/Type/_tex b/Completion/Unix/Type/_tex deleted file mode 100644 index 3c16dca..0000000 --- a/Completion/Unix/Type/_tex +++ /dev/null @@ -1,6 +0,0 @@ -#compdef tex latex slitex pdflatex jadetex pdfjadetex xetex=tex xelatex=latex latexmk - -local expl - -_description files expl 'TeX or LaTeX file' -_files "$@" "$expl[@]" -g '*.(tex|TEX|texinfo|texi)(-.)' --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=zsh-xournal-tex diff --git a/Completion/Unix/Command/_tex b/Completion/Unix/Command/_tex new file mode 100644 index 0000000..9943fe1 --- /dev/null +++ b/Completion/Unix/Command/_tex @@ -0,0 +1,29 @@ +#compdef tex latex slitex pdftex pdflatex jadetex pdfjadetex xetex=tex xelatex=latex latexmk + +_arguments : \ + '-enc[enable encTeX extensions]' \ + '(-no-file-line-error -file-line-error)'{-no,}'-file-line-error[enable/disable file\:line\:error style messages]' \ + '-fmt=-[use FMTNAME instead of program name or a %& line]:FMTNAME:' \ + '-halt-on-error[stop processing at the first error]' \ + '-ini[be initex, for dumping formats]' \ + '-interaction[set interaction mode]:STRING:(batchmode nonstopmode scrollmode errorstopmode)' \ + '-ipc[send DVI output to a socket as well as the usual output file]' \ + '-ipc-start[as -ipc, and also start the server at the other end]' \ + '-jobname=-[set the job name]:STRING:' \ + '-kpathsea-debug=-[set path searching debugging flags according to the bits of NUMBER]:NUMBER:' \ + '(-no-mktex -mktex)'{-no,}'-mktex=-[enable/disable mktexFMT generation]:FMT:(tex tfm)' \ + '-mltex[enable MLTeX extensions]' \ + '-output-comment=-[DVI file comment]:STRING:' \ + '-output-directory=-[directory to write files to]:DIR:' \ + '(-no-parse-first-line -parse-first-line)'{-no,}'-parse-first-line[disable/enable parsing of the first line of the input file]' \ + '-progname=-[set program (and fmt) name]:STRING:' \ + '-recorder[enable filename recorder]' \ + '(-no-shell-escape -shell-escape)'{-no,}-shell-escape'[enable/disable \\write18{SHELL COMMAND}]' \ + '-shell-restricted[enable restricted \\write18]' \ + '-src-specials[insert source specials into the DVI file]' \ + '-src-specials=-[insert source specials in certain places of the DVI file]:WHERE:_values -s , WHERE cr display hbox math par parend vbox' \ + '-translate-file=-[use the TCX file TCXNAME]:TCXNAME:' \ + '-8bit[make all characters printable by default]' \ + '-help[display this help and exit]' \ + '-version[output version information and exit]' \ + '*:TeX or LaTeX file:_files -g "*.(tex|TEX|texinfo|texi)(-.)"' diff --git a/Completion/X/Command/_xournal b/Completion/X/Command/_xournal new file mode 100644 index 0000000..066ef55 --- /dev/null +++ b/Completion/X/Command/_xournal @@ -0,0 +1,6 @@ +#compdef xournal + +local expl + +_description files expl 'PDF and Xournal files' +_files "$@" "$expl[@]" -g '*.(#i){xoj,pdf}(-.)' --yrj/dFKFPuw6o+aM--