From 3a1cdbdadc92e041b3b446f4d40d5ffcabe86d4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 24 Jun 2012 20:40:17 +0300 Subject: eog: New completion. --- completions/Makefile.am | 1 + completions/eog | 27 +++++++++++++++++++++++++++ test/completion/eog.exp | 1 + test/lib/completions/eog.exp | 18 ++++++++++++++++++ 4 files changed, 47 insertions(+) create mode 100644 completions/eog create mode 100644 test/completion/eog.exp create mode 100644 test/lib/completions/eog.exp diff --git a/completions/Makefile.am b/completions/Makefile.am index 0a24d0cd..2a884e9e 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -75,6 +75,7 @@ bashcomp_DATA = a2x \ dumpe2fs \ e2freefrag \ e2label \ + eog \ ether-wake \ evince \ explodepkg \ diff --git a/completions/eog b/completions/eog new file mode 100644 index 00000000..6da35e15 --- /dev/null +++ b/completions/eog @@ -0,0 +1,27 @@ +# eog(1) completion -*- shell-script -*- + +_eog() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + -'?'|--help|--help-all|--help-gtk) + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \ + -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi + + _filedir '@(ani|?(w)bmp|gif|ico|j2k|jp[cefgx2]|jpeg|pcx|pn[gm]|ras|svg?(z)|tga|tif?(f)|x[bp]m)' +} && +complete -F _eog eog + +# ex: ts=4 sw=4 et filetype=sh diff --git a/test/completion/eog.exp b/test/completion/eog.exp new file mode 100644 index 00000000..bba23491 --- /dev/null +++ b/test/completion/eog.exp @@ -0,0 +1 @@ +assert_source_completions eog diff --git a/test/lib/completions/eog.exp b/test/lib/completions/eog.exp new file mode 100644 index 00000000..b708c564 --- /dev/null +++ b/test/lib/completions/eog.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "eog " +sync_after_int + + +teardown -- cgit v1.2.1 From bffce4218e33bc61c0551b87e4b5bfbb41ad4223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 25 Jun 2012 17:44:11 +0300 Subject: wsimport: New completion. --- completions/Makefile.am | 1 + completions/wsimport | 49 +++++++++++++++++++++++++++++++++++++++ test/completion/wsimport.exp | 1 + test/lib/completions/wsimport.exp | 18 ++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 completions/wsimport create mode 100644 test/completion/wsimport.exp create mode 100644 test/lib/completions/wsimport.exp diff --git a/completions/Makefile.am b/completions/Makefile.am index 2a884e9e..81c5e537 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -333,6 +333,7 @@ bashcomp_DATA = a2x \ withlist \ wodim \ wol \ + wsimport \ wtf \ wvdial \ xfreerdp \ diff --git a/completions/wsimport b/completions/wsimport new file mode 100644 index 00000000..91504844 --- /dev/null +++ b/completions/wsimport @@ -0,0 +1,49 @@ +# wsimport(1) completion -*- shell-script -*- + +_wsimport() +{ + local cur prev words cword + _init_completion -n : || return + + case $prev in + -help|-version|-B|-p|-wsdllocation) + return + ;; + -b) + _filedir '@(xml|xjb)' + return + ;; + -catalog) + _filedir '@(xml|soc|catalog)' + return + ;; + -d|–s) + _filedir -d + return + ;; + -target) + COMPREPLY=( $( compgen -W '2.0 2.1 2.2' -- "$cur" ) ) + return + ;; + -clientjar) + _filedir jar + return + ;; + esac + + if [[ $cur == -httpproxy:* ]]; then + _known_hosts_real "${cur#-httpproxy:}" + return + elif [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' \ + -- "$cur" ) ) + [[ $COMPREPLY == *: ]] && compopt -o nospace + __ltrim_colon_completions "$cur" + return + fi + + _filedir wsdl +} && +complete -F _wsimport wsimport + +# ex: ts=4 sw=4 et filetype=sh diff --git a/test/completion/wsimport.exp b/test/completion/wsimport.exp new file mode 100644 index 00000000..3f889e26 --- /dev/null +++ b/test/completion/wsimport.exp @@ -0,0 +1 @@ +assert_source_completions wsimport diff --git a/test/lib/completions/wsimport.exp b/test/lib/completions/wsimport.exp new file mode 100644 index 00000000..36bf35c1 --- /dev/null +++ b/test/lib/completions/wsimport.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "wsimport " +sync_after_int + + +teardown -- cgit v1.2.1 From 36f1b832fd3544dd44dad7b6bce5c115f45cd50d Mon Sep 17 00:00:00 2001 From: Igor Murzov Date: Thu, 5 Jul 2012 01:00:25 +0400 Subject: kcov: Add new sort types (introduced in kcov-9). --- completions/kcov | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/completions/kcov b/completions/kcov index ebbd803c..e5b2436e 100644 --- a/completions/kcov +++ b/completions/kcov @@ -11,7 +11,8 @@ _kcov() return ;; --sort-type|-s) - COMPREPLY=( $( compgen -W 'filename percentage' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'filename percentage lines uncovered' \ + -- "$cur" ) ) return ;; --include-path|--exclude-path) -- cgit v1.2.1 From f604f6ce5b952e10ea6053445e9f70c2079943b8 Mon Sep 17 00:00:00 2001 From: Igor Murzov Date: Thu, 5 Jul 2012 01:01:50 +0400 Subject: kcov: Complete arguments of --limits option. --- completions/kcov | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/completions/kcov b/completions/kcov index e5b2436e..86d2d10c 100644 --- a/completions/kcov +++ b/completions/kcov @@ -19,8 +19,22 @@ _kcov() _filedir return ;; - --limits|-l|--title|-t|--include-pattern|--exclude-pattern|\ - --path-strip-level) + --limits|-l) + split=false + if [[ "$cur" == ?*,* ]]; then + prev="${cur%,*}" + cur="${cur##*,}" + split=true + fi + COMPREPLY=( $( compgen -W "{0..100}" -- "$cur" ) ) + if $split; then + COMPREPLY=( ${COMPREPLY[@]/#/"$prev,"} ) + else + compopt -o nospace + fi + return + ;; + --title|-t|--include-pattern|--exclude-pattern|--path-strip-level) # argument required but no completions available return ;; -- cgit v1.2.1 From f3e3fc5a4d51367a3e8ce29255bb386c809d0947 Mon Sep 17 00:00:00 2001 From: Ken Sharp Date: Thu, 14 Jun 2012 01:38:32 +0100 Subject: Add .msi completion for Wine --- completions/wine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/wine b/completions/wine index c02c97f0..2e8b1237 100644 --- a/completions/wine +++ b/completions/wine @@ -10,7 +10,7 @@ _wine() COMPREPLY=( $( compgen -W '--help --version' -- "$cur" ) ) [[ $COMPREPLY ]] && return fi - _filedir '[eE][xX][eE]?(.[sS][oO])|[cC][oO][mM]|[sS][cC][rR]' + _filedir '[eE][xX][eE]?(.[sS][oO])|[cC][oO][mM]|[sS][cC][rR]|[mM][sS][iI]' else _filedir fi -- cgit v1.2.1 From 217e143fd69ad2b83ec8187af2e9e1c21dcb759a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 7 Jul 2012 22:54:11 +0300 Subject: ssh: Add -O argument completion (Debian: #680652). --- completions/ssh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/completions/ssh b/completions/ssh index 5cd03b97..590ad88d 100644 --- a/completions/ssh +++ b/completions/ssh @@ -129,6 +129,10 @@ _ssh() COMPREPLY=( $( compgen -u -- "$cur" ) ) return 0 ;; + -O) + COMPREPLY=( $( compgen -W 'check forward exit stop' -- "$cur" ) ) + return 0 + ;; -o) _ssh_options return 0 @@ -141,7 +145,7 @@ _ssh() _ip_addresses return 0 ;; - -D|-e|-I|-L|-O|-p|-R|-W) + -D|-e|-I|-L|-p|-R|-W) return 0 ;; esac -- cgit v1.2.1 From 6a71ee504c11b798125b9c85359d5b7367a27dd4 Mon Sep 17 00:00:00 2001 From: Jeroen Hoek Date: Sat, 7 Jul 2012 11:42:34 +0200 Subject: Add more complete OpenDocument support to unzip completion. --- bash_completion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_completion b/bash_completion index d6ae8ae4..2a41208b 100644 --- a/bash_completion +++ b/bash_completion @@ -1847,7 +1847,7 @@ _install_xspec() } # bzcmp, bzdiff, bz*grep, bzless, bzmore intentionally not here, see Debian: #455510 _install_xspec '!*.?(t)bz?(2)' bunzip2 bzcat pbunzip2 pbzcat lbunzip2 lbzcat -_install_xspec '!*.@(zip|[ejsw]ar|exe|pk3|wsz|zargo|xpi|sxw|o[tx]t|od[fgpst]|epub|apk)' unzip zipinfo +_install_xspec '!*.@(zip|[ejsw]ar|exe|pk3|wsz|zargo|xpi|sxw|ot[tspgfc]|od[tspgfcm]|oxt|epub|apk)' unzip zipinfo _install_xspec '*.Z' compress znew # zcmp, zdiff, z*grep, zless, zmore intentionally not here, see Debian: #455510 _install_xspec '!*.@(Z|[gGd]z|t[ag]z)' gunzip zcat unpigz -- cgit v1.2.1 From 7c7b5608c8505633aa55e106f98d2a943937d41a Mon Sep 17 00:00:00 2001 From: Jeroen Hoek Date: Sat, 7 Jul 2012 12:02:05 +0200 Subject: Add support for OOXML document format extensions to unzip completion. --- bash_completion | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bash_completion b/bash_completion index 2a41208b..f4ebb450 100644 --- a/bash_completion +++ b/bash_completion @@ -1847,7 +1847,8 @@ _install_xspec() } # bzcmp, bzdiff, bz*grep, bzless, bzmore intentionally not here, see Debian: #455510 _install_xspec '!*.?(t)bz?(2)' bunzip2 bzcat pbunzip2 pbzcat lbunzip2 lbzcat -_install_xspec '!*.@(zip|[ejsw]ar|exe|pk3|wsz|zargo|xpi|sxw|ot[tspgfc]|od[tspgfcm]|oxt|epub|apk)' unzip zipinfo +# All ODF and OOXML office format files are zip-archives. See Ubuntu: #675987 for the rationale for including them. +_install_xspec '!*.@(zip|[ejsw]ar|exe|pk3|wsz|zargo|xpi|sxw|ot[tspgfc]|od[tspgfcm]|oxt|epub|apk|dot[xm]|doc[xm]|p[op]tx|p[op]tm|xlt[xm]|xls[xm])' unzip zipinfo _install_xspec '*.Z' compress znew # zcmp, zdiff, z*grep, zless, zmore intentionally not here, see Debian: #455510 _install_xspec '!*.@(Z|[gGd]z|t[ag]z)' gunzip zcat unpigz -- cgit v1.2.1 From ca533452195134de6ceb5c3f894e824fac53849a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 9 Jul 2012 00:00:23 +0300 Subject: Fine tune previous commit. --- bash_completion | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bash_completion b/bash_completion index f4ebb450..9732c102 100644 --- a/bash_completion +++ b/bash_completion @@ -1847,8 +1847,7 @@ _install_xspec() } # bzcmp, bzdiff, bz*grep, bzless, bzmore intentionally not here, see Debian: #455510 _install_xspec '!*.?(t)bz?(2)' bunzip2 bzcat pbunzip2 pbzcat lbunzip2 lbzcat -# All ODF and OOXML office format files are zip-archives. See Ubuntu: #675987 for the rationale for including them. -_install_xspec '!*.@(zip|[ejsw]ar|exe|pk3|wsz|zargo|xpi|sxw|ot[tspgfc]|od[tspgfcm]|oxt|epub|apk|dot[xm]|doc[xm]|p[op]tx|p[op]tm|xlt[xm]|xls[xm])' unzip zipinfo +_install_xspec '!*.@(zip|[ejsw]ar|exe|pk3|wsz|zargo|xpi|sxw|ot[tspgfc]|od[tspgfcm]|oxt|epub|apk|do[ct][xm]|p[op]t[mx]|xl[st][xm])' unzip zipinfo _install_xspec '*.Z' compress znew # zcmp, zdiff, z*grep, zless, zmore intentionally not here, see Debian: #455510 _install_xspec '!*.@(Z|[gGd]z|t[ag]z)' gunzip zcat unpigz -- cgit v1.2.1 From e2e64a16329cf0005006dffea590dce20200469d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 9 Jul 2012 00:01:56 +0300 Subject: wine: Fix extension glob to work on its own. It has just been working as a lucky side effect of the uppercasing we do in _filedir. --- completions/wine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/wine b/completions/wine index 2e8b1237..8cdc9146 100644 --- a/completions/wine +++ b/completions/wine @@ -10,7 +10,7 @@ _wine() COMPREPLY=( $( compgen -W '--help --version' -- "$cur" ) ) [[ $COMPREPLY ]] && return fi - _filedir '[eE][xX][eE]?(.[sS][oO])|[cC][oO][mM]|[sS][cC][rR]|[mM][sS][iI]' + _filedir '@([eE][xX][eE]?(.[sS][oO])|[cC][oO][mM]|[sS][cC][rR]|[mM][sS][iI])' else _filedir fi -- cgit v1.2.1 From c9ed16694da974ce9faa3f49a274c7c6cfb4abc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 11 Jul 2012 18:15:10 +0300 Subject: man: Add support for .lz man pages (RedHat: #839310). --- completions/man | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/completions/man b/completions/man index 0c3769d5..6e7aa75e 100644 --- a/completions/man +++ b/completions/man @@ -8,9 +8,10 @@ _man() local cur prev words cword split _init_completion -s -n : || return - local sect manpath manext mansect + local sect manpath manext mansect comprsuffix - manext="@([0-9lnp]|[0-9][px]|man|3?(gl|pm))?(.@([gx]z|bz2|lzma|Z))" + comprsuffix=".@([glx]z|bz2|lzma|Z)" + manext="@([0-9lnp]|[0-9][px]|man|3?(gl|pm))?($comprsuffix)" mansect="@([0-9lnp]|[0-9][px]|3?(gl|pm))" case $prev in @@ -82,7 +83,7 @@ _man() # weed out directory path names and paths to man pages COMPREPLY=( ${COMPREPLY[@]##*/?(:)} ) # strip suffix from man pages - COMPREPLY=( ${COMPREPLY[@]%.@([gx]z|bz2|lzma|Z)} ) + COMPREPLY=( ${COMPREPLY[@]%$comprsuffix} ) COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) ) if [[ "$prev" != $mansect ]]; then -- cgit v1.2.1 From a624cc2c3026981835330f4d001b7df53f8d84ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 11 Jul 2012 18:17:22 +0300 Subject: man: Trivial cleanups. --- completions/man | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/completions/man b/completions/man index 6e7aa75e..9ebdb1c3 100644 --- a/completions/man +++ b/completions/man @@ -8,11 +8,9 @@ _man() local cur prev words cword split _init_completion -s -n : || return - local sect manpath manext mansect comprsuffix - - comprsuffix=".@([glx]z|bz2|lzma|Z)" - manext="@([0-9lnp]|[0-9][px]|man|3?(gl|pm))?($comprsuffix)" - mansect="@([0-9lnp]|[0-9][px]|3?(gl|pm))" + local comprsuffix=".@([glx]z|bz2|lzma|Z)" + local manext="@([0-9lnp]|[0-9][px]|man|3?(gl|pm))?($comprsuffix)" + local mansect="@([0-9lnp]|[0-9][px]|3?(gl|pm))" case $prev in -C|--config-file) @@ -57,6 +55,7 @@ _man() return 0 fi + local manpath if [[ $OSTYPE == *@(darwin|linux|freebsd|cygwin)* ]] || _userland GNU; then manpath=$( manpath 2>/dev/null || command man --path ) else @@ -69,6 +68,7 @@ _man() fi # determine manual section to search + local sect [[ "$prev" == $mansect ]] && sect=$prev || sect='*' manpath=$manpath: -- cgit v1.2.1 From fc107b4bdc5a42302b6316ab80755d6cca69d9ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 13 Jul 2012 19:40:21 +0300 Subject: clzip, pdlzip, plzip: New lzip alias completions. --- completions/.gitignore | 3 +++ completions/Makefile.am | 7 +++++++ completions/lzip | 8 ++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/completions/.gitignore b/completions/.gitignore index 8eacc9c9..6f745623 100644 --- a/completions/.gitignore +++ b/completions/.gitignore @@ -18,6 +18,7 @@ ci ciptool civclient civserver +clzip co compare compgen @@ -92,6 +93,7 @@ muttng ncal pbzip2 pccardctl +pdlzip perldoc phing pigz @@ -100,6 +102,7 @@ ping6 pkg_deinstall pkg_info pkill +plzip pm-suspend pm-suspend-hybrid pmake diff --git a/completions/Makefile.am b/completions/Makefile.am index 81c5e537..b6895d2c 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -376,6 +376,7 @@ CLEANFILES = \ ciptool \ civclient \ civserver \ + clzip \ co \ compare \ compgen \ @@ -450,6 +451,7 @@ CLEANFILES = \ ncal \ pbzip2 \ pccardctl \ + pdlzip \ perldoc \ phing \ pigz \ @@ -458,6 +460,7 @@ CLEANFILES = \ pkg_deinstall \ pkg_info \ pkill \ + plzip \ pm-suspend \ pm-suspend-hybrid \ pmake \ @@ -676,6 +679,10 @@ symlinks: $(targetdir) rm -f $(targetdir)/$$file && \ $(LN_S) lvm $(targetdir)/$$file ; \ done + for file in clzip pdlzip plzip ; do \ + rm -f $(targetdir)/$$file && \ + $(LN_S) lzip $(targetdir)/$$file ; \ + done for file in gmake gnumake pmake ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) make $(targetdir)/$$file ; \ diff --git a/completions/lzip b/completions/lzip index 9df55382..7f613be8 100644 --- a/completions/lzip +++ b/completions/lzip @@ -9,12 +9,16 @@ _lzip() case $prev in -h|--help|-V|--version|-b|--member-size|-m|--match-length|\ - -s|--dictionary-size|-S|--volume-size) + -s|--dictionary-size|-S|--volume-size|-B|--data-size) return ;; -d|--decompress) decompress=true ;; + -n|--threads) + COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) + return + ;; -o|--output) _filedir return @@ -39,6 +43,6 @@ _lzip() COMPREPLY=( $( compgen -f -X "*.lz" -- "$cur" ) \ $( compgen -d -- "$cur" ) ) } && -complete -F _lzip lzip +complete -F _lzip clzip lzip pdlzip plzip # ex: ts=4 sw=4 et filetype=sh -- cgit v1.2.1 From 9f0a6e45f8238e3220db3ffaa058c39110ea7a59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 13 Jul 2012 19:40:40 +0300 Subject: lzip: Do not append space after equal sign in long options. --- completions/lzip | 1 + 1 file changed, 1 insertion(+) diff --git a/completions/lzip b/completions/lzip index 7f613be8..ae35b9d4 100644 --- a/completions/lzip +++ b/completions/lzip @@ -30,6 +30,7 @@ _lzip() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) {-1..-9}' \ -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace return fi -- cgit v1.2.1 From 882d527237c77cdc757672affa070bb1b150b778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 21 Jul 2012 13:05:15 +0300 Subject: mussh: New completion. --- completions/Makefile.am | 1 + completions/mussh | 52 ++++++++++++++++++++++++++++++++++++++++++ test/completion/mussh.exp | 1 + test/lib/completions/mussh.exp | 18 +++++++++++++++ 4 files changed, 72 insertions(+) create mode 100644 completions/mussh create mode 100644 test/completion/mussh.exp create mode 100644 test/lib/completions/mussh.exp diff --git a/completions/Makefile.am b/completions/Makefile.am index b6895d2c..02f239cc 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -208,6 +208,7 @@ bashcomp_DATA = a2x \ munin-node-configure \ munin-run \ munin-update \ + mussh \ mutt \ mysql \ mysqladmin \ diff --git a/completions/mussh b/completions/mussh new file mode 100644 index 00000000..a7bf2997 --- /dev/null +++ b/completions/mussh @@ -0,0 +1,52 @@ +# mussh(1) completion -*- shell-script -*- + +_mussh() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --help|-V|-m|-t) + return + ;; + -d) + COMPREPLY=( $( compgen -W '{0..2}' -- "$cur" ) ) + return + ;; + -v) + COMPREPLY=( $( compgen -W '{0..3}' -- "$cur" ) ) + return + ;; + -i|-H|-C) + _filedir + return + ;; + -o|-po) + _xfunc ssh _ssh_options + return + ;; + -l|-L) + COMPREPLY=( $( compgen -u -- "$cur" ) ) + return + ;; + -s) + _shells + return + ;; + -p|-h) + [[ $cur == *@* ]] && _user_at_host || _known_hosts_real -a "$cur" + return + ;; + -c) + compopt -o filenames + COMPREPLY+=( $( compgen -c -- "$cur" ) ) + return + ;; + esac + + [[ $cur != -* ]] || \ + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) +} && +complete -F _mussh mussh + +# ex: ts=4 sw=4 et filetype=sh diff --git a/test/completion/mussh.exp b/test/completion/mussh.exp new file mode 100644 index 00000000..1232287c --- /dev/null +++ b/test/completion/mussh.exp @@ -0,0 +1 @@ +assert_source_completions mussh diff --git a/test/lib/completions/mussh.exp b/test/lib/completions/mussh.exp new file mode 100644 index 00000000..24c5c1f1 --- /dev/null +++ b/test/lib/completions/mussh.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "mussh -" +sync_after_int + + +teardown -- cgit v1.2.1 From 3ea1597d3c6c926553b850caad75527a08412eb1 Mon Sep 17 00:00:00 2001 From: Igor Murzov Date: Sun, 22 Jul 2012 16:21:53 +0400 Subject: mount.linux: Add some new mount options intoduced in Linux 3.5 See: http://kernelnewbies.org/Linux_3.5 --- completions/mount.linux | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/completions/mount.linux b/completions/mount.linux index 20a3d6a0..9d587352 100644 --- a/completions/mount.linux +++ b/completions/mount.linux @@ -100,7 +100,7 @@ _mount() ip= domain= guest iocharset ro rw {,no}setuids {,no,dyn}perm directio {,no}mapchars {,no}intr hard soft noacl nocase sec= nobrl sfu {,no}serverino nounix nouser_xattr {r,w}size= - rwpidforward backup{u,g}id' -- "$cur") ) + rwpidforward backup{u,g}id cache=' -- "$cur") ) ;;& ext[2-4]|auto) COMPREPLY+=( $(compgen -W '{,no}acl bsddf minixdf check= debug @@ -135,7 +135,7 @@ _mount() iocharset= utf8' -- "$cur") ) ;;& jffs2|auto) - COMPREPLY+=( $(compgen -W 'compr=' -- "$cur") ) + COMPREPLY+=( $(compgen -W 'compr= rp_size=' -- "$cur") ) ;;& jfs|auto) COMPREPLY+=( $(compgen -W 'iocharset= resize= {,no}integrity -- cgit v1.2.1 From 3aa040d25f5556b6e9bf92c784072aba7620f729 Mon Sep 17 00:00:00 2001 From: Igor Murzov Date: Sun, 22 Jul 2012 16:38:30 +0400 Subject: mount.linux: Clean up mount options, remove duplicates. --- completions/mount.linux | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/completions/mount.linux b/completions/mount.linux index 9d587352..d1c08c50 100644 --- a/completions/mount.linux +++ b/completions/mount.linux @@ -72,15 +72,14 @@ _mount() # no completion if $cur is opt=smth [[ "$cur" == *=* ]] && return # mount options - COMPREPLY=( $(compgen -W 'loop async {,no}atime {,no}auto + COMPREPLY=( $(compgen -W 'loop {,a}sync {,no}atime {,no}auto {,fs,def,root}context= defaults {,no}dev {,no}diratime dirsync {,no}exec group {,no}iversion {,no}mand _netdev nofail {,no}relatime {,no}strictatime {,no}suid owner remount ro rw - sync {,no}user users' -- "$cur") ) + {,no}user users' -- "$cur") ) case "$fstype" in adfs|auto) - COMPREPLY+=( $(compgen -W 'uid= gid= {own,oth}mask=' -- \ - "$cur") ) + COMPREPLY+=( $(compgen -W '{u,g}id= {own,oth}mask=' -- "$cur") ) ;;& affs|auto) COMPREPLY+=( $(compgen -W '{u,g}id= set{u,g}id= mode= protect @@ -97,7 +96,7 @@ _mount() cifs|auto) COMPREPLY+=( $(compgen -W 'user= password= credentials= {u,g}id= force{u,g}id port= servern= netbiosname= {file,dir}_mode= - ip= domain= guest iocharset ro rw {,no}setuids {,no,dyn}perm + ip= domain= guest iocharset {,no}setuids {,no,dyn}perm directio {,no}mapchars {,no}intr hard soft noacl nocase sec= nobrl sfu {,no}serverino nounix nouser_xattr {r,w}size= rwpidforward backup{u,g}id cache=' -- "$cur") ) @@ -143,8 +142,8 @@ _mount() ;;& ntfs-3g) COMPREPLY+=( $(compgen -W '{u,g}id= {u,f,d}mask= usermapping= - permissions inherit ro locale= force {,no}recover - ignore_case remove_hiberfile {,no,rel}atime show_sys_files + permissions inherit locale= force {,no}recover + ignore_case remove_hiberfile show_sys_files hide_{hid,dot}_files windows_names allow_other max_read= silent no_def_opts streams_interface= user_xattr efs_raw {,no}compression debug no_detach' -- "$cur") ) @@ -174,7 +173,7 @@ _mount() COMPREPLY+=( $(compgen -W 'allocsize= {,no}attr2 barrier dmapi {,no}grpid {bsd,sysv}groups ihashsize= {,no}ikeep inode64 {,no}largeio logbufs= logbsize= logdev= rtdev= mtpt= noalign - noatime norecovery nouuid osyncisosync {u,g,p}qnoenforce + norecovery nouuid osyncisosync {u,g,p}qnoenforce {,u,usr,g,grp,p,prj}quota sunit= swidth= swalloc' \ -- "$cur") ) ;;& -- cgit v1.2.1 From 3f9fe7a853c74d68f64e05ecaca474e7a6819d81 Mon Sep 17 00:00:00 2001 From: Martin Ueding Date: Sat, 21 Jul 2012 19:24:40 +0200 Subject: Remove trailing whitespace Remove all trailing whitespace since that is not needed anyway. --- bash_completion | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/bash_completion b/bash_completion index 9732c102..0cf707d7 100644 --- a/bash_completion +++ b/bash_completion @@ -184,7 +184,7 @@ _upvar() # Assign variables one scope above the caller -# Usage: local varname [varname ...] && +# Usage: local varname [varname ...] && # _upvars [-v varname value] | [-aN varname [value ...]] ... # Available OPTIONS: # -aN Assign next N values to varname as array @@ -208,7 +208,7 @@ _upvars() "${FUNCNAME[0]}: \`$1': invalid number specifier" 1>&2 return 1; } # Assign array of -aN elements - [[ "$2" ]] && unset -v "$2" && eval $2=\(\"\${@:3:${1#-a}}\"\) && + [[ "$2" ]] && unset -v "$2" && eval $2=\(\"\${@:3:${1#-a}}\"\) && shift $((${1#-a} + 2)) || { echo "bash: ${FUNCNAME[0]}:"\ "\`$1${2+ }$2': missing argument(s)" 1>&2; return 1; } ;; @@ -244,7 +244,7 @@ __reassemble_comp_words_by_ref() # Exclude only those characters, which were really included exclude="${1//[^$COMP_WORDBREAKS]}" fi - + # Default to cword unchanged eval $3=$COMP_CWORD # Are characters excluded which were former included? @@ -355,7 +355,7 @@ __get_cword_at_cursor_by_ref() # cword Return cword via $cword # # Available OPTIONS: -# -n EXCLUDE Characters out of $COMP_WORDBREAKS which should NOT be +# -n EXCLUDE Characters out of $COMP_WORDBREAKS which should NOT be # considered word breaks. This is useful for things like scp # where we want to return host:path and not only path, so we # would pass the colon (:) as -n option in this case. @@ -383,7 +383,7 @@ _get_comp_words_by_ref() w) vwords=$OPTARG ;; esac done - while [[ $# -ge $OPTIND ]]; do + while [[ $# -ge $OPTIND ]]; do case ${!OPTIND} in cur) vcur=cur ;; prev) vprev=prev ;; @@ -399,7 +399,7 @@ _get_comp_words_by_ref() [[ $vcur ]] && { upvars+=("$vcur" ); upargs+=(-v $vcur "$cur" ); } [[ $vcword ]] && { upvars+=("$vcword"); upargs+=(-v $vcword "$cword"); } - [[ $vprev && $cword -ge 1 ]] && { upvars+=("$vprev" ); upargs+=(-v $vprev + [[ $vprev && $cword -ge 1 ]] && { upvars+=("$vprev" ); upargs+=(-v $vprev "${words[cword - 1]}"); } [[ $vwords ]] && { upvars+=("$vwords"); upargs+=(-a${#words[@]} $vwords "${words[@]}"); } @@ -479,7 +479,7 @@ _get_cword() # @deprecated Use `_get_comp_words_by_ref cur prev' instead # @see _get_comp_words_by_ref() # -_get_pword() +_get_pword() { if [[ $COMP_CWORD -ge 1 ]]; then _get_cword "${@:-}" 1 @@ -617,7 +617,7 @@ _split_longopt() } # Complete variables. -# @return True (0) if variables were completed, +# @return True (0) if variables were completed, # False (> 0) if not. _variables() { @@ -642,7 +642,7 @@ _variables() # -o XSPEC Passed to _filedir as first arg for other output redirections # -i XSPEC Passed to _filedir as first arg for stdin redirections # -s Split long options with _split_longopt, implies -n = -# @return True (0) if completion needs further processing, +# @return True (0) if completion needs further processing, # False (> 0) no further processing is necessary. # _init_completion() @@ -914,7 +914,7 @@ _ncpus() } # Perform tilde (~) completion -# @return True (0) if completion needs further processing, +# @return True (0) if completion needs further processing, # False (> 0) if tilde is followed by a valid username, completions # are put in COMPREPLY and no further processing is necessary. _tilde() @@ -951,7 +951,7 @@ _tilde() # ~foo/$HOME /home/foo/$HOME # ~foo/a b /home/foo/a b # ~foo/* /home/foo/* -# +# # @param $1 Name of variable (not the value of the variable) to expand __expand_tilde_by_ref() { @@ -966,7 +966,7 @@ __expand_tilde_by_ref() # becomes "b". Single quotes prevent eval. # +-----1----+ +---2----+ eval $1="${!1/%\/*}"/'${!1#*/}' - else + else # No, $1 doesn't contain slash eval $1="${!1}" fi -- cgit v1.2.1 From a9b253ca8b475dc2ffda6edc7451af28d23d4eed Mon Sep 17 00:00:00 2001 From: Martin Ueding Date: Sat, 21 Jul 2012 20:05:24 +0200 Subject: Remove more whitespace --- CHANGES | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 3c01e9f8..17d582c3 100644 --- a/CHANGES +++ b/CHANGES @@ -324,7 +324,7 @@ bash-completion (1.90) bash-completion (1.3) [ Guillaume Rousse ] - * added pure-perl perldoc completion helper, using work from Aristotle + * added pure-perl perldoc completion helper, using work from Aristotle Pagaltzis (pagaltzis@gmx.de) * added completions for xfreerdp and iscsiadm * updated xm subcommands list @@ -880,7 +880,7 @@ bash-completion (1.0) completion-by-extension for `display' (Alioth#311429) * Removed duplicate completion option `-borderwidth' for `display' * Prevent completion dir from being sourced twice if - BASH_COMPLETION_DIR and BASH_COMPLETION_COMPAT_DIR are equal (Alioth#311433) + BASH_COMPLETION_DIR and BASH_COMPLETION_COMPAT_DIR are equal (Alioth#311433) * Make `_mii-tool()' and `_mii-diag()' POSIX-compliant * Fix _isql completion waiting for grep input if $ODBCINI not set; handle whitespace in $ODBCINI. @@ -898,7 +898,7 @@ bash-completion (1.0) bash-completion (20080705) unstable; urgency=low [ David Paleino ] - * Added more completions to imagemagick (thanks to Nelson A. de + * Added more completions to imagemagick (thanks to Nelson A. de Oliveira) (Debian: #487786) * Added xrandr completion (thanks to Anton Khirnov) (Debian: #487825) * Improving _gdb completion: @@ -931,7 +931,7 @@ bash-completion (20080617.4) experimental; urgency=low - refactored _filedir_xspec using quote_readline() - fixed COMPREPLY's in _iwconfig - fixed _cvs() - - _known_hosts(): use files from UserKnownHostsFile options in + - _known_hosts(): use files from UserKnownHostsFile options in addition to standard ones. - fixed _command() to correctly prune the command line - disabled completion of PostgreSQL users and databases (Ubuntu: #164772) @@ -999,7 +999,7 @@ bash-completion (20080617) unstable; urgency=low - added rrdtool completion, thanks to Justin Pryzby (Debian: #428641) - added OpenDocument completion for unzip/zipinfo (.od{f,g,p,s,t}) (Debian: #472940) - - fixed escaping problems with job control (i.e. disown, jobs, bg, + - fixed escaping problems with job control (i.e. disown, jobs, bg, fg): the argument is now surrounded by "" (Debian: #347316) - make mkdir complete also on filenames (Debian: #376433) - {bz,z}{cat,cmp,diff,egrep,fgrep,grep,less,more} now should complete @@ -1007,7 +1007,7 @@ bash-completion (20080617) unstable; urgency=low (Debian: #455510) - fixes Perl completion (Debian: #470742) - fixes get_cword -> _get_cword typo (Debian: #478596) - - fixes _get_cword() function to properly handle filenames with + - fixes _get_cword() function to properly handle filenames with whitespaces (Debian: #394636, #468254, #474094) - added .pdf.bz2 completion to evince (Debian: #424736) - added .svg completion to display (Debian: #441017) -- cgit v1.2.1 From a6ff57986f22d19e7a638e398a73a1a3ac19ff13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 22 Jul 2012 19:35:03 +0300 Subject: Trim trailing whitespace. --- completions/mplayer | 2 +- completions/ntpdate | 2 +- completions/puppet | 24 ++++++++++++------------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/completions/mplayer b/completions/mplayer index ba8e3e90..2272c0aa 100644 --- a/completions/mplayer +++ b/completions/mplayer @@ -220,7 +220,7 @@ _mplayer() ;; -cdda) COMPREPLY=( $( compgen -W 'speed= paranoia= generic-dev= \ - sector-size= overlap= toc-bias toc-offset= skip noskip' \ + sector-size= overlap= toc-bias toc-offset= skip noskip' \ -- "$cur" ) ) return 0 ;; diff --git a/completions/ntpdate b/completions/ntpdate index e09a2dfb..dab38477 100644 --- a/completions/ntpdate +++ b/completions/ntpdate @@ -18,7 +18,7 @@ _ntpdate() COMPREPLY=( $( compgen -W '{1..8}' -- "$cur" ) ) return 0 ;; - + -a|-e|-o|-t) return 0 ;; diff --git a/completions/puppet b/completions/puppet index 66a81b3b..bb58aadb 100644 --- a/completions/puppet +++ b/completions/puppet @@ -20,7 +20,7 @@ _puppet_certs() local puppetca="puppet cert" PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type puppetca &>/dev/null \ && puppetca=puppetca - + if [[ "$1" = '--all' ]]; then cert_list=$( $puppetca --list --all | sed -e 's/^[+-]\?\s*\(\S\+\)\s\+.*$/\1/' ) else @@ -151,7 +151,7 @@ _puppet() fi return 0 esac - ;; + ;; cert) case $prev in --digest) @@ -188,7 +188,7 @@ _puppet() return 0 esac esac - ;; + ;; describe) if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--help --short --providers --list \ @@ -197,7 +197,7 @@ _puppet() _puppet_types fi return 0 - ;; + ;; doc) case $prev in --outputdir) @@ -221,7 +221,7 @@ _puppet() fi return 0 esac - ;; + ;; filebucket) case $prev in --server) @@ -244,14 +244,14 @@ _puppet() fi return 0 esac - ;; + ;; kick) case $prev in --class) return 0 ;; --host) - _known_hosts_real "$cur" + _known_hosts_real "$cur" return 0 ;; --tag) @@ -267,7 +267,7 @@ _puppet() fi return 0 esac - ;; + ;; master) case $prev in --logdest) @@ -280,7 +280,7 @@ _puppet() -- "$cur" ) ) return 0 esac - ;; + ;; queue) case $prev in --logdest) @@ -297,14 +297,14 @@ _puppet() fi return 0 esac - ;; + ;; resource|*) COMPREPLY=( $( compgen -W '--help --version --debug --verbose' \ -- "$cur" ) ) return 0 - ;; + ;; esac } && -complete -F _puppet puppetmasterd puppetd puppetca ralsh puppetrun puppetqd filebucket puppetdoc puppet +complete -F _puppet puppetmasterd puppetd puppetca ralsh puppetrun puppetqd filebucket puppetdoc puppet # ex: ts=4 sw=4 et filetype=sh -- cgit v1.2.1 From 371fb91b213c3bb4b86eb22e09701ec1be18b7dd Mon Sep 17 00:00:00 2001 From: Igor Murzov Date: Wed, 25 Jul 2012 02:39:23 +0400 Subject: slackpkg, slapt-get: Update the list of package sets. Xfce has its own package set in Slackware-14.0. --- completions/slackpkg | 4 ++-- completions/slapt-get | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/completions/slackpkg b/completions/slackpkg index 1be2f956..dab9c6d4 100644 --- a/completions/slackpkg +++ b/completions/slackpkg @@ -70,14 +70,14 @@ _slackpkg() remove) _filedir COMPREPLY+=( $( compgen -W 'a ap d e f k kde kdei l n t tcl x - xap y' -- "$cur" ) ) + xap xfce y' -- "$cur" ) ) COMPREPLY+=( $( cd /var/log/packages; compgen -f -- "$cur" ) ) return ;; install|reinstall|upgrade|blacklist|download) _filedir COMPREPLY+=( $( compgen -W 'a ap d e f k kde kdei l n t tcl x - xap y' -- "$cur" ) ) + xap xfce y' -- "$cur" ) ) COMPREPLY+=( $( cut -f 6 -d\ "${WORKDIR}/pkglist" 2> /dev/null | \ grep "^$cur" ) ) return diff --git a/completions/slapt-get b/completions/slapt-get index ff42660a..93d110bc 100644 --- a/completions/slapt-get +++ b/completions/slapt-get @@ -70,7 +70,7 @@ _slapt_get() ;; set) # --install-set COMPREPLY=( $( compgen -W 'a ap d e f k kde kdei l n t tcl x - xap y' -- "$cur" ) ) + xap xfce y' -- "$cur" ) ) return ;; esac -- cgit v1.2.1 From 31e262bcaf9bee249deb24a0e08cd85346d7a628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 28 Jul 2012 13:06:07 +0300 Subject: colormake: New make alias completion (LP: #743208, Debian: #682557). Thanks to "mreichardt". --- completions/Makefile.am | 3 ++- completions/make | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/completions/Makefile.am b/completions/Makefile.am index 02f239cc..13fc83b7 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -379,6 +379,7 @@ CLEANFILES = \ civserver \ clzip \ co \ + colormake \ compare \ compgen \ composite \ @@ -684,7 +685,7 @@ symlinks: $(targetdir) rm -f $(targetdir)/$$file && \ $(LN_S) lzip $(targetdir)/$$file ; \ done - for file in gmake gnumake pmake ; do \ + for file in colormake gmake gnumake pmake ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) make $(targetdir)/$$file ; \ done diff --git a/completions/make b/completions/make index 1aec3489..aa19b242 100644 --- a/completions/make +++ b/completions/make @@ -74,6 +74,6 @@ _make() fi } && -complete -F _make make gmake gnumake pmake +complete -F _make make gmake gnumake pmake colormake # ex: ts=4 sw=4 et filetype=sh -- cgit v1.2.1 From 6158bd2d86f6122cfc8d3df045e9f4c7c8f3293a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 1 Aug 2012 20:13:58 +0300 Subject: Ignore colormake symlink. --- completions/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/completions/.gitignore b/completions/.gitignore index 6f745623..f0b3d528 100644 --- a/completions/.gitignore +++ b/completions/.gitignore @@ -20,6 +20,7 @@ civclient civserver clzip co +colormake compare compgen composite -- cgit v1.2.1 From 3c49af9ec97b66553c3d756de8f4b5a5f8a54708 Mon Sep 17 00:00:00 2001 From: Igor Murzov Date: Thu, 9 Aug 2012 15:36:08 +0400 Subject: opera: Handle options. --- bash_completion | 2 +- completions/Makefile.am | 1 + completions/opera | 46 ++++++++++++++++++++++++++++++++++++++++++ test/completion/opera.exp | 1 + test/lib/completions/opera.exp | 18 +++++++++++++++++ 5 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 completions/opera create mode 100644 test/completion/opera.exp create mode 100644 test/lib/completions/opera.exp diff --git a/bash_completion b/bash_completion index 0cf707d7..b51f38b7 100644 --- a/bash_completion +++ b/bash_completion @@ -1884,7 +1884,7 @@ _install_xspec '!*.@(669|abc|am[fs]|d[bs]m|dmf|far|it|mdl|m[eo]d|mid?(i)|mt[2m]| _install_xspec '*.@(o|so|so.!(conf|*/*)|a|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class)' vi vim gvim rvim view rview rgvim rgview gview emacs xemacs sxemacs kate kwrite _install_xspec '!*.@(zip|z|gz|tgz)' bzme # konqueror not here on purpose, it's more than a web/html browser -_install_xspec '!*.@(?([xX]|[sS])[hH][tT][mM]?([lL]))' netscape mozilla lynx opera galeon dillo elinks amaya firefox mozilla-firefox iceweasel google-chrome chromium-browser epiphany +_install_xspec '!*.@(?([xX]|[sS])[hH][tT][mM]?([lL]))' netscape mozilla lynx galeon dillo elinks amaya firefox mozilla-firefox iceweasel google-chrome chromium-browser epiphany _install_xspec '!*.@(sxw|stw|sxg|sgl|doc?([mx])|dot?([mx])|rtf|txt|htm|html|?(f)odt|ott|odm)' oowriter _install_xspec '!*.@(sxi|sti|pps?(x)|ppt?([mx])|pot?([mx])|?(f)odp|otp)' ooimpress _install_xspec '!*.@(sxc|stc|xls?([bmx])|xlw|xlt?([mx])|[ct]sv|?(f)ods|ots)' oocalc diff --git a/completions/Makefile.am b/completions/Makefile.am index 13fc83b7..82bf55d3 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -221,6 +221,7 @@ bashcomp_DATA = a2x \ nslookup \ ntpdate \ openssl \ + opera \ p4 \ pack200 \ passwd \ diff --git a/completions/opera b/completions/opera new file mode 100644 index 00000000..6cbfbacf --- /dev/null +++ b/completions/opera @@ -0,0 +1,46 @@ +# opera(1) completion -*- shell-script -*- + +_opera() +{ + local cur prev words cword + _init_completion || return + + case "$prev" in + ?(-)-widget|?(-)-urllist|?(-)-uiparserlog|?(-)-uiwidgetsparserlog|\ + ?(-)-profilinglog) + _filedir + return + ;; + ?(-)-[psb]d) + _filedir -d + return + ;; + ?(-)-remote) + COMPREPLY=( $( compgen -W 'openURL\\( openFile\\( openM2\\( + openComposer\\( addBookmark\\( raise\\(\\) lower\\(\\)' \ + -- "$cur" ) ) + [[ $COMPREPLY == *\( ]] && compopt -o nospace + return + ;; + ?(-)-windowname) + COMPREPLY=( $( compgen -W 'first last opera{1..9}' -- "$cur" ) ) + return + ;; + ?(-)-geometry|?(-)-window|?(-)-display|?(-)-urllistloadtimeout|\ + ?(-)-delaycustomizations|?(-)-dialogtest|?(-)-inidialogtest|\ + ?(-)-gputest) + # argument required but no completions available + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi + + _filedir '@(?([xX]|[sS])[hH][tT][mM]?([lL]))' +} && complete -F _opera opera + +# ex: ts=4 sw=4 et filetype=sh diff --git a/test/completion/opera.exp b/test/completion/opera.exp new file mode 100644 index 00000000..9ab6a08f --- /dev/null +++ b/test/completion/opera.exp @@ -0,0 +1 @@ +assert_source_completions opera diff --git a/test/lib/completions/opera.exp b/test/lib/completions/opera.exp new file mode 100644 index 00000000..9b666403 --- /dev/null +++ b/test/lib/completions/opera.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "opera " +sync_after_int + + +teardown -- cgit v1.2.1 From f379e9275c5a966dacd3b2bd45a5b651aae55641 Mon Sep 17 00:00:00 2001 From: Igor Murzov Date: Thu, 9 Aug 2012 15:50:21 +0400 Subject: mount.linux: Add options completion for davfs. --- completions/mount.linux | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/completions/mount.linux b/completions/mount.linux index d1c08c50..f727b39e 100644 --- a/completions/mount.linux +++ b/completions/mount.linux @@ -16,10 +16,10 @@ _mount() split=true fi COMPREPLY=( $(compgen -W 'auto adfs affs autofs btrfs cifs coda - cramfs debugfs devpts efs ext2 ext3 ext4 fuse hfs hfsplus hpfs - iso9660 jffs2 jfs minix msdos ncpfs nfs nfs4 ntfs ntfs-3g proc - qnx4 ramfs reiserfs romfs squashfs smbfs sysv tmpfs ubifs udf - ufs umsdos usbfs vfat xfs' -- "$cur") ) + cramfs davfs debugfs devpts efs ext2 ext3 ext4 fuse hfs hfsplus + hpfs iso9660 jffs2 jfs minix msdos ncpfs nfs nfs4 ntfs ntfs-3g + proc qnx4 ramfs reiserfs romfs squashfs smbfs sysv tmpfs ubifs + udf ufs umsdos usbfs vfat xfs' -- "$cur") ) _fstypes $split && COMPREPLY=( ${COMPREPLY[@]/#/$prev,} ) return @@ -101,6 +101,10 @@ _mount() nobrl sfu {,no}serverino nounix nouser_xattr {r,w}size= rwpidforward backup{u,g}id cache=' -- "$cur") ) ;;& + davfs|auto) + COMPREPLY+=( $(compgen -W 'conf= {file,dir}_mode= {u,g}id= + username=' -- "$cur") ) + ;;& ext[2-4]|auto) COMPREPLY+=( $(compgen -W '{,no}acl bsddf minixdf check= debug errors= {,no}grpid {bsd,sysv}groups {,no,usr,grp}quota -- cgit v1.2.1 From 30f93357c81bf3fbb03ef8a6b3b0f5ce9addde13 Mon Sep 17 00:00:00 2001 From: Igor Murzov Date: Sat, 11 Aug 2012 20:31:27 +0400 Subject: evince: Evince supports opening .pdf.xz files (Alioth: #313739). Patch provided by Anonymous --- completions/evince | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/evince b/completions/evince index 9c7d0c3a..8ef75160 100644 --- a/completions/evince +++ b/completions/evince @@ -26,7 +26,7 @@ _evince() return fi - _filedir '@(@(?(e)ps|?(E)PS|[pf]df|[PF]DF|dvi|DVI)?(.gz|.GZ|.bz2|.BZ2)|cb[rz]|djv?(u)|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx)' + _filedir '@(@(?(e)ps|?(E)PS|[pf]df|[PF]DF|dvi|DVI)?(.gz|.GZ|.bz2|.BZ2|.xz|.XZ)|cb[rz]|djv?(u)|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx)' } && complete -F _evince evince -- cgit v1.2.1 From dc150937d126430f5cc20dfaf3239a71049fe0df Mon Sep 17 00:00:00 2001 From: Christian von Roques Date: Tue, 22 May 2012 16:10:58 -0400 Subject: Fix __reassemble_comp_words_by_ref for $COMP_CWORD == ${#COMP_WORDS[@]} --- bash_completion | 1 + 1 file changed, 1 insertion(+) diff --git a/bash_completion b/bash_completion index b51f38b7..f3488ba2 100644 --- a/bash_completion +++ b/bash_completion @@ -284,6 +284,7 @@ __reassemble_comp_words_by_ref() # Indicate new cword [[ $i == $COMP_CWORD ]] && eval $3=$j done + [[ $i == $COMP_CWORD ]] && eval $3=$j else # No, list of word completions separators hasn't changed; eval $2=\( \"\${COMP_WORDS[@]}\" \) -- cgit v1.2.1 From 904faab0c57b4f6a65a4f62dc9f644d4771e59fe Mon Sep 17 00:00:00 2001 From: Igor Murzov Date: Sun, 12 Aug 2012 18:28:17 +0400 Subject: valgrind: Add --soname-synonyms option arguments completion. This option was introduced in Valgrind-3.8.0. --- completions/valgrind | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/completions/valgrind b/completions/valgrind index 1930c21b..6fd3f5d6 100644 --- a/completions/valgrind +++ b/completions/valgrind @@ -42,6 +42,11 @@ _valgrind() COMPREPLY=( $( compgen -W 'lax-ioctls enable-outer' -- "$cur" ) ) return ;; + --soname-synonyms) + COMPREPLY=( $( compgen -W 'somalloc' -S = -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + ;; --kernel-variant) COMPREPLY=( $( compgen -W 'bproc' -- "$cur" ) ) return -- cgit v1.2.1 From b9276c8a374ac5e8cbe7ac814fe3c989f903ddd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 19 Aug 2012 13:48:20 +0300 Subject: eject: New completion. --- completions/Makefile.am | 1 + completions/eject | 30 ++++++++++++++++++++++++++++++ test/completion/eject.exp | 1 + test/lib/completions/eject.exp | 18 ++++++++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 completions/eject create mode 100644 test/completion/eject.exp create mode 100644 test/lib/completions/eject.exp diff --git a/completions/Makefile.am b/completions/Makefile.am index 82bf55d3..8d590576 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -75,6 +75,7 @@ bashcomp_DATA = a2x \ dumpe2fs \ e2freefrag \ e2label \ + eject \ eog \ ether-wake \ evince \ diff --git a/completions/eject b/completions/eject new file mode 100644 index 00000000..d6b1f6d9 --- /dev/null +++ b/completions/eject @@ -0,0 +1,30 @@ +# bash completion for eject(1) -*- shell-script -*- + +_eject() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -h|--help|-V|--version|-c|--changerslot|-x|--cdspeed) + return + ;; + -a|--auto|-i|--manualeject) + COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + return + elif [[ $prev == @(-d|--default) ]]; then + return + fi + + _cd_devices + _dvd_devices +} && +complete -F _eject eject + +# ex: ts=4 sw=4 et filetype=sh diff --git a/test/completion/eject.exp b/test/completion/eject.exp new file mode 100644 index 00000000..5f02e2ae --- /dev/null +++ b/test/completion/eject.exp @@ -0,0 +1 @@ +assert_source_completions eject diff --git a/test/lib/completions/eject.exp b/test/lib/completions/eject.exp new file mode 100644 index 00000000..8de109d4 --- /dev/null +++ b/test/lib/completions/eject.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "eject -" +sync_after_int + + +teardown -- cgit v1.2.1 From 2897e62fe7e535eb048f7e08f03ac3fbc3a84fa5 Mon Sep 17 00:00:00 2001 From: Igor Murzov Date: Wed, 22 Aug 2012 15:13:43 +0400 Subject: fusermount: Complete curlftpfs-mounts for "fusermount -u" (Debian: #685377) Patch provided by Tim Riemenschneider --- completions/fusermount | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/completions/fusermount b/completions/fusermount index fa51b228..e711e791 100644 --- a/completions/fusermount +++ b/completions/fusermount @@ -11,8 +11,8 @@ _fusermount() ;; -u) COMPREPLY=( $( compgen -W "$( awk \ - '{ if ($3 ~ /^fuse\./) print $2 }' /etc/mtab 2>/dev/null )" \ - -- "$cur" ) ) + '{ if ($3 ~ /^fuse(\.|$)/) print $2 }' /etc/mtab \ + 2>/dev/null )" -- "$cur" ) ) return 0 ;; esac -- cgit v1.2.1 From 92ddcea20a473a8d59b1efaea94261b4b36fa35c Mon Sep 17 00:00:00 2001 From: Guillaume Rousse Date: Tue, 4 Sep 2012 20:37:13 +0200 Subject: gphoto2: new completion --- CHANGES | 3 +++ completions/gphoto2 | 51 ++++++++++++++++++++++++++++++++++++++++ test/completion/gphoto2.exp | 1 + test/lib/completions/gphoto2.exp | 18 ++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 completions/gphoto2 create mode 100644 test/completion/gphoto2.exp create mode 100644 test/lib/completions/gphoto2.exp diff --git a/CHANGES b/CHANGES index 17d582c3..496d62b4 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ + [ Guillaume Rousse ] + * gphoto2: new completion + bash-completion (2.0) [ Anthony Ramine ] diff --git a/completions/gphoto2 b/completions/gphoto2 new file mode 100644 index 00000000..02ddf785 --- /dev/null +++ b/completions/gphoto2 @@ -0,0 +1,51 @@ +# bash completion for gphoto2(1) -*- shell-script -*- + +_gphoto2() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + --debug-logfile) + _filedir + return 0 + ;; + --hook-script) + _filedir + return 0 + ;; + --filename) + _filedir + return 0 + ;; + -u|--upload-file) + _filedir + return 0 + ;; + --port) + COMPREPLY=( $(compgen -W "$( gphoto2 --list-ports 2>/dev/null | \ + tail -n +4 | awk '{ print $1 }' )" -- "$cur") ) + return 0 + ;; + --camera) + local IFS=$'\n' + COMPREPLY=( $(compgen -W "$( gphoto2 --list-cameras 2>/dev/null | \ + tail -n +3 | awk -F'"' '{ print $2 }' )" -- "$cur") ) + return 0 + ;; + --get-config|--set-config|--set-config-index|--set-config-value) + COMPREPLY=( $(compgen -W "$( gphoto2 --list-config 2>/dev/null \ + )" -- "$cur") ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + return 0 + fi + +} && +complete -F _gphoto2 gphoto2 + +# ex: ts=4 sw=4 et filetype=sh diff --git a/test/completion/gphoto2.exp b/test/completion/gphoto2.exp new file mode 100644 index 00000000..1eab94b0 --- /dev/null +++ b/test/completion/gphoto2.exp @@ -0,0 +1 @@ +assert_source_completions gphoto2 diff --git a/test/lib/completions/gphoto2.exp b/test/lib/completions/gphoto2.exp new file mode 100644 index 00000000..90dc1e5e --- /dev/null +++ b/test/lib/completions/gphoto2.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "gphoto2 --" +sync_after_int + + +teardown -- cgit v1.2.1 From 7f1721dd9064e5685b984975a7819bfe18b8d71b Mon Sep 17 00:00:00 2001 From: Guillaume Rousse Date: Tue, 4 Sep 2012 22:42:29 +0200 Subject: nmcli: new completion --- CHANGES | 1 + completions/Makefile.am | 2 + completions/nmcli | 199 +++++++++++++++++++++++++++++++++++++++++ test/completion/nmcli.exp | 1 + test/lib/completions/nmcli.exp | 18 ++++ 5 files changed, 221 insertions(+) create mode 100644 completions/nmcli create mode 100644 test/completion/nmcli.exp create mode 100644 test/lib/completions/nmcli.exp diff --git a/CHANGES b/CHANGES index 496d62b4..49b22a06 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,6 @@ [ Guillaume Rousse ] * gphoto2: new completion + * nmcli: new completion bash-completion (2.0) diff --git a/completions/Makefile.am b/completions/Makefile.am index 8d590576..a6cba386 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -107,6 +107,7 @@ bashcomp_DATA = a2x \ gpasswd \ gpg \ gpg2 \ + gphoto2 \ gprof \ groupadd \ groupdel \ @@ -219,6 +220,7 @@ bashcomp_DATA = a2x \ newlist \ newusers \ nmap \ + nmcli \ nslookup \ ntpdate \ openssl \ diff --git a/completions/nmcli b/completions/nmcli new file mode 100644 index 00000000..dc55ebb8 --- /dev/null +++ b/completions/nmcli @@ -0,0 +1,199 @@ +# nmcli completion -*- shell-script -*- + +_nmcli_list() +{ + COMPREPLY=( $( compgen -W '$1' -- $cur ) ) +} + +_nmcli_con_id() +{ + local IFS=$'\n' + COMPREPLY=( $( compgen -W "$(nmcli con list 2>/dev/null | \ + tail -n +2 | awk -F ' {2,}' '{print $1 }')" -- $cur ) ) +} + +_nmcli_con_uuid() +{ + COMPREPLY=( $( compgen -W "$(nmcli con list 2>/dev/null | \ + tail -n +2 | awk -F ' {2,}' '{print $2}')" -- $cur ) ) +} + +_nmcli_ap_ssid() +{ + local IFS=$'\n' + COMPREPLY=( $( compgen -W "$(nmcli dev wifi list 2>/dev/null | \ + tail -n +2 | awk -F ' {2,}' '{print $1}')" -- $cur ) ) +} + +_nmcli_ab_bssid() +{ + COMPREPLY=( $( compgen -W "$(nmcli dev wifi list 2>/dev/null | \ + tail -n +2 | awk -F ' {2,}' '{print $2}')" -- $cur ) ) +} + +_nmcli() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -m|--mode) + COMPREPLY=( $( compgen -W 'tabular multiline' -- $cur ) ) + return 0 + ;; + -f|--fields) + COMPREPLY=( $( compgen -W 'all common' -- $cur ) ) + return 0 + ;; + -e|--escape) + _nmcli_list "yes no" + return 0 + ;; + id) + _nmcli_con_id + return 0 + ;; + uuid) + _nmcli_con_uuid + return 0 + ;; + iface) + _available_interfaces + return 0 + ;; + bssid) + _nmcli_ab_bssid + return 0 + ;; + wep-key-type) + _nmcli_list "key phrase" + return 0 + ;; + esac + + if [[ $cword -eq 1 ]] ; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--terse --pretty --mode --fields \ + --escape --version --help' -- $cur ) ) + else + COMPREPLY=( $( compgen -W "nm con dev" -- $cur ) ) + fi + else + local object=${words[1]} + local command=${words[2]} + + case $object in + nm) + case $command in + enable) + _nmcli_list "true false" + return 0 + ;; + sleep) + _nmcli_list "true false" + return 0 + ;; + wifi) + _nmcli_list "on off" + return 0 + ;; + wwan) + _nmcli_list "on off" + return 0 + ;; + wimax) + _nmcli_list "on off" + return 0 + ;; + esac + + COMPREPLY=( $( compgen -W 'status permissions enable sleep \ + wifi wwan wimax' -- $cur ) ) + ;; + con) + case $command in + list) + COMPREPLY=( $( compgen -W 'id uuid' -- $cur ) ) + return 0 + ;; + up) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--nowait --timeout' \ + -- $cur ) ) + else + COMPREPLY=( $( compgen -W 'id uuid iface ap nsp' \ + -- $cur ) ) + fi + return 0 + ;; + down) + COMPREPLY=( $( compgen -W 'id uuid' -- $cur ) ) + return 0 + ;; + delete) + COMPREPLY=( $( compgen -W 'id uuid' -- $cur ) ) + return 0 + ;; + esac + + COMPREPLY=( $( compgen -W 'list status up down delete' \ + -- $cur ) ) + ;; + dev) + case $command in + list) + COMPREPLY=( $( compgen -W 'iface' -- $cur ) ) + return 0 + ;; + disconnect) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--nowait --timeout' \ + -- $cur ) ) + else + COMPREPLY=( $( compgen -W 'iface' -- $cur ) ) + fi + return 0 + ;; + wifi) + local subcommand=${words[3]} + + case $subcommand in + list) + COMPREPLY=( $( compgen -W 'iface bssid' \ + -- $cur ) ) + return 0 + ;; + connect) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--private \ + --nowait --timeout' -- $cur ) ) + else + if [[ "$prev" == "connect" ]]; then + _nmcli_ap_ssid + else + COMPREPLY=( $( compgen -W 'password \ + wep-key-type iface bssid name' \ + -- $cur ) ) + fi + fi + return 0 + ;; + esac + + COMPREPLY=( $( compgen -W 'list connect' -- $cur ) ) + return 0 + ;; + esac + + COMPREPLY=( $( compgen -W 'status list disconnect wifi' \ + -- $cur ) ) + ;; + esac + + fi + + return 0 +} && +complete -F _nmcli nmcli + +# ex: ts=4 sw=4 et filetype=sh diff --git a/test/completion/nmcli.exp b/test/completion/nmcli.exp new file mode 100644 index 00000000..816468f7 --- /dev/null +++ b/test/completion/nmcli.exp @@ -0,0 +1 @@ +assert_source_completions nmcli diff --git a/test/lib/completions/nmcli.exp b/test/lib/completions/nmcli.exp new file mode 100644 index 00000000..b891f45e --- /dev/null +++ b/test/lib/completions/nmcli.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "nmcli " +sync_after_int + + +teardown -- cgit v1.2.1 From 1c362f4c99eea0ae32ffb6f006f71d1bfb18bc78 Mon Sep 17 00:00:00 2001 From: Igor Murzov Date: Wed, 5 Sep 2012 15:34:56 +0400 Subject: cppcheck: Add new standards to --std option. These were introduced in cppcheck-1.56. --- completions/cppcheck | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/completions/cppcheck b/completions/cppcheck index bcf937bb..2ee5359b 100644 --- a/completions/cppcheck +++ b/completions/cppcheck @@ -40,7 +40,8 @@ _cppcheck() return ;; --std) - COMPREPLY=( $( compgen -W 'c99 c++11 posix' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'c89 c99 c11 c++03 c++11 posix' \ + -- "$cur" ) ) return ;; --platform) -- cgit v1.2.1 From b28d7108d3677c61bd01c51ccee8bb1cf9e3bfba Mon Sep 17 00:00:00 2001 From: Tristan Wibberley Date: Mon, 27 Aug 2012 14:17:28 +0100 Subject: make: convert make completion to use smarter parser --- completions/make | 71 ++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 10 deletions(-) diff --git a/completions/make b/completions/make index aa19b242..eac0ac45 100644 --- a/completions/make +++ b/completions/make @@ -1,11 +1,66 @@ # bash completion for GNU make -*- shell-script -*- +function _make_target_extract_script() +{ + local prefix=$(printf "%s\n" "$1" | sed 's/[][\.*^$(){}?+|/]/\\&/g') + + cat <