From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28250 invoked from network); 4 Aug 2020 12:10:45 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 4 Aug 2020 12:10:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=Sender:List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:References:Message-ID:Date:Content-ID: Content-Type:MIME-Version:Subject:To:From:Reply-To:Cc: Content-Transfer-Encoding:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To; bh=V09TPKDkQZpVEZAKOZCIq57JFphg1NmW3sKBKm1IwfM=; b=TZwUHWyMQ0DPEXIRxUQwYMSube gPNCyB37eIfTrpPxlN45HW03/4Q3Axs0QLxP58xSxdsgn55YCtFXGuUGwibzY0z+8NZ5oiPvRHpnq tXxH6Q6O54lK+iMyOKPoblmfCj7yT+MkTfwIuLiP9IUGNMkt1DFlC9GweTAfa31qcWR0nZuVuBEU6 qovO3+en2c9ldFNbf+aNzIXDnrSXk1cPYLD+75f51dbYwXxd2QkHhOVaGCHnW6JBVLTm6hZmrdlyq IWNhvG3rKSd8bgUvTuA2t/fPWqsT/GxFcb199Gkd1lsdRhKk39OsS0lwpv+KnKZd+94JG99xXBqgJ U+iAJzqA==; Received: from authenticated user by zero.zsh.org with local id 1k2vmA-00081D-Dl; Tue, 04 Aug 2020 12:10:38 +0000 Authentication-Results: zsh.org; iprev=pass (sonic301-21.consmr.mail.ir2.yahoo.com) smtp.remote-ip=77.238.176.98; dkim=pass header.d=yahoo.co.uk header.s=s2048 header.a=rsa-sha256 Received: from sonic301-21.consmr.mail.ir2.yahoo.com ([77.238.176.98]:36722) by zero.zsh.org with esmtp id 1k2vm0-0007yk-TL; Tue, 04 Aug 2020 12:10:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1596543027; bh=V09TPKDkQZpVEZAKOZCIq57JFphg1NmW3sKBKm1IwfM=; h=From:To:Subject:Date:References:From:Subject; b=t0bFLY2V2SGlFHkUt0HsxtRzsrCb2JhOfnr2h1xrQC404zY93h9/730PSvodOlFg8UWMft+abEes9kGkynXTaFMhV0sjLPydLn/2EDuUDRRri7jhUuR2I57FmV7f32OFho0jPs0EHgRwjQBARK615rtbUFYnYG4xZi7X0LaB26PYvibWThC3gjwNckl/nheOEFYgo4b4oh0liEd47RB5AXH+MniATTSTPEqk1aSW4eWo3fjLgaZoTHLhdCsk6/ojdAmf8n4/OwQPPfT/QDbDa0AubpuSnkvpYIUgi7iTT1oN2+kPXwsmkS8/FTqlJE4EaW2JnvdjpD/6aDHgRra0XQ== X-YMail-OSG: ldsUO0sVM1kEwnC9BZ4JpOhP3ciq2JZZQxWpWgQHG1Cd0E5L_Z1Y1pC2L0wlT8K _m3CYz6dtQbuRpHzoDJP.lCAkZwgoiHkXtmlSKlSUts6NTrFvi94nj9JV0He4S8RUH5s6mUv3RRV 8Eiris.qGCscliTINJznYZG2AAGfGe1U895elvv.4Ot9Z8StshycYsi3._H3wPgZxBujtBZa5ify M4jDxEKKMKq5ZdZljh7s0GR5mSMCKGZW2J_6KOsXQRVwEvNgtMnebuow96GT67LQeJ1PEIm2ozTC ncSq3PnCgXnVLiO3NXaJK20IBao_dyTSQKmPnO3mgBDCtiQym4CudkePd688iAspwgJ1d2kfSjKS G4eT2K.GFM6gCsLp6HJ1KOu9S1M9Jgs.kU7w6Mp2NXKh.I1wWeaevt7C26DALJ6zjJ111c6rtZe1 PWiaZvhowiskl8nDExy8R1whYWphECeTl0p_uyzdKTtMt3Ufic5PIUvw1woGs1qOuwXxWZKRoYAs 4nXSuUDHl5JSD6CvlaYfSm0VhNoxAayoXXWm5bWnq6Y1_aUpyQmKgsyqTHBFBnE4xSC86Ray_aJw bPRIOmEZrVOfPxMgyedlHVdFmDYysRWOZ0r1FRhozqXMIUTw2dLlcA3Y7swkJRlxH5IdkkkyhpUs n3ej2Pz1eSvbiag_vghwvhKBq9Fg8DdIo0ZZrZB1145cJRF5F99Pz19GIWmkMIFqvGYdUkLZL3IY 5yQtRGPbtz_qpS_cEzXG7kzFGLbq_y5rXhPByS7.g486MNBHfabmZaRSNgTvfmr1y7nscTKnSgBz 8hB5o8Fj08if3NozWW8Unn.VCSZZ4nfa_RPX_EW6dyGXiXOEDDFwbSIPSEK9tEYEDardV3Bf6wsT ntuGawjXH9XWv8nCT1Pe2MCD3zN2y5YrxbDXXcQmR79I_5VVOS94Fmg6k25oj9USkygkF2Ysr0j7 3KOX88tCPmKIk50ouim47A2xFJnsCqJzM9Kjxkrb6OR6AhBAuXASQMsj_bbetZH8J6tMhOx0dO8Q .yUS7vOPXTFDUULXIW5JPEpuSAmxup0d94E9D6oHGJ2Ng0wB67kIz2e1m0QZjJ46ktXNdopO8GOb mYoyBnFv79JiCYi7lBP2f9s8IOY7Q.gqh56BPpCgwNA4eXrbzlekagFFToUDybkFKzMsNq4UAyiI VRmSgUmtj1JG0lLHlyX6j4Letmupq56TMo3Q7KF9e6UdGyBor_q1bSAiiggiN4K6EQYDDEpkbG37 pQhOd2k2XQ_VQ3w5q_Ti3ZaymVun5PGaGPHUqBxZSCWUVcgXEOd41GYIcWu3dkpSkzHap3MTNsea 0Y4CNwRktk3NcYHVbdk.NOi3dQhEyog-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ir2.yahoo.com with HTTP; Tue, 4 Aug 2020 12:10:27 +0000 Received: by smtp427.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID a2076890fa8d7a2af0844bee654e8774; Tue, 04 Aug 2020 12:10:23 +0000 (UTC) Received: from [192.168.178.21] (helo=hydra) by mail.kiddle.eu with esmtp(Exim 4.93.0.4) (envelope-from ) id 1k2vlu-000Noi-Nt for zsh-workers@zsh.org; Tue, 04 Aug 2020 14:10:22 +0200 From: Oliver Kiddle To: Zsh workers Subject: PATCH: use lowercase descriptions in lp completion MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <91554.1596543022.1@hydra> Date: Tue, 04 Aug 2020 14:10:22 +0200 Message-ID: <91555-1596543022.737930@nDpk.4Sv0.L_Hv> References: <91555-1596543022.737930.ref@nDpk.4Sv0.L_Hv> X-Mailer: WebService/1.1.16397 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Apache-HttpAsyncClient/4.1.4 (Java/11.0.7) X-Seq: 47293 X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: Sender: Sympa Owner This is a patch I've had sitting around for a while waiting for me to find time to make substantial improvements to lp completion. But while far from ideal, I think it is an improvement, nonetheless. My purpose here is actually testing the migrated mailing list. But rather than send messages saying "testing", I'll post one or two things like this. The majority of this is changing descriptions in line with our convention of lowercase. But it does also handle the job-sheets option. The location from them is hardcoded. Perhaps we can do a better job of determining the location but this does no harm if they're elsewhere. Oliver diff --git a/Completion/Unix/Command/_lp b/Completion/Unix/Command/_lp index e84d9ad04..dd2bf5e1a 100644 --- a/Completion/Unix/Command/_lp +++ b/Completion/Unix/Command/_lp @@ -58,6 +58,9 @@ _lp_job_options() '6:rotated 180 degrees') _describe "orientation requested" desc_opts ;; + (job-sheets(|-*)) + compadd "$@" /usr/share/cups/banners/*(:t) + ;; (sides) compadd "$@" one-sided two-sided-{long,short}-edge ;; @@ -163,128 +166,128 @@ _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' \ - '(-P)-a[All printers]' \ - '-l[Long listing]' \ - '*:poll interval (+seconds):' + '(-a)-P+[destination printer]:printer:_printers' \ + '(-P)-a[all printers]' \ + '-l[long listing]' \ + '*:poll interval (+seconds)' ;; (lprm) _arguments \ - '-E[Force encryption]' \ + '-E[force encryption]' \ '-U:username (for connection to server):_users' \ '-h:alternate server:_hosts' \ - '-P+[Destination printer]:printers:_printers' \ - '*:job ids:_lp_list_jobs' + '-P+[destination printer]:printer:_printers' \ + '*:job id:_lp_list_jobs' ;; (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' \ - '(-l -x)*-o:job options:_lp_job_options' \ - '(-d -x)-p+[Destination printer for options]:printers:_printers' \ - '(-d -o -r -x)-l[List options]' \ + '(-p -l -r -x)-d+[set default printer]:printer:_printers' \ + '(-l -x)*-o:job option:_lp_job_options' \ + '(-d -x)-p+[destination printer for options]:printer:_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]:printer:_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' \ - '-c:printer classes:' \ - '-d[Show current default destination]' \ + '-W:which job:(completed not-completed)' \ + '-a+[show accepting state]:printer:_printers' \ + '-c:printer class' \ + '-d[show current default destination]' \ '-h:hostname (alternate server):_hosts' \ - '-l[Long listing]' \ - '-o+[Destinations]:printers:_printers' \ - '-p+:printers:_printers' \ + '-l[long listing]' \ + '-o+[destinations]:printer:_printers' \ + '-p+:printer:_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' + '-s[status summary]' \ + '-t[all status info]' \ + '-u[list jobs by users]:user:_users' \ + '-v+[show devices]:printer:_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' \ + '(-C -J -T)'-{C,J,T}':job name' \ + '-P+[destination printer]:printer:_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' + '-#[copies]:copies (1--100)' \ + '-h[disables banner printing]' \ + '-l[raw file]' \ + '-m[send an email on job completion]' \ + '*-o:print job option:_lp_job_options' \ + '-p[format with shaded header incl. date, time etc.]' \ + '-q[hold job for printing.]' \ + '-r[delete files after printing]' \ + '*:PS/PDF file:_pspdf' ;; (lp) _arguments \ - '-E[Force encryption]' \ - '-U[Username (for connection to server)]:username:_users' \ + '-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]:printer:_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[Don't 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' + '-i[job id to modify]:job id' \ + '-m[send an email on job completion]' \ + '-n[copies]:copies (1--100)' \ + '*-o:print job option:_lp_job_options' \ + '-q[job priority -- 1 (lowest) to 100 (highest)]:priority' \ + "-s[don't report resulting job IDs]" \ + '-t[set 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 file:_pspdf' ;; (lpinfo) _arguments \ - '-E[Force encryption]' \ - '-U[Username (for connection to server)]:username:_users' \ + '-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]' + '-l[show 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' \ + '-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 -R -x -o)-d+[default printer]:printer:_printers' \ + '(-d -x)-p+[configure printer]:printer:_printers' \ + '(-p -R -d -o)-x+[delete printer]:printer:_printers' \ + '(-x -d)-R[name-default]:name-default' \ + '-c:printer class' \ + '-m:model' \ + '(-x -d)*-o:option:_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 }