From 8dbbb4f9432e192790c945206179a5dc28ca36ea4596102d15c0aad68bdcdf0c Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Fri, 4 Nov 2022 10:41:33 +0000 Subject: [PATCH] Enhance tcsh completions OBS-URL: https://build.opensuse.org/package/show/shells/tcsh?expand=0&rev=131 --- complete.tcsh | 106 +++++++++++++++++++++++++++++++++++++++++++++----- tcsh.changes | 6 +++ 2 files changed, 102 insertions(+), 10 deletions(-) diff --git a/complete.tcsh b/complete.tcsh index e668597..1b7dc10 100644 --- a/complete.tcsh +++ b/complete.tcsh @@ -442,7 +442,18 @@ skip_mh: # from George Cox complete acroread 'p/*/f:*.{pdf,fdf,PDF,FDF}/' - complete xpdf 'p/*/f:*.{pdf,fdf,PDF,FDF}/' + complete xpdf c/-/"(z g remote raise quit cmap rgb papercolor \ + eucjp t1lib freetype ps paperw paperh level1 \ + upw fullscreen cmd q v h help)"/ \ + n/-z/x:''/ \ + n/-g/x:''/ n/-remote/x:''/ \ + n/-rgb/x:''/ n/-papercolor/x:''/ \ + n/-{t1lib,freetype}/x:''/ \ + n/-ps/x:''/ n/-paperw/x:''/ \ + n/-paperh/x:''/ n/-upw/x:''/ \ + n/-/f:*.{pdf,PDF}/ \ + N/-{z,g,remote,rgb,papercolor,t1lib,freetype,ps,paperw,paperh,upw}/f:*.{pdf,PDF}/ \ + N/-/x:''/ p/1/f:*.{pdf,PDF}/ p/2/x:''/ complete kpdf 'p/*/f:*.{pdf,fdf,PDF,FDF}/' complete qpdf 'p/*/f:*.{pdf,fdf,PDF,FDF}/' complete evince 'p/*/f:*.{pdf,fdf,PDF,FDF}/' @@ -536,7 +547,7 @@ skip_mh: complete {gmake,make} \ 'c/{--directory,--include-dir}=/d/' 'c/{-C,-I}/d/' \ 'c/{--assume-new,--assume-old,--makefile,--new-file,--what-if,--file}=/f/' \ - 'c/{-W,-o,-f}/f/' \ + 'c/{-W,-o,-f}/f/' 'c/*=/f/' \ 'c/--/(assume-new= assume-old= debug directory= \ dry-run environment-overrides file= help \ ignore-errors include-dir= jobs[=N] just-print \ @@ -699,14 +710,72 @@ skip_mh: complete xhost c/[+-]/\$hosts/ n/*/\$hosts/ - complete emacs c/-/"(batch d f funcall i insert kill l load \ - no-init-file nw q t u user)"/ c/+/x:''/ \ - n/-d/x:''/ n/-f/x:''/ n/-i/f/ \ - n@-l@F:/usr/share/emacs/@ \ - n/-t/x:''/ \ - n/-u/u/ n/*/f:^*{[\#~],.dvi,.o,.gz,.Z,.z,.zip}/ + complete tcsh c/-D*=/'x:'/ c/-D/'x:'/ \ + c/-/"(b c d D e f F i l m n q s t v V x X -version)"/ \ + n/-c/c/ n/{-l,--version}/n/ n/*/'f:*.{,t}csh'/ - complete zcat c/--/"(force help license quiet version)"/ \ + complete rpm c/--/"(query verify nodeps nofiles nomd5 noscripts \ + nogpg nopgp install upgrade freshen erase allmatches \ + notriggers repackage test rebuild recompile initdb \ + rebuilddb addsign resign querytags showrc setperms \ + setugids all file group package querybynumber qf \ + triggeredby whatprovides whatrequires changelog \ + configfiles docfiles dump filesbypkg info last list \ + provides queryformat requires scripts state triggers \ + triggerscripts allfiles badreloc excludepath checksig \ + excludedocs force hash ignoresize ignorearch ignoreos \ + includedocs justdb noorder oldpackage percent prefix \ + relocate replace-files replacepkgs buildroot clean \ + nobuild rmsource rmspec short-circuit sign target \ + help version quiet rcfile pipe dbpath root specfile)"/\ + c/-/"(q V K i U F e ba bb bp bc bi bl bs ta tb tp tc \ + ti tl ts a f g p c d l R s h ? v vv -)"/ \ + n/{-f,--file}/f/ n/{-g,--group}/g/ n/--pipe/c/ n/--dbpath/d/ \ + n/--querybynumber/x:''/ n/--triggeredby/x:''/\ + n/--what{provides,requires}/x:''/ n/--root/d/ \ + n/--{qf,queryformat}/x:''/ n/--buildroot/d/ \ + n/--excludepath/x:''/ n/--prefix/x:''/ \ + n/--relocate/x:''/ n/--target/x:''/\ + n/--rcfile/x:''/ n/--specfile/x:''/ \ + n/{-[iUFep],--{install,upgrade,freshen,erase,package}}/f:*.rpm/ +if (-X emacs) then + complete emacs c/--/"(batch terminal display no-windows no-init-file \ + user debug-init unibyte multibyte version help \ + no-site-file funcall load eval insert kill)"/ \ + c/-/"(t d nw q u f l -)"/ c/+/x:''/ \ + n/{-t,--terminal}/x:''/ n/{-d,--display}/x:''/ \ + n/{-u,--user}/u/ n/{-f,--funcall}/x:''/ \ + n@{-l,--load}@F:/usr/share/emacs/@ \ + n/--eval/x:''/ n/--insert/f/ n/*/f:^*{[\#~],.dvi,.o}/ +endif +if (-X gpg) then + set _gpg_hash=(`gpg --version | sed -rn '/^Supported algorithms:/,$ {:join; /,$/{N; s/\n//; b join};/^Hash:/{s/(,|.*: )//g;s/.*/\L&/p}}'`) + set _gpg_cipher=(`gpg --version | sed -rn '/^Supported algorithms:/,$ {:join; /,$/{N; s/\n//; b join};/^Cipher:/{s/(,|.*: )//g;s/.*/\L&/p}}'`) + + complete gpg c/--/'(sign clearsign detach-sign encrypt symmetric \ + store decrypt verify list-keys list-sigs check-sigs \ + fingerprint list-secret-keys gen-key delete-key \ + delete-secret-key sign-key lsign-key edit-key gen-revoke \ + export send-keys recv-keys import list-packets \ + export-ownertrust import-ownertrust update-trustdb \ + check-trustdb fix-trustdb dearmor enarmor print-md armor\ + recipient default-recipient default-recipient-self \ + local-user textmode output verbose quiet no-tty \ + force-v3-sigs force-mdc dry-run batch yes no keyring \ + secret-keyring default-key keyserver charset options \ + status-fd load-extension rfc1991 openpgp s2k-mode \ + s2k-digest-algo s2k-cipher-algo cipher-algo digest-algo \ + compress-algo throw-keyid notation-data help)'/ \ + c/-/'(s b e c d a r u z o v q n N -)'/\ + n/{-z,--s2k-mode,--compress-algo}/'(0 1 2 3 4 5 6 7 8 9)'/ \ + n/{--digest-algo,--print-md,--s2k-digest-algo}/"($_gpg_hash)"/ \ + n/{-u,--local-user}/u/ \ + n/{--cipher-algo,--s2k-cipher-algo}/"($_gpg_cipher)"/ \ + n/{--keyserver}/''/ + unset _gpg_cipher + unset _gpg_hash +endif + complete {gzcat,zcat} c/--/"(force help license quiet version)"/ \ c/-/"(f h L q V -)"/ n/*/f:*.{gz,Z,z,zip}/ complete gzip c/--/"(stdout to-stdout decompress uncompress \ force help list license no-name quiet recurse \ @@ -739,6 +808,10 @@ skip_mh: complete ztouch n/*/f:*.{gz,Z,z,zip,taz,tgz}/ complete zforce n/*/f:^*.{gz,taz,tgz}/ + complete dcop 'p/1/`$:0`/ /' \ + 'p/2/`$:0 $:1 | awk \{print\ \$1\}`/ /' \ + 'p/3/`$:0 $:1 $:2 | sed "s%.* \(.*\)(.*%\1%"`/ /' + complete grep c/-*A/x:'<#_lines_after>'/ c/-*B/x:'<#_lines_before>'/ \ c/--/"(extended-regexp fixed-regexp basic-regexp \ regexp file ignore-case word-regexp line-regexp \ @@ -773,6 +846,11 @@ skip_mh: p/1/x:''/ N/-*e/f/ \ n/-*e/x:''/ n/-*f/f/ n/*/f/ + complete sed c/--/"(quiet silent version help expression file)"/ \ + c/-/"(n V e f -)"/ n/{-e,--expression}/x:'