From 7093e8301852c0924dd94861e0d7ac47665bc761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 25 Dec 2018 14:26:29 +0200 Subject: [PATCH 0001/1094] test: Fix _count_args test_7 to test intended case --- test/t/unit/test_unit_count_args.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/t/unit/test_unit_count_args.py b/test/t/unit/test_unit_count_args.py index dab29390ddc..94ba9151c43 100644 --- a/test/t/unit/test_unit_count_args.py +++ b/test/t/unit/test_unit_count_args.py @@ -39,7 +39,7 @@ def test_6(self, bash): assert output == "2" def test_7(self, bash): - """a b -c| d e should set args to 2""" - output = self._test(bash, "(a b -c d e)", 4, "a b -c d e", 6, + """a b -c d e| with -c arg excluded should set args to 2""" + output = self._test(bash, "(a b -c d e)", 4, "a b -c d e", 10, arg='"" "@(-c|--foo)"') assert output == "2" From 3809d9558f2af6c63b675a1385f008f0ad3af388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 25 Dec 2018 14:51:43 +0200 Subject: [PATCH 0002/1094] _count_args: Add 3rd arg for treating option-like things as args --- bash_completion | 6 ++++-- test/t/unit/test_unit_count_args.py | 13 +++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/bash_completion b/bash_completion index fd6f1f6c6d5..bb3eecd12e2 100644 --- a/bash_completion +++ b/bash_completion @@ -1356,6 +1356,7 @@ _get_first_arg() # @param $1 chars Characters out of $COMP_WORDBREAKS which should # NOT be considered word breaks. See __reassemble_comp_words_by_ref. # @param $2 glob Options whose following argument should not be counted +# @param $3 glob Options that should be counted as args _count_args() { local i cword words @@ -1363,8 +1364,9 @@ _count_args() args=1 for (( i=1; i < cword; i++ )); do - if [[ ${words[i]} != -* && ${words[i-1]} != $2 ]]; then - args=$(($args+1)) + if [[ ${words[i]} != -* && ${words[i-1]} != $2 || + ${words[i]} == $3 ]]; then + args=$(($args+1)) fi done } diff --git a/test/t/unit/test_unit_count_args.py b/test/t/unit/test_unit_count_args.py index 94ba9151c43..f458fee6458 100644 --- a/test/t/unit/test_unit_count_args.py +++ b/test/t/unit/test_unit_count_args.py @@ -43,3 +43,16 @@ def test_7(self, bash): output = self._test(bash, "(a b -c d e)", 4, "a b -c d e", 10, arg='"" "@(-c|--foo)"') assert output == "2" + + def test_8(self, bash): + """a -b -c d e| with -c arg excluded + and -b included should set args to 1""" + output = self._test(bash, "(a -b -c d e)", 4, "a -b -c d e", 11, + arg='"" "@(-c|--foo)" "-[b]"') + assert output == "2" + + def test_9(self, bash): + """a -b -c d e| with -b included should set args to 3""" + output = self._test(bash, "(a -b -c d e)", 4, "a -b -c d e", 11, + arg='"" "" "-b"') + assert output == "3" From 75ec298eaae391258da9418a55d3d47d855e5e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 25 Dec 2018 14:53:26 +0200 Subject: [PATCH 0003/1094] chmod: Fix file completion after modes starting with a dash --- completions/chmod | 7 +++++-- test/t/test_chmod.py | 8 ++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/completions/chmod b/completions/chmod index a3b50afd576..e3fb4dfc4f4 100644 --- a/completions/chmod +++ b/completions/chmod @@ -17,7 +17,10 @@ _chmod() $split && return - if [[ $cur == -* ]]; then + # Adapted from coreutils 8.28 chmod man page + local modearg="-@(+(*([rwxXst])|[ugo])|+([0-7]))" + + if [[ $cur == -* && $cur != $modearg ]]; then local opts=$( _parse_help "$1" ) [[ $opts ]] || opts=$( _parse_usage "$1" ) COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) @@ -26,7 +29,7 @@ _chmod() fi local args - _count_args + _count_args "" "" "$modearg" case $args in 1) ;; # mode diff --git a/test/t/test_chmod.py b/test/t/test_chmod.py index 77490eafa1c..19c661a36fe 100644 --- a/test/t/test_chmod.py +++ b/test/t/test_chmod.py @@ -15,3 +15,11 @@ def test_2(self, completion): @pytest.mark.complete("chmod -") def test_3(self, completion): assert completion.list + + @pytest.mark.complete("chmod -x ") + def test_4(self, completion): + assert completion.list + + @pytest.mark.complete("chmod -77 ") + def test_5(self, completion): + assert completion.list From 3e9011aa012ef349d499f8ab96b019fe6b21e09a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 25 Dec 2018 14:53:48 +0200 Subject: [PATCH 0004/1094] .gitignore: Add pytestdebug.log --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 00489c94dfb..d6041b1989f 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ bash-completion-config.cmake bash-completion-config-version.cmake __pycache__/ .pytest_cache/ +pytestdebug.log From 76549bb4e56bb4f968d686da52ca8b1ea46754a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 25 Dec 2018 14:54:50 +0200 Subject: [PATCH 0005/1094] sysctl: Treat -f as alias for -p/--load --- completions/sysctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/sysctl b/completions/sysctl index 2c3893b2838..a97f20905cd 100644 --- a/completions/sysctl +++ b/completions/sysctl @@ -9,7 +9,7 @@ _sysctl() --help|--version|--pattern|-!(-*)[hVr]) return ;; - --load|-!(-*)p) + --load|-!(-*)[pf]) _filedir conf return ;; From 3556fcbf478cbfe1ea631a98267056bb8a460240 Mon Sep 17 00:00:00 2001 From: ovf Date: Fri, 21 Dec 2018 22:56:23 +0000 Subject: [PATCH 0006/1094] xrandr: match the output name exactly for --mode in the case of a earlier output name being a substring of a later one, the wrong mode list would be picked up. (e.g. eDP1 followed by DP1). --- completions/xrandr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/xrandr b/completions/xrandr index 841904a502b..b2b85cce14e 100644 --- a/completions/xrandr +++ b/completions/xrandr @@ -25,7 +25,7 @@ _xrandr() fi done if [[ $output ]]; then - local modes=$( "$1" | command sed -e "1,/$output/ d" \ + local modes=$( "$1" | command sed -e "1,/^$output / d" \ -e "/connected/,$ d" \ -e "s/\([^[:space:]]\)[[:space:]].*/\1/" ) COMPREPLY=( $( compgen -W "$modes" -- "$cur" ) ) From a269a603207f5bf7b3a9eb17b8abeeb2159f159e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 29 Dec 2018 17:20:28 +0200 Subject: [PATCH 0007/1094] chmod: Fix "-" completion Broken in 75ec298eaae391258da9418a55d3d47d855e5e9e --- completions/chmod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/chmod b/completions/chmod index e3fb4dfc4f4..d8660473e22 100644 --- a/completions/chmod +++ b/completions/chmod @@ -18,7 +18,7 @@ _chmod() $split && return # Adapted from coreutils 8.28 chmod man page - local modearg="-@(+(*([rwxXst])|[ugo])|+([0-7]))" + local modearg="-@(@(+([rwxXst])|[ugo])|+([0-7]))" if [[ $cur == -* && $cur != $modearg ]]; then local opts=$( _parse_help "$1" ) From ec630f50d62eb5599dd5c882da75681b69bf5608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 31 Dec 2018 13:03:02 +0200 Subject: [PATCH 0008/1094] _xspecs: Simplify bash version check --- bash_completion | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bash_completion b/bash_completion index bb3eecd12e2..500a3e75e3f 100644 --- a/bash_completion +++ b/bash_completion @@ -1898,8 +1898,7 @@ complete -F _longopt a2ps awk base64 bash bc bison cat chroot colordiff cp \ texindex touch tr uname unexpand uniq units vdir wc who # declare only knows -g in bash >= 4.2. -if [[ ${BASH_VERSINFO[0]} -gt 4 || - ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -ge 2 ]]; then +if [[ ${BASH_VERSINFO[0]} -gt 4 || ${BASH_VERSINFO[1]} -ge 2 ]]; then declare -Ag _xspecs else declare -A _xspecs From a4924148f0c846cb8640fbc45e1a466058a16744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 31 Dec 2018 13:12:47 +0200 Subject: [PATCH 0009/1094] test: Remove some no longer used old test suite code --- test/lib/library.exp | 72 -------------------------------------------- test/lib/library.sh | 28 ----------------- 2 files changed, 100 deletions(-) diff --git a/test/lib/library.exp b/test/lib/library.exp index c6a405476a9..171b7c65816 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -508,39 +508,6 @@ proc assert_env_unmodified {{sed ""} {file ""} {diff ""}} { } -# Make sure the specified command executed from within Tcl/Expect. -# Fail the test with status UNSUPPORTED if Tcl fails with error "POSIX/ENOENT -# (No such file or directory)", or with the given Tcl failure status command -# (default "unresolved") if other error occurs. -# NOTE: Further tests are assumed if executing the command is successful. The -# test isn't immediately declared to have PASSED if the command is -# executed successful. -# @param string $command -# @param string $stdout (optional) Reference to variable to hold stdout. -# @param string $test (optional) Test title -# @param string $failcmd (optional, default "unresolved") Failure command -# @see assert_bash_exec() -proc assert_exec {cmd {stdout ''} {test ''} {failcmd "unresolved"}} { - if {$test == ""} {set test "$cmd should execute successfully"} - upvar $stdout results - set status [catch {eval exec $cmd} results] - if {$status == 0} { - set result true - } else { - set result false - # Command not found (POSIX/ENOENT = no such file or directory)? - if {[lindex $::errorCode 0] == "POSIX" && [lindex $::errorCode 1] == "ENOENT"} { - # Yes, command not found; - # Indicate test is unsupported - unsupported "$test" - } else { - $failcmd "$test" - } - } - return $result -} - - # Check that no completion is attempted on a certain command. # Params: # @cmd The command to attempt to complete. @@ -584,24 +551,6 @@ proc assert_no_output {{cmd} {test ""} {prompt /@}} { } -# Check that ~part completes to ~full/ if home dir exists. -# @param string $cmd The command to attempt home dir completion for. -# @param string $test Optional parameter with test name. -# @param string $prompt (optional) Bash prompt. Default is "/@" -proc assert_complete_homedir {{cmd} {test ""} {prompt /@}} { - if {[string length $test] == 0} { - set test "$cmd should complete ~part to ~full/ if home dir exists" - } - assert_bash_exec {for u in $(compgen -u); do \ - eval test -d ~$u && echo $u; unset u; done} {} /@ users - if {![find_unique_completion_pair $users part full]} { - untested "Not running, no suitable test user found: $test" - } else { - assert_complete "~$full/" "$cmd ~$part" $test -nospace - } -} - - # Source/run file with additional tests if completion for the specified command # is installed in bash, and the command is available. # @param string $command Command to check completion availability for. @@ -791,27 +740,6 @@ proc match_items {items {args {}}} { } - -# Get real command. -# - arg: $1 Command -# - return: Command found, empty string if not found -proc realcommand {cmd} { - set result "" - if [string length [set path [auto_execok $cmd]]] { - if {[string length [auto_execok realpath]]} { - set result [exec realpath $path] - } elseif {[string length [auto_execok greadlink]]} { - set result [exec greadlink -f $path] - } elseif {[string length [auto_execok readlink]]} { - set result [exec readlink -f $path] - } else { - set result $path - } - } - return $result -} - - # Generate filename to save environment to. # @param string $file File-basename to save environment to. If the file has a # `.exp' suffix, it is removed. E.g.: diff --git a/test/lib/library.sh b/test/lib/library.sh index 0a671595359..ed5a85d4538 100644 --- a/test/lib/library.sh +++ b/test/lib/library.sh @@ -2,7 +2,6 @@ # @param $1 Char to add to $COMP_WORDBREAKS -# @see remove_comp_wordbreak_char() add_comp_wordbreak_char() { [[ "${COMP_WORDBREAKS//[^$1]}" ]] || COMP_WORDBREAKS+=$1 } # add_comp_wordbreak_char() @@ -37,30 +36,3 @@ echo_array() { local name=$1[@] printf "%s\n" "${!name}" | sort } # echo_array() - - -# Check if current bash version meets specified minimum -# @param $1 (integer) Major version number -# @param $2 (integer) Minor version number -# @param $3 (integer) Patch level -# @return 0 if success, > 0 if not -is_bash_version_minimal() { - [[ ( - ${BASH_VERSINFO[0]} -gt $1 - ) || ( - ${BASH_VERSINFO[0]} -eq $1 && - ${BASH_VERSINFO[1]} -gt $2 - ) || ( - ${BASH_VERSINFO[0]} -eq $1 && - ${BASH_VERSINFO[1]} -eq $2 && - ${BASH_VERSINFO[2]} -ge $3 - ) - ]] -} # is_bash_version_minimal() - - -# @param $1 Char to remove from $COMP_WORDBREAKS -# @see add_comp_wordbreak_char() -remove_comp_wordbreak_char() { - COMP_WORDBREAKS=${COMP_WORDBREAKS//$1} -} # remove_comp_wordbreak_char() From 9b4098f748302568ff8c014f634fa822e962f029 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Thu, 1 Nov 2018 11:12:18 +0100 Subject: [PATCH 0010/1094] tshark: Support preferences (-o) completion with memoization Support both completion of `-o tcp....` and `-otcp....`. Memoize the tshark output since it can take 1 second with ASAN+Debug. _tshark_prefs is 28190 bytes for tshark v2.9.0rc0-2375-gc672124881. --- completions/tshark | 28 ++++++++++++++++++++++++++-- test/t/test_tshark.py | 9 +++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/completions/tshark b/completions/tshark index 3deb2c693bb..3c0ad288a64 100644 --- a/completions/tshark +++ b/completions/tshark @@ -2,10 +2,34 @@ _tshark() { - local cur prev words cword + local cur prev words cword prefix _init_completion -n : || return - case $prev in + case $cur in + -o*) + prefix=-o + ;; + esac + + case ${prefix:-$prev} in + --*) + # Fallback to completion of long options below. + ;; + -o*) + if [[ $cur == *:* ]]; then + cur=${cur#*:} + _filedir + else + [ -n "$_tshark_prefs" ] || + _tshark_prefs="$( "$1" -G defaultprefs | command \ + sed -ne 's/^#\{0,1\}\([a-z0-9_.-]\{1,\}:\).*/\1/p' | + tr '\n' ' ' )" + COMPREPLY=( $( compgen -P "$prefix" -W "$_tshark_prefs" \ + -- "${cur:${#prefix}}" ) ) + [[ $COMPREPLY == *: ]] && compopt -o nospace + fi + return + ;; -*[fsBDLcRNdCeEzhvoK]) return ;; diff --git a/test/t/test_tshark.py b/test/t/test_tshark.py index ce18cb1ddb0..61da7f964df 100644 --- a/test/t/test_tshark.py +++ b/test/t/test_tshark.py @@ -1,6 +1,7 @@ import pytest +@pytest.mark.bashcomp(ignore_env=r"^\+_tshark_prefs=") class TestTshark: @pytest.mark.complete("tshark -") @@ -14,3 +15,11 @@ def test_2(self, completion): @pytest.mark.complete("tshark -O foo,htt") def test_3(self, completion): assert completion.list + + @pytest.mark.complete("tshark -o tcp") + def test_4(self, completion): + assert "tcp.desegment_tcp_streams:" in completion.list + + @pytest.mark.complete("tshark -otcp") + def test_5(self, completion): + assert "-otcp.desegment_tcp_streams:" in completion.list From 50f52f77cf5c5339dfe7e1c3ff2991ea4a912c59 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 2 Jan 2019 15:17:53 +0100 Subject: [PATCH 0011/1094] tshark: fix completion of -Xlua_script option Treat "-Xlua_script" as "-X lua_script:". --- completions/tshark | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/completions/tshark b/completions/tshark index 3c0ad288a64..d359ecce240 100644 --- a/completions/tshark +++ b/completions/tshark @@ -9,6 +9,9 @@ _tshark() -o*) prefix=-o ;; + -X*) + prefix=-X + ;; esac case ${prefix:-$prev} in @@ -103,11 +106,12 @@ _tshark() return ;; -*X) - if [[ $cur == lua_script:* ]]; then + if [[ ${cur:${#prefix}} == lua_script:* ]]; then cur=${cur#*:} _filedir lua else - COMPREPLY=( $( compgen -W 'lua_script:' -- "$cur" ) ) + COMPREPLY=( $( compgen -P "$prefix" -W 'lua_script:' -- \ + "${cur:${#prefix}}" ) ) [[ $COMPREPLY == *: ]] && compopt -o nospace fi return From 5c73b7948d924d48e84ea67000fdb7b07970f06b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 4 Jan 2019 08:04:09 +0200 Subject: [PATCH 0012/1094] test/t: Avoid trailing backslash in Makefile.am's to appease automake --- test/generate | 11 +++++++---- test/t/Makefile.am | 2 +- test/t/unit/Makefile.am | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/test/generate b/test/generate index 85884ca4a0b..b32813321b8 100755 --- a/test/generate +++ b/test/generate @@ -42,13 +42,16 @@ while read -r line; do if [[ $in_extra_dist ]]; then if [[ $line != $'\t'* ]]; then if [[ ! $added ]]; then - echo -e "\ttest_$file.py \\" + echo -e "\ttest_$file.py" added=true fi in_extra_dist= - elif [[ ! $added && $line > $'\t'test_$file.py ]]; then - echo -e "\ttest_$file.py \\" - added=true + else + [[ $line == *\\ ]] || line="$line \\" + if [[ ! $added && $line > $'\t'test_$file.py ]]; then + echo -e "\ttest_$file.py \\" + added=true + fi fi echo "$line" else diff --git a/test/t/Makefile.am b/test/t/Makefile.am index d8603c364d9..015ce0ca7f7 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -659,6 +659,6 @@ EXTRA_DIST = \ test_yum_arch.py \ test_yum.py \ test_zopflipng.py \ - test_zopfli.py \ + test_zopfli.py all: diff --git a/test/t/unit/Makefile.am b/test/t/unit/Makefile.am index 3250e7648d1..6e273163623 100644 --- a/test/t/unit/Makefile.am +++ b/test/t/unit/Makefile.am @@ -10,6 +10,6 @@ EXTRA_DIST = \ test_unit_ip_addresses.py \ test_unit_parse_help.py \ test_unit_parse_usage.py \ - test_unit_tilde.py \ + test_unit_tilde.py all: From 698ef1dae56f366c729dd5c46cafc49e9fedb965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 4 Jan 2019 08:09:12 +0200 Subject: [PATCH 0013/1094] build: Include test/t in dist tarball Closes #272 --- configure.ac | 2 ++ test/Makefile.am | 2 ++ 2 files changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index 4dfc11f8f6c..de9f97646d3 100644 --- a/configure.ac +++ b/configure.ac @@ -11,5 +11,7 @@ completions/Makefile doc/Makefile helpers/Makefile test/Makefile +test/t/Makefile +test/t/unit/Makefile ]) AC_OUTPUT diff --git a/test/Makefile.am b/test/Makefile.am index 483b859a6d6..9f791204bd5 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,6 +1,8 @@ DEJATOOL = completion install unit AM_RUNTESTFLAGS = --outdir log --ignore $(PACKAGE).log +SUBDIRS = t + EXTRA_DIST = completion \ config \ fixtures \ From a6916d682f5ded8e99c7918e27d6105e82cc7591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 4 Jan 2019 17:21:48 +0200 Subject: [PATCH 0014/1094] test: Clean up and docker-ignore __pycache__ dirs --- .dockerignore | 1 + test/t/Makefile.am | 3 +++ test/t/unit/Makefile.am | 3 +++ 3 files changed, 7 insertions(+) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000000..61f2dc9f84d --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +**/__pycache__/ diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 015ce0ca7f7..36e61c6b5cd 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -662,3 +662,6 @@ EXTRA_DIST = \ test_zopfli.py all: + +clean-local: + $(RM) -R __pycache__ diff --git a/test/t/unit/Makefile.am b/test/t/unit/Makefile.am index 6e273163623..ca5dbcc4ad1 100644 --- a/test/t/unit/Makefile.am +++ b/test/t/unit/Makefile.am @@ -13,3 +13,6 @@ EXTRA_DIST = \ test_unit_tilde.py all: + +clean-local: + $(RM) -R __pycache__ From 3780c802fa6bdc915c4e667c003189c22d0f68bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 4 Jan 2019 17:39:38 +0200 Subject: [PATCH 0015/1094] test: Skip ifup options test if it doesn't grok --help, not in CI --- test/t/test_ifup.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/t/test_ifup.py b/test/t/test_ifup.py index 505f632d93b..9ef5c119256 100644 --- a/test/t/test_ifup.py +++ b/test/t/test_ifup.py @@ -11,9 +11,7 @@ class TestIfup: def test_1(self, completion): assert completion.list - @pytest.mark.xfail(bool(os.environ.get("CI")), - reason="Probably fails in CI") - @pytest.mark.complete("ifup --") + @pytest.mark.complete("ifup --", skipif="! ifup --help &>/dev/null") def test_2(self, completion): assert completion.list From 5af8f759b0ab7625e275873321db322c594bd750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 4 Jan 2019 17:44:30 +0200 Subject: [PATCH 0016/1094] test: Mark some xfails based on if in docker instead of in CI Makes them apply better in local docker runs. --- test/t/conftest.py | 4 ++++ test/t/test_arp.py | 8 ++++---- test/t/test_ifdown.py | 7 +++---- test/t/test_ifup.py | 7 +++---- test/t/test_make.py | 9 +++++---- test/t/test_man.py | 5 +++-- 6 files changed, 22 insertions(+), 18 deletions(-) diff --git a/test/t/conftest.py b/test/t/conftest.py index 24956dd7a95..6297c1068d8 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -344,6 +344,10 @@ def completion(request, bash: pexpect.spawn) -> CompletionResult: return assert_complete(bash, marker.args[0], **marker.kwargs) +def in_docker() -> bool: + return os.path.exists("/.dockerenv") + + class TestUnitBase: def _test_unit(self, func, bash, diff --git a/test/t/test_arp.py b/test/t/test_arp.py index 0c9c2aa1f2a..05e7f9d26ed 100644 --- a/test/t/test_arp.py +++ b/test/t/test_arp.py @@ -1,12 +1,12 @@ -import os - import pytest +from conftest import in_docker + class TestArp: - @pytest.mark.xfail(bool(os.environ.get("CI")), - reason="Probably fails in CI") + @pytest.mark.xfail(in_docker(), reason="Probably fails in docker") + @pytest.mark.complete("arp ") def test_1(self, completion): assert completion.list diff --git a/test/t/test_ifdown.py b/test/t/test_ifdown.py index 356a5a6bb9f..53b4e585175 100644 --- a/test/t/test_ifdown.py +++ b/test/t/test_ifdown.py @@ -1,12 +1,11 @@ -import os - import pytest +from conftest import in_docker + class TestIfdown: - @pytest.mark.xfail(bool(os.environ.get("CI")), - reason="Probably fails in CI") + @pytest.mark.xfail(in_docker(), reason="Probably fails in docker") @pytest.mark.complete("ifdown ") def test_1(self, completion): assert completion.list diff --git a/test/t/test_ifup.py b/test/t/test_ifup.py index 9ef5c119256..b09c60d5b6c 100644 --- a/test/t/test_ifup.py +++ b/test/t/test_ifup.py @@ -1,12 +1,11 @@ -import os - import pytest +from conftest import in_docker + class TestIfup: - @pytest.mark.xfail(bool(os.environ.get("CI")), - reason="Probably fails in CI") + @pytest.mark.xfail(in_docker(), reason="Probably fails in docker") @pytest.mark.complete("ifup ") def test_1(self, completion): assert completion.list diff --git a/test/t/test_make.py b/test/t/test_make.py index 9f5fbcce88e..c36b651a695 100644 --- a/test/t/test_make.py +++ b/test/t/test_make.py @@ -2,6 +2,8 @@ import pytest +from conftest import in_docker + class TestMake: @@ -34,10 +36,9 @@ def test_6(self, bash, completion): "all clean extra_makefile install sample".split() os.remove("%s/make/%s" % (bash.cwd, "extra_makefile")) - @pytest.mark.xfail( - bool(os.environ.get("CI")) and os.environ.get("DIST") == "centos6", - reason="Fails for some unknown reason on CentOS 6, even though " - "the behavior appears to be correct") + @pytest.mark.xfail(in_docker() and os.environ.get("DIST") == "centos6", + reason="Fails for some unknown reason on CentOS 6, " + "even though the behavior appears to be correct") @pytest.mark.complete("make .cache/.", cwd="make") def test_7(self, bash, completion): assert completion.list == ".1 .2".split() diff --git a/test/t/test_man.py b/test/t/test_man.py index 1379f8efde2..159c7c5af03 100644 --- a/test/t/test_man.py +++ b/test/t/test_man.py @@ -2,6 +2,8 @@ import pytest +from conftest import in_docker + @pytest.mark.bashcomp(ignore_env=r"^[+-]MANPATH=") class TestMan: @@ -22,8 +24,7 @@ def test_2(self, completion): def test_3(self, completion): assert completion.list == ["man/quux.8"] - @pytest.mark.xfail(bool(os.environ.get("CI")) and - os.environ.get("DIST") == "centos6", + @pytest.mark.xfail(in_docker() and os.environ.get("DIST") == "centos6", reason="TODO: Fails in CentOS for some reason, unknown " "how to trigger same behavior as tests show (is " "different and correct when tried manually, but here " From 8bea1ec8f0e8a708bd22be5d7eddcdf37a19fcae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 7 Jan 2019 22:48:28 +0200 Subject: [PATCH 0017/1094] inotifywait: New completion --- completions/Makefile.am | 1 + completions/inotifywait | 34 ++++++++++++++++++++++++++++++++++ test/t/Makefile.am | 1 + test/t/test_inotifywait.py | 16 ++++++++++++++++ 4 files changed, 52 insertions(+) create mode 100644 completions/inotifywait create mode 100644 test/t/test_inotifywait.py diff --git a/completions/Makefile.am b/completions/Makefile.am index bccccefb64e..a70258be2e9 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -160,6 +160,7 @@ bashcomp_DATA = 2to3 \ ifup \ info \ inject \ + inotifywait \ insmod \ installpkg \ interdiff \ diff --git a/completions/inotifywait b/completions/inotifywait new file mode 100644 index 00000000000..a18d78f4e35 --- /dev/null +++ b/completions/inotifywait @@ -0,0 +1,34 @@ +# bash completion for inotifywait(1) -*- shell-script -*- + +_inotifywait() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --help|--exclude|--excludei|--format|--timefmt|--timeout|-!(-*)[ht]) + return + ;; + --fromfile|--outfile|-!(-*)o) + _filedir + return + ;; + --event|-!(-*)e) + COMPREPLY=( $( compgen -W "$( $1 --help 2>/dev/null | \ + sed -e '/^Events:/,/^[^ \t]/!d' \ + -ne 's/^[ \t]\{1,\}\([^ \t]\{1,\}\)[ \t].*/\1/p' )" \ + -- "$cur" ) ) + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + return + fi + + _filedir +} && +complete -F _inotifywait inotifywait + +# ex: filetype=sh diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 36e61c6b5cd..19f24500c33 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -232,6 +232,7 @@ EXTRA_DIST = \ test_import.py \ test_info.py \ test_inject.py \ + test_inotifywait.py \ test_insmod.py \ test_installpkg.py \ test_interdiff.py \ diff --git a/test/t/test_inotifywait.py b/test/t/test_inotifywait.py new file mode 100644 index 00000000000..97c44fa5558 --- /dev/null +++ b/test/t/test_inotifywait.py @@ -0,0 +1,16 @@ +import pytest + + +class TestInotifywait: + + @pytest.mark.complete("inotifywait ") + def test_1(self, completion): + assert completion.list + + @pytest.mark.complete("inotifywait --") + def test_2(self, completion): + assert completion.list + + @pytest.mark.complete("inotifywait -e ") + def test_3(self, completion): + assert completion.list From ebeecf872dc0925e34177f862c371ad6e4010f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 11 Jan 2019 23:16:11 +0200 Subject: [PATCH 0018/1094] _ip_addresses: Avoid completing ipv4 ones with -6 --- bash_completion | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bash_completion b/bash_completion index 500a3e75e3f..035fa1a7ea1 100644 --- a/bash_completion +++ b/bash_completion @@ -925,8 +925,7 @@ _ip_addresses() esac local PATH=$PATH:/sbin local addrs=$( { LC_ALL=C ifconfig -a || ip addr show; } 2>/dev/null | - command sed -ne \ - 's/.*addr:\([^[:space:]]*\).*/\1/p' -ne \ + command sed -e 's/[[:space:]]addr:/ /' -ne \ "s|.*inet$n[[:space:]]\{1,\}\([^[:space:]/]*\).*|\1|p" ) COMPREPLY+=( $( compgen -W "$addrs" -- "$cur" ) ) } From 186d47dff33c8c2deea2c903dcc82f251a3d9bd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 11 Jan 2019 23:17:42 +0200 Subject: [PATCH 0019/1094] test: Convert _ip_addresses unit tests to pytest+pexpect, extend some --- test/t/unit/test_unit_ip_addresses.py | 36 +++++++++++++++++++- test/unit/_ip_addresses.exp | 49 --------------------------- 2 files changed, 35 insertions(+), 50 deletions(-) delete mode 100644 test/unit/_ip_addresses.exp diff --git a/test/t/unit/test_unit_ip_addresses.py b/test/t/unit/test_unit_ip_addresses.py index 15ed3a45036..14688ea0048 100644 --- a/test/t/unit/test_unit_ip_addresses.py +++ b/test/t/unit/test_unit_ip_addresses.py @@ -1,10 +1,44 @@ import pytest -from conftest import assert_bash_exec +from conftest import assert_bash_exec, in_docker @pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+COMPREPLY=") class TestUnitIpAddresses: + @pytest.fixture(scope="class") + def functions(self, request, bash): + assert_bash_exec(bash, + "_ia() { local cur=$(_get_cword);unset COMPREPLY;" + "_ip_addresses; }") + assert_bash_exec(bash, "complete -F _ia ia") + assert_bash_exec(bash, + "_iaa() { local cur=$(_get_cword);unset COMPREPLY;" + "_ip_addresses -a; }") + assert_bash_exec(bash, "complete -F _iaa iaa") + assert_bash_exec(bash, + " _ia6() { local cur=$(_get_cword);unset COMPREPLY;" + "_ip_addresses -6; }") + assert_bash_exec(bash, "complete -F _ia6 ia6") + def test_1(self, bash): assert_bash_exec(bash, "_ip_addresses") + + @pytest.mark.complete("iaa ") + def test_2(self, functions, completion): + """_ip_addresses -a should complete ip addresses.""" + assert completion.list + assert all("." in x or ":" in x for x in completion.list) + + @pytest.mark.complete("ia ") + def test_3(self, functions, completion): + """_ip_addresses should complete ipv4 addresses.""" + assert completion.list + assert all("." in x for x in completion.list) + + @pytest.mark.xfail(in_docker(), reason="Probably fails in docker") + @pytest.mark.complete("ia6 ") + def test_4(self, functions, completion): + """_ip_addresses -6 should complete ipv6 addresses.""" + assert completion.list + assert all(":" in x for x in completion.list) diff --git a/test/unit/_ip_addresses.exp b/test/unit/_ip_addresses.exp deleted file mode 100644 index ab43313d5ca..00000000000 --- a/test/unit/_ip_addresses.exp +++ /dev/null @@ -1,49 +0,0 @@ -proc setup {} { - assert_bash_exec {unset COMPREPLY cur} - save_env - - assert_bash_exec { \ - _ia() { local cur=$(_get_cword);unset COMPREPLY;_ip_addresses; }; \ - complete -F _ia ia \ - } - assert_bash_exec { \ - _iaa() { local cur=$(_get_cword);unset COMPREPLY;_ip_addresses -a; }; \ - complete -F _iaa iaa \ - } - assert_bash_exec { \ - _ia6() { local cur=$(_get_cword);unset COMPREPLY;_ip_addresses -6; }; \ - complete -F _ia6 ia6 \ - } -} - -proc teardown {} { - assert_bash_exec {unset COMPREPLY cur} - assert_bash_exec {unset -f _ia _iaa _ia6} - assert_env_unmodified -} - -setup - - -# TODO: add/robustify conditions on expected failures or unsupported setups -# ...so that there's no need for junk like CI/DIST special-casing - -set test "_ip_addresses -a should complete ip addresses" -assert_complete_any "iaa " -sync_after_int - -set test "_ip_addresses should complete ipv4 addresses" -assert_complete_any "ia " -sync_after_int - -set test "_ip_addresses -6 should complete ipv6 addresses" -if {[info exists ::env(CI)] && - [info exists ::env(DIST)] && $::env(DIST) == "fedoradev"} { - unsupported $test -} else { - assert_complete_any "ia6 " -} -sync_after_int - - -teardown From 82a50b07719860a293c0dd12b53892ed3a86612d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 12 Jan 2019 12:54:27 +0200 Subject: [PATCH 0020/1094] inotifywait: Avoid some false positive event names --- completions/inotifywait | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/completions/inotifywait b/completions/inotifywait index a18d78f4e35..5d2e226ac54 100644 --- a/completions/inotifywait +++ b/completions/inotifywait @@ -14,9 +14,12 @@ _inotifywait() return ;; --event|-!(-*)e) + # Expecting line with "Events:", followed by ones starting with one + # tab. Word following the tab is event name, others are line + # wrapped explanations. COMPREPLY=( $( compgen -W "$( $1 --help 2>/dev/null | \ - sed -e '/^Events:/,/^[^ \t]/!d' \ - -ne 's/^[ \t]\{1,\}\([^ \t]\{1,\}\)[ \t].*/\1/p' )" \ + sed -e '/^Events:/,/^[^\t]/!d' \ + -ne 's/^[ \t]\([^ \t]\{1,\}\)[ \t].*/\1/p' )" \ -- "$cur" ) ) return ;; From cfa6432743b2107e4b7bba0ebe17a1dd8eac7ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 12 Jan 2019 15:58:13 +0200 Subject: [PATCH 0021/1094] inotifywait: Fix -e completion with BSD sed --- completions/inotifywait | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/completions/inotifywait b/completions/inotifywait index 5d2e226ac54..651d50095af 100644 --- a/completions/inotifywait +++ b/completions/inotifywait @@ -18,8 +18,8 @@ _inotifywait() # tab. Word following the tab is event name, others are line # wrapped explanations. COMPREPLY=( $( compgen -W "$( $1 --help 2>/dev/null | \ - sed -e '/^Events:/,/^[^\t]/!d' \ - -ne 's/^[ \t]\([^ \t]\{1,\}\)[ \t].*/\1/p' )" \ + sed -e '/^Events:/,/^[^'$'\t'']/!d' \ + -ne 's/^'$'\t''\([^ '$'\t'']\{1,\}\)[ '$'\t''].*/\1/p' )" \ -- "$cur" ) ) return ;; From 2aa57d13202f15bf057ff5134ee6a56686032211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 12 Jan 2019 19:15:10 +0200 Subject: [PATCH 0022/1094] inotifywatch: New completion, common with inotifywait --- completions/.gitignore | 1 + completions/Makefile.am | 5 +++++ completions/inotifywait | 28 +++++++++++++++++++--------- test/t/Makefile.am | 1 + test/t/test_inotifywatch.py | 16 ++++++++++++++++ 5 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 test/t/test_inotifywatch.py diff --git a/completions/.gitignore b/completions/.gitignore index 45c0a22e62c..06f8d013d38 100644 --- a/completions/.gitignore +++ b/completions/.gitignore @@ -83,6 +83,7 @@ ifdown ifquery ifstatus import +inotifywatch insmod.static iperf3 javac diff --git a/completions/Makefile.am b/completions/Makefile.am index a70258be2e9..be9b1a7ec25 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -566,6 +566,7 @@ CLEANFILES = \ ifquery \ ifstatus \ import \ + inotifywatch \ insmod.static \ iperf3 \ javac \ @@ -866,6 +867,10 @@ symlinks: $(targetdir) $(DATA) rm -f $(targetdir)/$$file && \ $(LN_S) info $(targetdir)/$$file ; \ done + for file in inotifywatch ; do \ + rm -f $(targetdir)/$$file && \ + $(LN_S) inotifywait $(targetdir)/$$file ; \ + done for file in insmod.static ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) insmod $(targetdir)/$$file ; \ diff --git a/completions/inotifywait b/completions/inotifywait index 651d50095af..2df4d75f0da 100644 --- a/completions/inotifywait +++ b/completions/inotifywait @@ -1,4 +1,15 @@ -# bash completion for inotifywait(1) -*- shell-script -*- +# bash completion for inotifywait(1) and inotifywatch(1) -*- shell-script -*- + +_inotifywait_events() +{ + # Expecting line with "Events:", followed by ones starting with one + # tab. Word following the tab is event name, others are line + # wrapped explanations. + COMPREPLY+=( $( compgen -W "$( $1 --help 2>/dev/null | \ + sed -e '/^Events:/,/^[^'$'\t'']/!d' \ + -ne 's/^'$'\t''\([^ '$'\t'']\{1,\}\)[ '$'\t''].*/\1/p' )" \ + -- "$cur" ) ) +} _inotifywait() { @@ -14,13 +25,12 @@ _inotifywait() return ;; --event|-!(-*)e) - # Expecting line with "Events:", followed by ones starting with one - # tab. Word following the tab is event name, others are line - # wrapped explanations. - COMPREPLY=( $( compgen -W "$( $1 --help 2>/dev/null | \ - sed -e '/^Events:/,/^[^'$'\t'']/!d' \ - -ne 's/^'$'\t''\([^ '$'\t'']\{1,\}\)[ '$'\t''].*/\1/p' )" \ - -- "$cur" ) ) + _inotifywait_events "$1" + return + ;; + --ascending|--descending) + COMPREPLY=( $( compgen -W 'total' -- "$cur" ) ) + _inotifywait_events "$1" return ;; esac @@ -32,6 +42,6 @@ _inotifywait() _filedir } && -complete -F _inotifywait inotifywait +complete -F _inotifywait inotifywait inotifywatch # ex: filetype=sh diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 19f24500c33..8a67797f127 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -233,6 +233,7 @@ EXTRA_DIST = \ test_info.py \ test_inject.py \ test_inotifywait.py \ + test_inotifywatch.py \ test_insmod.py \ test_installpkg.py \ test_interdiff.py \ diff --git a/test/t/test_inotifywatch.py b/test/t/test_inotifywatch.py new file mode 100644 index 00000000000..d842c5272b5 --- /dev/null +++ b/test/t/test_inotifywatch.py @@ -0,0 +1,16 @@ +import pytest + + +class TestInotifywatch: + + @pytest.mark.complete("inotifywatch ") + def test_1(self, completion): + assert completion.list + + @pytest.mark.complete("inotifywatch --") + def test_2(self, completion): + assert completion.list + + @pytest.mark.complete("inotifywatch -e ") + def test_3(self, completion): + assert len(completion.list) > 1 From b3a25cfe429b8c87d9194c2d9042349ba71979c9 Mon Sep 17 00:00:00 2001 From: Russell Davis <551404+russelldavis@users.noreply.github.com> Date: Mon, 9 Jul 2018 00:58:25 -0700 Subject: [PATCH 0023/1094] man: Fix completion when failglob option is enabled (#225) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified-by: Ville Skyttä --- completions/man | 3 +++ 1 file changed, 3 insertions(+) diff --git a/completions/man b/completions/man index d5fa50fcbe9..37af0817046 100644 --- a/completions/man +++ b/completions/man @@ -67,8 +67,11 @@ _man() manpath="${manpath//://*man$sect/ } ${manpath//://*cat$sect/ }" fi + local IFS=$' \t\n' reset=$( shopt -p failglob ); shopt -u failglob # redirect stderr for when path doesn't exist COMPREPLY=( $( eval command ls "$manpath" 2>/dev/null ) ) + $reset + # weed out directory path names and paths to man pages COMPREPLY=( ${COMPREPLY[@]##*/?(:)} ) # strip suffix from man pages From e56da98dac7188b72c4df420c82452c438119636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 12 Jan 2019 19:31:24 +0200 Subject: [PATCH 0024/1094] test: Add pre_cmds support for completion fixture --- test/t/conftest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/t/conftest.py b/test/t/conftest.py index 6297c1068d8..80269846f16 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -341,6 +341,8 @@ def completion(request, bash: pexpect.spawn) -> CompletionResult: marker = request.node.get_closest_marker("complete") if not marker: return CompletionResult("", []) + for pre_cmd in marker.kwargs.get("pre_cmds", []): + assert_bash_exec(bash, pre_cmd) return assert_complete(bash, marker.args[0], **marker.kwargs) From c1dd7f22995ba8c7c6064e47e2c557abdc2ddf78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 12 Jan 2019 19:31:48 +0200 Subject: [PATCH 0025/1094] test: Add man failglob test case --- test/t/test_man.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/t/test_man.py b/test/t/test_man.py index 159c7c5af03..8017bc3c87f 100644 --- a/test/t/test_man.py +++ b/test/t/test_man.py @@ -2,7 +2,7 @@ import pytest -from conftest import in_docker +from conftest import assert_bash_exec, in_docker @pytest.mark.bashcomp(ignore_env=r"^[+-]MANPATH=") @@ -62,3 +62,10 @@ def test_7(self, completion): "man bash-completion-testcas", env=dict(MANPATH=":%s" % manpath)) def test_8(self, completion): assert completion.list == ["bash-completion-testcase"] + + @pytest.mark.complete("man %s" % assumed_present, + cwd="shared/empty_dir", + pre_cmds=("shopt -s failglob",)) + def test_9(self, bash, completion): + assert self.assumed_present in completion.list + assert_bash_exec(bash, "shopt -u failglob") From 7d7032bfcfcd47f7ed3372c9c7ac95851d8402c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 13 Jan 2019 10:59:31 +0200 Subject: [PATCH 0026/1094] test: Rename completion.line to .output It can consist of multiple lines. --- test/t/conftest.py | 18 +++++++++--------- test/t/test_7z.py | 2 +- test/t/test_alias.py | 2 +- test/t/test_chown.py | 8 ++++---- test/t/test_chromium_browser.py | 2 +- test/t/test_firefox.py | 2 +- test/t/test_kcov.py | 2 +- test/t/test_ls.py | 2 +- test/t/test_mkdir.py | 7 ++++--- test/t/test_modinfo.py | 2 +- test/t/test_modprobe.py | 2 +- test/t/test_mount.py | 2 +- test/t/test_portupgrade.py | 2 +- test/t/test_sudo.py | 14 +++++++------- test/t/test_tar.py | 4 ++-- test/t/test_valgrind.py | 2 +- test/t/test_xgamma.py | 2 +- 17 files changed, 38 insertions(+), 37 deletions(-) diff --git a/test/t/conftest.py b/test/t/conftest.py index 80269846f16..56170511fab 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -264,7 +264,7 @@ def diff_env(before: List[str], after: List[str], ignore: str): CompletionResult = NamedTuple( - "CompletionResult", [("line", str), ("list", List[str])]) + "CompletionResult", [("output", str), ("list", List[str])]) def assert_complete( @@ -302,18 +302,18 @@ def assert_complete( pexpect.TIMEOUT, ]) if got == 0: - line = bash.before - if line.endswith(MAGIC_MARK): - line = bash.before[:-len(MAGIC_MARK)] + output = bash.before + if output.endswith(MAGIC_MARK): + output = bash.before[:-len(MAGIC_MARK)] result = CompletionResult( - line, - sorted(x for x in re.split(r" {2,}|\r\n", line) if x), + output, + sorted(x for x in re.split(r" {2,}|\r\n", output) if x), ) elif got == 2: - line = bash.match.group(1) + output = bash.match.group(1) result = CompletionResult( - line, - [shlex.split(cmd + line)[-1]], + output, + [shlex.split(cmd + output)[-1]], ) else: # TODO: warn about EOF/TIMEOUT? diff --git a/test/t/test_7z.py b/test/t/test_7z.py index 13ad0993346..97469b71aa2 100644 --- a/test/t/test_7z.py +++ b/test/t/test_7z.py @@ -15,7 +15,7 @@ def test_2(self, completion): @pytest.mark.complete(r"7z x -wa\ ", cwd="_filedir") def test_3(self, completion): assert completion.list == [r"-wa\ b/"] - assert not completion.line.endswith(" ") + assert not completion.output.endswith(" ") @pytest.mark.complete("7z x ", cwd="7z") def test_4(self, completion): diff --git a/test/t/test_alias.py b/test/t/test_alias.py index eb14fb4a3d0..ad852847229 100644 --- a/test/t/test_alias.py +++ b/test/t/test_alias.py @@ -21,4 +21,4 @@ def test_1(self, completion): @pytest.mark.complete("alias foo=") def test_2(self, completion): assert completion.list == ["foo='bar'"] - assert not completion.line.endswith(" ") + assert not completion.output.endswith(" ") diff --git a/test/t/test_chown.py b/test/t/test_chown.py index 5b2069b3a52..9e1a75d142b 100644 --- a/test/t/test_chown.py +++ b/test/t/test_chown.py @@ -31,7 +31,7 @@ def test_4(self, bash, part_full_user): part, full = part_full_user completion = assert_complete(bash, "chown %s" % part) assert completion.list == [full] - assert completion.line.endswith(" ") + assert completion.output.endswith(" ") def test_5(self, bash, part_full_user, part_full_group): _, user = part_full_user @@ -39,13 +39,13 @@ def test_5(self, bash, part_full_user, part_full_group): completion = assert_complete( bash, "chown %s:%s" % (user, partgroup)) assert completion.list == ["%s:%s" % (user, fullgroup)] - assert completion.line.endswith(" ") + assert completion.output.endswith(" ") def test_6(self, bash, part_full_group): part, full = part_full_group completion = assert_complete(bash, "chown dot.user:%s" % part) assert completion.list == ["dot.user:%s" % full] - assert completion.line.endswith(" ") + assert completion.output.endswith(" ") @pytest.mark.xfail # TODO check escaping, whitespace def test_7(self, bash, part_full_group): @@ -57,7 +57,7 @@ def test_7(self, bash, part_full_group): completion = assert_complete( bash, "chown %s%s" % (prefix, part)) assert completion.list == ["%s%s" % (prefix, full)] - assert completion.line.endswith(" ") + assert completion.output.endswith(" ") def test_8(self, bash, part_full_user, part_full_group): """Test giving up on degenerate cases instead of spewing junk.""" diff --git a/test/t/test_chromium_browser.py b/test/t/test_chromium_browser.py index 8f0bcebc4c5..a175b34b673 100644 --- a/test/t/test_chromium_browser.py +++ b/test/t/test_chromium_browser.py @@ -13,4 +13,4 @@ def test_1(self, completion): @pytest.mark.complete("chromium-browser -") def test_2(self, completion): assert completion.list - assert not completion.line.endswith(" ") + assert not completion.output.endswith(" ") diff --git a/test/t/test_firefox.py b/test/t/test_firefox.py index 5598121b9c3..8096abc7f16 100644 --- a/test/t/test_firefox.py +++ b/test/t/test_firefox.py @@ -10,4 +10,4 @@ def test_1(self, completion): @pytest.mark.complete("firefox -") def test_2(self, completion): assert completion.list - assert not completion.line.endswith(" ") + assert not completion.output.endswith(" ") diff --git a/test/t/test_kcov.py b/test/t/test_kcov.py index 123d5790674..124a22a85ee 100644 --- a/test/t/test_kcov.py +++ b/test/t/test_kcov.py @@ -10,7 +10,7 @@ def test_1(self, completion): @pytest.mark.complete("kcov --exclude-patter") def test_2(self, completion): assert completion.list == ["--exclude-pattern="] - assert completion.line.endswith("=") + assert completion.output.endswith("=") @pytest.mark.complete("kcov -l 42,") def test_3(self, completion): diff --git a/test/t/test_ls.py b/test/t/test_ls.py index d278662f710..9dd706d7cad 100644 --- a/test/t/test_ls.py +++ b/test/t/test_ls.py @@ -28,4 +28,4 @@ def test_3(self, bash): part, full = part_full completion = assert_complete(bash, "ls ~%s" % part) assert completion.list == ["~%s" % full] - assert completion.line.endswith(" ") + assert completion.output.endswith(" ") diff --git a/test/t/test_mkdir.py b/test/t/test_mkdir.py index c8c7dbd6824..3b42f3c3e8f 100644 --- a/test/t/test_mkdir.py +++ b/test/t/test_mkdir.py @@ -12,8 +12,9 @@ def test_1(self, completion): def test_2(self, completion): assert completion.list == ["bar bar.d/", "foo", "foo.d/"] - @pytest.mark.xfail # TODO: why path in completion.list, basename in .line? + # TODO: why path in completion.list, basename in .output? + @pytest.mark.xfail @pytest.mark.complete("mkdir shared/default/foo.d/") def test_3(self, completion): - assert completion.line == "foo" - assert completion.list == [completion.line] + assert completion.output == "foo" + assert completion.list == [completion.output] diff --git a/test/t/test_modinfo.py b/test/t/test_modinfo.py index 72a5c0f90a8..4dc61040f34 100644 --- a/test/t/test_modinfo.py +++ b/test/t/test_modinfo.py @@ -27,4 +27,4 @@ def test_3(self, completion): @pytest.mark.complete("modinfo /tm") def test_4(self, completion): assert completion.list - assert not completion.line.endswith(" ") + assert not completion.output.endswith(" ") diff --git a/test/t/test_modprobe.py b/test/t/test_modprobe.py index 371dff19caa..0ac2eaf3bea 100644 --- a/test/t/test_modprobe.py +++ b/test/t/test_modprobe.py @@ -31,4 +31,4 @@ def test_4(self, completion): @pytest.mark.complete("modprobe /tm") def test_5(self, completion): assert completion.list - assert not completion.line.endswith(" ") + assert not completion.output.endswith(" ") diff --git a/test/t/test_mount.py b/test/t/test_mount.py index f120257c9a9..2deb57489ee 100644 --- a/test/t/test_mount.py +++ b/test/t/test_mount.py @@ -14,7 +14,7 @@ def test_2(self, completion): @pytest.mark.complete("mount /dev/sda1 def", cwd="shared") def test_3(self, completion): assert completion.list == ["default/"] - assert not completion.line.endswith(" ") + assert not completion.output.endswith(" ") @pytest.mark.complete("mount mocksrv:/", env=dict(PATH="$PWD/mount/bin:$PATH")) diff --git a/test/t/test_portupgrade.py b/test/t/test_portupgrade.py index dc79a97b74a..11e99d46ff6 100644 --- a/test/t/test_portupgrade.py +++ b/test/t/test_portupgrade.py @@ -11,4 +11,4 @@ class TestPortupgrade: @pytest.mark.complete("portupgrade ") def test_1(self, completion): assert completion.list == "a b-c-d".split() - assert completion.line.endswith(" ") + assert completion.output.endswith(" ") diff --git a/test/t/test_sudo.py b/test/t/test_sudo.py index 669b40811f9..cfd63f66014 100644 --- a/test/t/test_sudo.py +++ b/test/t/test_sudo.py @@ -12,17 +12,17 @@ def test_1(self, completion): @pytest.mark.complete("sudo cd fo", cwd="shared/default") def test_2(self, completion): assert completion.list == ["foo.d/"] - assert not completion.line.endswith(" ") + assert not completion.output.endswith(" ") @pytest.mark.complete("sudo sh share") def test_3(self, completion): assert completion.list == ["shared/"] - assert not completion.line.endswith(" ") + assert not completion.output.endswith(" ") @pytest.mark.complete("sudo mount /dev/sda1 def", cwd="shared") def test_4(self, completion): assert completion.list == ["default/"] - assert not completion.line.endswith(" ") + assert not completion.output.endswith(" ") @pytest.mark.complete("sudo -e -u root bar foo", cwd="shared/default") def test_5(self, completion): @@ -32,7 +32,7 @@ def test_6(self, bash, part_full_user): part, full = part_full_user completion = assert_complete(bash, "sudo chown %s" % part) assert completion.list == [full] - assert completion.line.endswith(" ") + assert completion.output.endswith(" ") def test_7(self, bash, part_full_user, part_full_group): _, user = part_full_user @@ -40,13 +40,13 @@ def test_7(self, bash, part_full_user, part_full_group): completion = assert_complete( bash, "sudo chown %s:%s" % (user, partgroup)) assert completion.list == ["%s:%s" % (user, fullgroup)] - assert completion.line.endswith(" ") + assert completion.output.endswith(" ") def test_8(self, bash, part_full_group): part, full = part_full_group completion = assert_complete(bash, "sudo chown dot.user:%s" % part) assert completion.list == ["dot.user:%s" % full] - assert completion.line.endswith(" ") + assert completion.output.endswith(" ") @pytest.mark.xfail # TODO check escaping, whitespace def test_9(self, bash, part_full_group): @@ -58,7 +58,7 @@ def test_9(self, bash, part_full_group): completion = assert_complete( bash, "sudo chown %s%s" % (prefix, part)) assert completion.list == ["%s%s" % (prefix, full)] - assert completion.line.endswith(" ") + assert completion.output.endswith(" ") def test_10(self, bash, part_full_user, part_full_group): """Test giving up on degenerate cases instead of spewing junk.""" diff --git a/test/t/test_tar.py b/test/t/test_tar.py index d00d0b65259..6f8f81bdf44 100644 --- a/test/t/test_tar.py +++ b/test/t/test_tar.py @@ -81,12 +81,12 @@ def test_14(self, completion, gnu_tar): @pytest.mark.complete("tar --add-fil") def test_15(self, completion, gnu_tar): assert completion.list == ["--add-file="] - assert not completion.line.endswith(" ") + assert not completion.output.endswith(" ") @pytest.mark.complete("tar -cf /dev/null --posi") def test_16(self, completion, gnu_tar): assert completion.list == ["--posix"] - assert completion.line.endswith(" ") + assert completion.output.endswith(" ") @pytest.mark.complete("tar --owner=") def test_17(self, bash, completion, gnu_tar): diff --git a/test/t/test_valgrind.py b/test/t/test_valgrind.py index 2929db31ff9..3a39e3cd91f 100644 --- a/test/t/test_valgrind.py +++ b/test/t/test_valgrind.py @@ -21,7 +21,7 @@ def test_3(self, completion): @pytest.mark.complete("valgrind --tool=helgrind --history-l") def test_4(self, completion): assert "--history-level=" in completion.list - assert not completion.line.endswith(" ") + assert not completion.output.endswith(" ") @pytest.mark.complete(r"valgrind --log-file=v\ 0.log ./bin/", cwd="shared") def test_5(self, completion): diff --git a/test/t/test_xgamma.py b/test/t/test_xgamma.py index 02aed60b9c1..c1c47a016df 100644 --- a/test/t/test_xgamma.py +++ b/test/t/test_xgamma.py @@ -10,4 +10,4 @@ def test_1(self, completion): @pytest.mark.complete("xgamma -gam") def test_2(self, completion): assert completion.list == ["-gamma"] - assert completion.line.endswith(" ") + assert completion.output.endswith(" ") From c46536aa6e6e79764075800b5b747fea7e20bc2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 13 Jan 2019 13:47:33 +0200 Subject: [PATCH 0027/1094] test: Match Python's default locale unaware sort in bash setup --- test/t/conftest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/t/conftest.py b/test/t/conftest.py index 56170511fab..c14ca22a23a 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -91,6 +91,7 @@ def bash(request) -> pexpect.spawn: INPUTRC="%s/config/inputrc" % testdir, TERM="dumb", BASH_COMPLETION_COMPAT_DIR="%s/fixtures/shared/empty_dir" % testdir, + LC_COLLATE="C", # to match Python's default locale unaware sort )) # TODO set stty_init "columns 150" --> dimensions? needed in first place? From 0d9d375fed79651c8cd179df8bef032730506a5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 13 Jan 2019 14:14:33 +0200 Subject: [PATCH 0028/1094] test: Refactor/improve completion results checking --- test/t/conftest.py | 77 +++++++++++++++++++++++---- test/t/test_2to3.py | 2 +- test/t/test_7z.py | 12 ++--- test/t/test_a2ps.py | 2 +- test/t/test_a2x.py | 2 +- test/t/test_abook.py | 2 +- test/t/test_aclocal.py | 2 +- test/t/test_acpi.py | 2 +- test/t/test_acroread.py | 2 +- test/t/test_adb.py | 2 +- test/t/test_add_members.py | 2 +- test/t/test_alias.py | 6 +-- test/t/test_alpine.py | 2 +- test/t/test_animate.py | 2 +- test/t/test_ant.py | 8 +-- test/t/test_apache2ctl.py | 2 +- test/t/test_appdata_validate.py | 2 +- test/t/test_apt_build.py | 2 +- test/t/test_apt_cache.py | 2 +- test/t/test_apt_get.py | 4 +- test/t/test_aptitude.py | 2 +- test/t/test_arch.py | 2 +- test/t/test_arp.py | 4 +- test/t/test_arping.py | 4 +- test/t/test_arpspoof.py | 2 +- test/t/test_asciidoc.py | 2 +- test/t/test_aspell.py | 2 +- test/t/test_autoconf.py | 2 +- test/t/test_autoheader.py | 2 +- test/t/test_automake.py | 2 +- test/t/test_autoreconf.py | 2 +- test/t/test_autorpm.py | 2 +- test/t/test_autoscan.py | 2 +- test/t/test_autoupdate.py | 2 +- test/t/test_avctrl.py | 2 +- test/t/test_awk.py | 2 +- test/t/test_badblocks.py | 2 +- test/t/test_base64.py | 2 +- test/t/test_bash.py | 2 +- test/t/test_bc.py | 2 +- test/t/test_bind.py | 4 +- test/t/test_bison.py | 2 +- test/t/test_bk.py | 2 +- test/t/test_brctl.py | 2 +- test/t/test_btdownloadcurses_py.py | 2 +- test/t/test_btdownloadgui_py.py | 2 +- test/t/test_btdownloadheadless_py.py | 2 +- test/t/test_bts.py | 4 +- test/t/test_bzip2.py | 4 +- test/t/test_cal.py | 2 +- test/t/test_cancel.py | 2 +- test/t/test_cardctl.py | 2 +- test/t/test_cat.py | 2 +- test/t/test_cc.py | 2 +- test/t/test_ccache.py | 12 ++--- test/t/test_ccze.py | 8 +-- test/t/test_cd.py | 9 ++-- test/t/test_cdrecord.py | 2 +- test/t/test_cfagent.py | 2 +- test/t/test_cfrun.py | 2 +- test/t/test_chage.py | 2 +- test/t/test_change_pw.py | 2 +- test/t/test_check_db.py | 2 +- test/t/test_check_perms.py | 2 +- test/t/test_checksec.py | 2 +- test/t/test_chfn.py | 2 +- test/t/test_chgrp.py | 2 +- test/t/test_chkconfig.py | 4 +- test/t/test_chmod.py | 10 ++-- test/t/test_chown.py | 22 ++++---- test/t/test_chpasswd.py | 2 +- test/t/test_chromium_browser.py | 6 +-- test/t/test_chronyc.py | 4 +- test/t/test_chroot.py | 2 +- test/t/test_chrpath.py | 4 +- test/t/test_chsh.py | 4 +- test/t/test_ci.py | 2 +- test/t/test_ciptool.py | 2 +- test/t/test_civclient.py | 2 +- test/t/test_civserver.py | 2 +- test/t/test_cksfv.py | 2 +- test/t/test_cleanarch.py | 2 +- test/t/test_clisp.py | 2 +- test/t/test_clone_member.py | 2 +- test/t/test_co.py | 2 +- test/t/test_compare.py | 2 +- test/t/test_complete.py | 2 +- test/t/test_composite.py | 2 +- test/t/test_config_list.py | 2 +- test/t/test_configure.py | 4 +- test/t/test_conjure.py | 2 +- test/t/test_convert.py | 4 +- test/t/test_cowsay.py | 2 +- test/t/test_cp.py | 2 +- test/t/test_cpan2dist.py | 2 +- test/t/test_cpio.py | 4 +- test/t/test_cplusplus.py | 2 +- test/t/test_cppcheck.py | 14 ++--- test/t/test_createdb.py | 2 +- test/t/test_createuser.py | 2 +- test/t/test_crontab.py | 2 +- test/t/test_cryptsetup.py | 2 +- test/t/test_csplit.py | 2 +- test/t/test_curl.py | 8 +-- test/t/test_cut.py | 2 +- test/t/test_cvs.py | 6 +-- test/t/test_cvsps.py | 4 +- test/t/test_date.py | 2 +- test/t/test_dcop.py | 4 +- test/t/test_dd.py | 4 +- test/t/test_declare.py | 8 +-- test/t/test_deja_dup.py | 4 +- test/t/test_desktop_file_validate.py | 2 +- test/t/test_df.py | 2 +- test/t/test_dfutool.py | 2 +- test/t/test_dhclient.py | 2 +- test/t/test_dict.py | 2 +- test/t/test_diff.py | 2 +- test/t/test_dir.py | 2 +- test/t/test_display.py | 4 +- test/t/test_dmesg.py | 2 +- test/t/test_dnsspoof.py | 2 +- test/t/test_dot.py | 2 +- test/t/test_dpkg.py | 6 +-- test/t/test_dpkg_deb.py | 2 +- test/t/test_dpkg_reconfigure.py | 2 +- test/t/test_dpkg_source.py | 2 +- test/t/test_dropdb.py | 2 +- test/t/test_dropuser.py | 2 +- test/t/test_dselect.py | 4 +- test/t/test_dsniff.py | 2 +- test/t/test_du.py | 2 +- test/t/test_dumpdb.py | 2 +- test/t/test_dumpe2fs.py | 2 +- test/t/test_e2freefrag.py | 2 +- test/t/test_e2label.py | 2 +- test/t/test_ebtables.py | 2 +- test/t/test_ecryptfs_migrate_home.py | 2 +- test/t/test_eject.py | 2 +- test/t/test_enscript.py | 2 +- test/t/test_env.py | 2 +- test/t/test_eog.py | 2 +- test/t/test_ether_wake.py | 2 +- test/t/test_etherwake.py | 2 +- test/t/test_evince.py | 2 +- test/t/test_expand.py | 2 +- test/t/test_explodepkg.py | 2 +- test/t/test_export.py | 19 ++++--- test/t/test_faillog.py | 2 +- test/t/test_fbgs.py | 2 +- test/t/test_fbi.py | 2 +- test/t/test_feh.py | 12 ++--- test/t/test_file.py | 4 +- test/t/test_file_roller.py | 2 +- test/t/test_filefrag.py | 2 +- test/t/test_filesnarf.py | 2 +- test/t/test_find.py | 12 ++--- test/t/test_find_member.py | 2 +- test/t/test_finger.py | 2 +- test/t/test_fio.py | 6 +-- test/t/test_firefox.py | 6 +-- test/t/test_flake8.py | 6 +-- test/t/test_fmt.py | 2 +- test/t/test_fold.py | 2 +- test/t/test_freebsd_update.py | 2 +- test/t/test_freeciv.py | 2 +- test/t/test_freeciv_server.py | 2 +- test/t/test_function.py | 2 +- test/t/test_fusermount.py | 2 +- test/t/test_g4.py | 2 +- test/t/test_g77.py | 2 +- test/t/test_gcc.py | 2 +- test/t/test_gcj.py | 2 +- test/t/test_gcl.py | 2 +- test/t/test_gdb.py | 2 +- test/t/test_genaliases.py | 2 +- test/t/test_gendiff.py | 2 +- test/t/test_genisoimage.py | 2 +- test/t/test_geoiplookup.py | 2 +- test/t/test_getconf.py | 10 ++-- test/t/test_getent.py | 2 +- test/t/test_gkrellm.py | 2 +- test/t/test_gm.py | 8 +-- test/t/test_gmplayer.py | 2 +- test/t/test_gnatmake.py | 2 +- test/t/test_gnokii.py | 2 +- test/t/test_gnome_mplayer.py | 2 +- test/t/test_gnome_screenshot.py | 2 +- test/t/test_gpasswd.py | 2 +- test/t/test_gpc.py | 2 +- test/t/test_gperf.py | 2 +- test/t/test_gpg.py | 2 +- test/t/test_gpg2.py | 2 +- test/t/test_gpgv.py | 6 +-- test/t/test_gphoto2.py | 2 +- test/t/test_gplusplus.py | 2 +- test/t/test_gprof.py | 2 +- test/t/test_grep.py | 2 +- test/t/test_groupadd.py | 4 +- test/t/test_groupdel.py | 2 +- test/t/test_groupmems.py | 2 +- test/t/test_groupmod.py | 4 +- test/t/test_growisofs.py | 2 +- test/t/test_grpck.py | 4 +- test/t/test_grub.py | 2 +- test/t/test_gzip.py | 4 +- test/t/test_hciattach.py | 2 +- test/t/test_hciconfig.py | 2 +- test/t/test_hcitool.py | 2 +- test/t/test_hddtemp.py | 2 +- test/t/test_head.py | 2 +- test/t/test_hexdump.py | 2 +- test/t/test_hid2hci.py | 2 +- test/t/test_host.py | 2 +- test/t/test_hostname.py | 2 +- test/t/test_hping2.py | 2 +- test/t/test_hping3.py | 2 +- test/t/test_htop.py | 2 +- test/t/test_htpasswd.py | 8 +-- test/t/test_hunspell.py | 4 +- test/t/test_hwclock.py | 2 +- test/t/test_iconv.py | 4 +- test/t/test_id.py | 2 +- test/t/test_identify.py | 2 +- test/t/test_idn.py | 2 +- test/t/test_ifdown.py | 4 +- test/t/test_iftop.py | 2 +- test/t/test_ifup.py | 6 +-- test/t/test_import.py | 2 +- test/t/test_info.py | 4 +- test/t/test_inject.py | 2 +- test/t/test_inotifywait.py | 6 +-- test/t/test_inotifywatch.py | 6 +-- test/t/test_insmod.py | 2 +- test/t/test_installpkg.py | 8 +-- test/t/test_interdiff.py | 2 +- test/t/test_invoke_rc_d.py | 2 +- test/t/test_ionice.py | 2 +- test/t/test_ip.py | 4 +- test/t/test_iperf.py | 9 ++-- test/t/test_iperf3.py | 9 ++-- test/t/test_ipmitool.py | 2 +- test/t/test_ipsec.py | 2 +- test/t/test_iptables.py | 2 +- test/t/test_ipv6calc.py | 4 +- test/t/test_irb.py | 2 +- test/t/test_iscsiadm.py | 2 +- test/t/test_isort.py | 4 +- test/t/test_isql.py | 2 +- test/t/test_iwconfig.py | 2 +- test/t/test_iwlist.py | 2 +- test/t/test_iwpriv.py | 2 +- test/t/test_iwspy.py | 2 +- test/t/test_jar.py | 2 +- test/t/test_jarsigner.py | 2 +- test/t/test_java.py | 12 ++--- test/t/test_javac.py | 4 +- test/t/test_javadoc.py | 8 ++- test/t/test_javaws.py | 2 +- test/t/test_jpegoptim.py | 2 +- test/t/test_jps.py | 2 +- test/t/test_jq.py | 12 ++--- test/t/test_jshint.py | 2 +- test/t/test_json_xs.py | 4 +- test/t/test_k3b.py | 2 +- test/t/test_kcov.py | 8 +-- test/t/test_kdvi.py | 2 +- test/t/test_kill.py | 8 ++- test/t/test_killall.py | 5 +- test/t/test_kldload.py | 2 +- test/t/test_kldunload.py | 4 +- test/t/test_koji.py | 4 +- test/t/test_kpdf.py | 2 +- test/t/test_kplayer.py | 2 +- test/t/test_ktutil.py | 4 +- test/t/test_l2ping.py | 2 +- test/t/test_larch.py | 2 +- test/t/test_lastlog.py | 2 +- test/t/test_ld.py | 2 +- test/t/test_ldapadd.py | 2 +- test/t/test_ldapcompare.py | 2 +- test/t/test_ldapdelete.py | 2 +- test/t/test_ldapmodrdn.py | 2 +- test/t/test_ldappasswd.py | 2 +- test/t/test_ldapsearch.py | 2 +- test/t/test_ldapvi.py | 2 +- test/t/test_ldapwhoami.py | 2 +- test/t/test_ldd.py | 2 +- test/t/test_less.py | 2 +- test/t/test_lftp.py | 5 +- test/t/test_lftpget.py | 2 +- test/t/test_lilo.py | 2 +- test/t/test_links.py | 4 +- test/t/test_lintian.py | 2 +- test/t/test_lintian_info.py | 4 +- test/t/test_lisp.py | 2 +- test/t/test_list_admins.py | 2 +- test/t/test_list_lists.py | 2 +- test/t/test_list_members.py | 2 +- test/t/test_list_owners.py | 2 +- test/t/test_ln.py | 2 +- test/t/test_locale_gen.py | 4 +- test/t/test_look.py | 4 +- test/t/test_lpq.py | 2 +- test/t/test_lpr.py | 2 +- test/t/test_lrzip.py | 4 +- test/t/test_ls.py | 8 +-- test/t/test_lsof.py | 4 +- test/t/test_lspci.py | 4 +- test/t/test_lsscsi.py | 4 +- test/t/test_lsusb.py | 2 +- test/t/test_lua.py | 2 +- test/t/test_luac.py | 2 +- test/t/test_luseradd.py | 2 +- test/t/test_luserdel.py | 2 +- test/t/test_lusermod.py | 2 +- test/t/test_lvchange.py | 2 +- test/t/test_lvcreate.py | 2 +- test/t/test_lvdisplay.py | 2 +- test/t/test_lvextend.py | 2 +- test/t/test_lvm.py | 2 +- test/t/test_lvmdiskscan.py | 2 +- test/t/test_lvreduce.py | 2 +- test/t/test_lvremove.py | 2 +- test/t/test_lvrename.py | 2 +- test/t/test_lvresize.py | 2 +- test/t/test_lvs.py | 2 +- test/t/test_lvscan.py | 2 +- test/t/test_lz4.py | 4 +- test/t/test_lzip.py | 2 +- test/t/test_lzma.py | 8 +-- test/t/test_lzop.py | 4 +- test/t/test_m4.py | 2 +- test/t/test_macof.py | 2 +- test/t/test_mailmanctl.py | 2 +- test/t/test_mailsnarf.py | 2 +- test/t/test_make.py | 15 +++--- test/t/test_makepkg.py | 4 +- test/t/test_man.py | 18 +++---- test/t/test_mc.py | 2 +- test/t/test_mcrypt.py | 6 +-- test/t/test_md5sum.py | 2 +- test/t/test_mdadm.py | 2 +- test/t/test_mdecrypt.py | 2 +- test/t/test_mdtool.py | 2 +- test/t/test_medusa.py | 2 +- test/t/test_mencoder.py | 4 +- test/t/test_mii_diag.py | 2 +- test/t/test_mii_tool.py | 2 +- test/t/test_minicom.py | 2 +- test/t/test_mkdir.py | 9 ++-- test/t/test_mkfifo.py | 2 +- test/t/test_mkinitrd.py | 2 +- test/t/test_mkisofs.py | 6 +-- test/t/test_mknod.py | 2 +- test/t/test_mktemp.py | 2 +- test/t/test_mmsitepass.py | 2 +- test/t/test_mock.py | 2 +- test/t/test_modinfo.py | 10 ++-- test/t/test_modprobe.py | 12 ++--- test/t/test_module.py | 2 +- test/t/test_mogrify.py | 2 +- test/t/test_monodevelop.py | 2 +- test/t/test_montage.py | 2 +- test/t/test_mount.py | 10 ++-- test/t/test_mplayer.py | 4 +- test/t/test_mr.py | 17 +++--- test/t/test_msgsnarf.py | 2 +- test/t/test_msynctool.py | 2 +- test/t/test_mtx.py | 2 +- test/t/test_munin_node_configure.py | 2 +- test/t/test_munin_run.py | 2 +- test/t/test_munindoc.py | 2 +- test/t/test_mussh.py | 2 +- test/t/test_mutt.py | 6 +-- test/t/test_muttng.py | 2 +- test/t/test_mv.py | 2 +- test/t/test_mypy.py | 4 +- test/t/test_mysql.py | 4 +- test/t/test_mysqladmin.py | 2 +- test/t/test_nc.py | 2 +- test/t/test_ncftp.py | 4 +- test/t/test_nethogs.py | 2 +- test/t/test_netstat.py | 2 +- test/t/test_newgrp.py | 2 +- test/t/test_newlist.py | 2 +- test/t/test_newusers.py | 2 +- test/t/test_ngrep.py | 4 +- test/t/test_nl.py | 2 +- test/t/test_nm.py | 2 +- test/t/test_nmap.py | 2 +- test/t/test_nmcli.py | 2 +- test/t/test_nproc.py | 4 +- test/t/test_nslookup.py | 2 +- test/t/test_ntpdate.py | 2 +- test/t/test_objcopy.py | 2 +- test/t/test_objdump.py | 2 +- test/t/test_od.py | 2 +- test/t/test_oggdec.py | 4 +- test/t/test_op.py | 4 +- test/t/test_openssl.py | 6 +-- test/t/test_opera.py | 2 +- test/t/test_optipng.py | 2 +- test/t/test_p4.py | 2 +- test/t/test_pack200.py | 2 +- test/t/test_passwd.py | 4 +- test/t/test_paste.py | 2 +- test/t/test_patch.py | 2 +- test/t/test_pdftotext.py | 2 +- test/t/test_perl.py | 35 ++++++------ test/t/test_perlcritic.py | 6 +-- test/t/test_perldoc.py | 10 ++-- test/t/test_perltidy.py | 8 +-- test/t/test_pgrep.py | 2 +- test/t/test_phing.py | 2 +- test/t/test_pidof.py | 2 +- test/t/test_pine.py | 2 +- test/t/test_pinfo.py | 4 +- test/t/test_ping.py | 4 +- test/t/test_pkg_config.py | 4 +- test/t/test_pkg_deinstall.py | 2 +- test/t/test_pkg_delete.py | 2 +- test/t/test_pkg_get.py | 2 +- test/t/test_pkg_info.py | 2 +- test/t/test_pkgadd.py | 2 +- test/t/test_pkgrm.py | 2 +- test/t/test_pkgtool.py | 2 +- test/t/test_pkgutil.py | 2 +- test/t/test_pkill.py | 2 +- test/t/test_plague_client.py | 2 +- test/t/test_pm_hibernate.py | 2 +- test/t/test_pm_is_supported.py | 2 +- test/t/test_pm_powersave.py | 2 +- test/t/test_pngfix.py | 4 +- test/t/test_portinstall.py | 2 +- test/t/test_portsnap.py | 2 +- test/t/test_portupgrade.py | 4 +- test/t/test_postcat.py | 2 +- test/t/test_postconf.py | 4 +- test/t/test_postfix.py | 2 +- test/t/test_postmap.py | 2 +- test/t/test_postsuper.py | 2 +- test/t/test_povray.py | 2 +- test/t/test_pr.py | 2 +- test/t/test_prelink.py | 4 +- test/t/test_protoc.py | 2 +- test/t/test_psql.py | 2 +- test/t/test_ptx.py | 2 +- test/t/test_puppet.py | 4 +- test/t/test_pushd.py | 2 +- test/t/test_pv.py | 6 +-- test/t/test_pvchange.py | 2 +- test/t/test_pvcreate.py | 2 +- test/t/test_pvdisplay.py | 2 +- test/t/test_pvmove.py | 2 +- test/t/test_pvremove.py | 2 +- test/t/test_pvs.py | 2 +- test/t/test_pvscan.py | 2 +- test/t/test_pwck.py | 2 +- test/t/test_pwd.py | 2 +- test/t/test_pwdx.py | 2 +- test/t/test_pwgen.py | 2 +- test/t/test_pycodestyle.py | 6 +-- test/t/test_pydoc.py | 2 +- test/t/test_pydocstyle.py | 4 +- test/t/test_pyflakes.py | 2 +- test/t/test_pylint.py | 4 +- test/t/test_pylint_3.py | 4 +- test/t/test_pytest.py | 4 +- test/t/test_python.py | 18 +++---- test/t/test_python3.py | 18 +++---- test/t/test_pyvenv.py | 2 +- test/t/test_qemu.py | 2 +- test/t/test_qrunner.py | 2 +- test/t/test_querybts.py | 2 +- test/t/test_quota.py | 2 +- test/t/test_quotacheck.py | 2 +- test/t/test_quotaon.py | 2 +- test/t/test_radvdump.py | 2 +- test/t/test_rcs.py | 2 +- test/t/test_rcsdiff.py | 2 +- test/t/test_rdesktop.py | 2 +- test/t/test_rdict.py | 2 +- test/t/test_readelf.py | 2 +- test/t/test_readonly.py | 2 +- test/t/test_remove_members.py | 2 +- test/t/test_removepkg.py | 4 +- test/t/test_renice.py | 4 +- test/t/test_repomanage.py | 2 +- test/t/test_reportbug.py | 2 +- test/t/test_reptyr.py | 4 +- test/t/test_resolvconf.py | 2 +- test/t/test_rfcomm.py | 2 +- test/t/test_rfkill.py | 4 +- test/t/test_ri.py | 6 +-- test/t/test_rlog.py | 2 +- test/t/test_rm.py | 2 +- test/t/test_rmdir.py | 5 +- test/t/test_rmlist.py | 2 +- test/t/test_rmmod.py | 2 +- test/t/test_route.py | 2 +- test/t/test_rpcdebug.py | 2 +- test/t/test_rpm.py | 4 +- test/t/test_rpm2tgz.py | 4 +- test/t/test_rpmbuild.py | 2 +- test/t/test_rrdtool.py | 2 +- test/t/test_rsync.py | 6 +-- test/t/test_rtcwake.py | 2 +- test/t/test_runuser.py | 2 +- test/t/test_sbcl.py | 2 +- test/t/test_sbcl_mt.py | 3 +- test/t/test_sbopkg.py | 2 +- test/t/test_screen.py | 11 ++-- test/t/test_scrub.py | 6 +-- test/t/test_sdptool.py | 2 +- test/t/test_sed.py | 2 +- test/t/test_seq.py | 2 +- test/t/test_service.py | 2 +- test/t/test_set.py | 2 +- test/t/test_setquota.py | 2 +- test/t/test_sftp.py | 2 +- test/t/test_sh.py | 8 +-- test/t/test_sha1sum.py | 2 +- test/t/test_shar.py | 2 +- test/t/test_sitecopy.py | 2 +- test/t/test_slackpkg.py | 2 +- test/t/test_slapt_get.py | 6 +-- test/t/test_slapt_src.py | 6 +-- test/t/test_smartctl.py | 2 +- test/t/test_smbcacls.py | 2 +- test/t/test_smbclient.py | 2 +- test/t/test_smbcquotas.py | 2 +- test/t/test_smbget.py | 2 +- test/t/test_smbpasswd.py | 2 +- test/t/test_smbtar.py | 2 +- test/t/test_smbtree.py | 2 +- test/t/test_snownews.py | 2 +- test/t/test_sort.py | 2 +- test/t/test_split.py | 2 +- test/t/test_spovray.py | 2 +- test/t/test_sqlite3.py | 6 +-- test/t/test_ss.py | 6 +-- test/t/test_ssh.py | 2 +- test/t/test_ssh_add.py | 2 +- test/t/test_ssh_copy_id.py | 2 +- test/t/test_ssh_keygen.py | 2 +- test/t/test_sshfs.py | 2 +- test/t/test_sshmitm.py | 2 +- test/t/test_sshow.py | 2 +- test/t/test_strace.py | 2 +- test/t/test_stream.py | 2 +- test/t/test_strings.py | 2 +- test/t/test_strip.py | 2 +- test/t/test_su.py | 2 +- test/t/test_sudo.py | 36 ++++++------- test/t/test_svcadm.py | 2 +- test/t/test_svk.py | 2 +- test/t/test_svn.py | 2 +- test/t/test_svnadmin.py | 2 +- test/t/test_svnlook.py | 2 +- test/t/test_sync_members.py | 2 +- test/t/test_synclient.py | 4 +- test/t/test_sysbench.py | 2 +- test/t/test_sysctl.py | 4 +- test/t/test_tac.py | 2 +- test/t/test_tail.py | 2 +- test/t/test_tar.py | 42 +++++++-------- test/t/test_tcpdump.py | 2 +- test/t/test_tcpkill.py | 2 +- test/t/test_tcpnice.py | 2 +- test/t/test_tee.py | 2 +- test/t/test_texindex.py | 2 +- test/t/test_tightvncviewer.py | 2 +- test/t/test_time.py | 6 +-- test/t/test_timeout.py | 4 +- test/t/test_tipc.py | 2 +- test/t/test_touch.py | 2 +- test/t/test_tox.py | 6 +-- test/t/test_tr.py | 2 +- test/t/test_tracepath.py | 4 +- test/t/test_tshark.py | 10 ++-- test/t/test_tune2fs.py | 2 +- test/t/test_udevadm.py | 2 +- test/t/test_umount.py | 2 +- test/t/test_unace.py | 2 +- test/t/test_uname.py | 2 +- test/t/test_unexpand.py | 2 +- test/t/test_uniq.py | 2 +- test/t/test_units.py | 2 +- test/t/test_unpack200.py | 2 +- test/t/test_unrar.py | 2 +- test/t/test_unset.py | 2 +- test/t/test_unshunt.py | 2 +- test/t/test_update_alternatives.py | 2 +- test/t/test_update_rc_d.py | 2 +- test/t/test_upgradepkg.py | 6 +-- test/t/test_urlsnarf.py | 2 +- test/t/test_uscan.py | 2 +- test/t/test_useradd.py | 4 +- test/t/test_userdel.py | 4 +- test/t/test_usermod.py | 4 +- test/t/test_valgrind.py | 12 ++--- test/t/test_vdir.py | 2 +- test/t/test_vgcfgbackup.py | 2 +- test/t/test_vgcfgrestore.py | 2 +- test/t/test_vgchange.py | 2 +- test/t/test_vgck.py | 2 +- test/t/test_vgconvert.py | 2 +- test/t/test_vgcreate.py | 4 +- test/t/test_vgdisplay.py | 2 +- test/t/test_vgexport.py | 2 +- test/t/test_vgextend.py | 2 +- test/t/test_vgimport.py | 2 +- test/t/test_vgmerge.py | 2 +- test/t/test_vgmknodes.py | 2 +- test/t/test_vgreduce.py | 2 +- test/t/test_vgremove.py | 2 +- test/t/test_vgrename.py | 2 +- test/t/test_vgs.py | 2 +- test/t/test_vgscan.py | 2 +- test/t/test_vgsplit.py | 2 +- test/t/test_vi.py | 4 +- test/t/test_vipw.py | 2 +- test/t/test_vmstat.py | 2 +- test/t/test_vncviewer.py | 2 +- test/t/test_vpnc.py | 2 +- test/t/test_watch.py | 2 +- test/t/test_wc.py | 2 +- test/t/test_webmitm.py | 2 +- test/t/test_wget.py | 4 +- test/t/test_who.py | 2 +- test/t/test_wine.py | 6 +-- test/t/test_withlist.py | 2 +- test/t/test_wodim.py | 2 +- test/t/test_wol.py | 4 +- test/t/test_write.py | 2 +- test/t/test_wsimport.py | 2 +- test/t/test_wtf.py | 2 +- test/t/test_wvdial.py | 2 +- test/t/test_xdg_mime.py | 12 ++--- test/t/test_xdg_settings.py | 6 +-- test/t/test_xfreerdp.py | 2 +- test/t/test_xgamma.py | 6 +-- test/t/test_xm.py | 2 +- test/t/test_xmllint.py | 4 +- test/t/test_xmlwf.py | 2 +- test/t/test_xmms.py | 2 +- test/t/test_xmodmap.py | 4 +- test/t/test_xpovray.py | 2 +- test/t/test_xrandr.py | 4 +- test/t/test_xrdb.py | 2 +- test/t/test_xsltproc.py | 4 +- test/t/test_xvnc4viewer.py | 6 +-- test/t/test_xxd.py | 4 +- test/t/test_xz.py | 8 +-- test/t/test_xzdec.py | 2 +- test/t/test_ypcat.py | 2 +- test/t/test_ypmatch.py | 2 +- test/t/test_yum.py | 2 +- test/t/test_yum_arch.py | 2 +- test/t/test_zopfli.py | 4 +- test/t/test_zopflipng.py | 2 +- test/t/unit/test_unit_ip_addresses.py | 12 ++--- 663 files changed, 1132 insertions(+), 1098 deletions(-) diff --git a/test/t/conftest.py b/test/t/conftest.py index c14ca22a23a..5e247752f2f 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -2,7 +2,7 @@ import os import re import shlex -from typing import Iterable, List, NamedTuple, Optional, Tuple +from typing import Iterable, List, Optional, Tuple, Union import pexpect import pytest @@ -264,8 +264,69 @@ def diff_env(before: List[str], after: List[str], ignore: str): assert not diff, "Environment should not be modified" -CompletionResult = NamedTuple( - "CompletionResult", [("output", str), ("list", List[str])]) +class CompletionResult: + """ + Class to hold completion results. + """ + + def __init__(self, output: str, items: Optional[Iterable[str]] = None): + """ + When items are specified, they are used as the base for comparisions + provided by this class. When not, regular expressions are used instead. + This is because it is not always possible to unambiguously split a + completion output string into individual items, for example when the + items contain whitespace. + + :param output: All completion output as-is. + :param items: Completions as individual items. Should be specified + only in cases where the completions are robustly known to be + exactly the specified ones. + """ + self.output = output + self._items = None if items is None else sorted(items) + + def endswith(self, suffix: str) -> bool: + return self.output.endswith(suffix) + + def __eq__(self, expected: Union[str, Iterable[str]]) -> bool: + """ + Returns True if completion contains expected items, and no others. + + Defining __eq__ this way is quite ugly, but facilitates concise + testing code. + """ + expiter = [expected] if isinstance(expected, str) else sorted(expected) + if self._items is not None: + return self._items == expiter + return bool(re.match(r"^\s*" + + r"\s+".join(re.escape(x) for x in expiter) + + r"\s*$", self.output)) + + def __contains__(self, item: str) -> bool: + if self._items is not None: + return item in self._items + return bool( + re.search(r"(^|\s)%s(\s|$)" % re.escape(item), self.output)) + + def __iter__(self) -> Iterable[str]: + """ + Note that iteration over items may not be accurate when items were not + specified to the constructor, if individual items in the output contain + whitespace. In those cases, it errs on the side of possibly returning + more items than there actually are, and intends to never return fewer. + """ + return iter(self._items if self._items is not None + else re.split(r" {2,}|\r\n", self.output.strip())) + + def __len__(self) -> int: + """ + Uses __iter__, see caveat in it. While possibly inaccurate, this is + good enough for truthiness checks. + """ + return len(list(iter(self))) + + def __repr__(self) -> str: + return "" % list(self) def assert_complete( @@ -306,16 +367,10 @@ def assert_complete( output = bash.before if output.endswith(MAGIC_MARK): output = bash.before[:-len(MAGIC_MARK)] - result = CompletionResult( - output, - sorted(x for x in re.split(r" {2,}|\r\n", output) if x), - ) + result = CompletionResult(output) elif got == 2: output = bash.match.group(1) - result = CompletionResult( - output, - [shlex.split(cmd + output)[-1]], - ) + result = CompletionResult(output, [shlex.split(cmd + output)[-1]]) else: # TODO: warn about EOF/TIMEOUT? result = CompletionResult("", []) diff --git a/test/t/test_2to3.py b/test/t/test_2to3.py index 006ee02b107..23ff6e0258a 100644 --- a/test/t/test_2to3.py +++ b/test/t/test_2to3.py @@ -5,4 +5,4 @@ class Test2to3: @pytest.mark.complete("2to3 ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_7z.py b/test/t/test_7z.py index 97469b71aa2..ec067463afd 100644 --- a/test/t/test_7z.py +++ b/test/t/test_7z.py @@ -5,22 +5,22 @@ class Test7z: @pytest.mark.complete("7z ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("7z a ar -tzi") def test_2(self, completion): - assert completion.list == ["-tzip"] + assert completion == "-tzip" @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete(r"7z x -wa\ ", cwd="_filedir") def test_3(self, completion): - assert completion.list == [r"-wa\ b/"] - assert not completion.output.endswith(" ") + assert completion == r"-wa\ b/" + assert not completion.endswith(" ") @pytest.mark.complete("7z x ", cwd="7z") def test_4(self, completion): - assert completion.list == ["a.7z"] + assert completion == "a.7z" @pytest.mark.complete("7z d a.7z ", cwd="7z") def test_5(self, completion): - assert completion.list == ["abc"] + assert completion == "abc" diff --git a/test/t/test_a2ps.py b/test/t/test_a2ps.py index 332e1b41af3..f4f3a739583 100644 --- a/test/t/test_a2ps.py +++ b/test/t/test_a2ps.py @@ -5,4 +5,4 @@ class TestA2ps: @pytest.mark.complete("a2ps ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_a2x.py b/test/t/test_a2x.py index 9c25c3177d6..2847bc44a44 100644 --- a/test/t/test_a2x.py +++ b/test/t/test_a2x.py @@ -5,4 +5,4 @@ class TestA2x: @pytest.mark.complete("a2x ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_abook.py b/test/t/test_abook.py index 28c5305b146..7eda13def7f 100644 --- a/test/t/test_abook.py +++ b/test/t/test_abook.py @@ -5,4 +5,4 @@ class TestAbook: @pytest.mark.complete("abook -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_aclocal.py b/test/t/test_aclocal.py index ee6be3bf4a0..fa7809b3977 100644 --- a/test/t/test_aclocal.py +++ b/test/t/test_aclocal.py @@ -5,4 +5,4 @@ class TestAclocal: @pytest.mark.complete("aclocal ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_acpi.py b/test/t/test_acpi.py index d8c05c93828..3a99d52b9f5 100644 --- a/test/t/test_acpi.py +++ b/test/t/test_acpi.py @@ -5,4 +5,4 @@ class TestAcpi: @pytest.mark.complete("acpi -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_acroread.py b/test/t/test_acroread.py index 9f5bb6a7627..6c710342929 100644 --- a/test/t/test_acroread.py +++ b/test/t/test_acroread.py @@ -5,4 +5,4 @@ class TestAcroread: @pytest.mark.complete("acroread ", cwd="fixtures/acroread") def test_1(self, completion): - assert completion.list == "foo.d/ t.pdf".split() + assert completion == "foo.d/ t.pdf".split() diff --git a/test/t/test_adb.py b/test/t/test_adb.py index 0bb50feb4e1..00c5738f931 100644 --- a/test/t/test_adb.py +++ b/test/t/test_adb.py @@ -5,4 +5,4 @@ class TestAdb: @pytest.mark.complete("adb ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_add_members.py b/test/t/test_add_members.py index 09282bb3d4d..8a1c8a4c6bb 100644 --- a/test/t/test_add_members.py +++ b/test/t/test_add_members.py @@ -5,4 +5,4 @@ class TestAddMembers: @pytest.mark.complete("add_members -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_alias.py b/test/t/test_alias.py index ad852847229..26236a76691 100644 --- a/test/t/test_alias.py +++ b/test/t/test_alias.py @@ -15,10 +15,10 @@ class TestAlias: @pytest.mark.complete("alias ") def test_1(self, completion): - assert completion.list == "bar foo".split() + assert completion == "bar foo".split() @pytest.mark.xfail # TODO: Would like this completion to work @pytest.mark.complete("alias foo=") def test_2(self, completion): - assert completion.list == ["foo='bar'"] - assert not completion.output.endswith(" ") + assert completion == "foo='bar'" + assert not completion.endswith(" ") diff --git a/test/t/test_alpine.py b/test/t/test_alpine.py index fb1e00ba859..83f6354ae06 100644 --- a/test/t/test_alpine.py +++ b/test/t/test_alpine.py @@ -5,4 +5,4 @@ class TestAlpine: @pytest.mark.complete("alpine -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_animate.py b/test/t/test_animate.py index 999599718bf..7fc02a8e7f6 100644 --- a/test/t/test_animate.py +++ b/test/t/test_animate.py @@ -5,4 +5,4 @@ class TestAnimate: @pytest.mark.complete("animate ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ant.py b/test/t/test_ant.py index 41584046e67..b1f87b763cd 100644 --- a/test/t/test_ant.py +++ b/test/t/test_ant.py @@ -6,17 +6,17 @@ class TestAnt: @pytest.mark.complete("ant -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("ant ", cwd="ant") def test_2(self, completion): - assert completion.list == "bashcomp clean init realclean".split() + assert completion == "bashcomp clean init realclean".split() @pytest.mark.complete("ant -f build-with-import.xml ", cwd="ant") def test_3(self, completion): - assert completion.list == "build-with-import imported-build".split() + assert completion == "build-with-import imported-build".split() @pytest.mark.complete("ant ", cwd="ant", env=dict(ANT_ARGS="'-f named-build.xml'")) def test_4(self, completion): - assert completion.list == ["named-build"] + assert completion == "named-build" diff --git a/test/t/test_apache2ctl.py b/test/t/test_apache2ctl.py index 08ceec6cd2d..5abce583d5f 100644 --- a/test/t/test_apache2ctl.py +++ b/test/t/test_apache2ctl.py @@ -5,4 +5,4 @@ class TestApache2ctl: @pytest.mark.complete("apache2ctl ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_appdata_validate.py b/test/t/test_appdata_validate.py index 3fbe6c95e24..3eccec33724 100644 --- a/test/t/test_appdata_validate.py +++ b/test/t/test_appdata_validate.py @@ -8,4 +8,4 @@ class TestAppdataValidate: @pytest.mark.complete("appdata-validate ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_apt_build.py b/test/t/test_apt_build.py index 975ea0c2122..38ac0e338d2 100644 --- a/test/t/test_apt_build.py +++ b/test/t/test_apt_build.py @@ -8,4 +8,4 @@ class TestAptBuild: @pytest.mark.complete("apt-build ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_apt_cache.py b/test/t/test_apt_cache.py index 232d463354c..453aa93b67a 100644 --- a/test/t/test_apt_cache.py +++ b/test/t/test_apt_cache.py @@ -8,4 +8,4 @@ class TestAptCache: @pytest.mark.complete("apt-cache ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_apt_get.py b/test/t/test_apt_get.py index 0e650be41ac..49ae653777e 100644 --- a/test/t/test_apt_get.py +++ b/test/t/test_apt_get.py @@ -8,8 +8,8 @@ class TestAptGet: @pytest.mark.complete("apt-get ") def test_1(self, completion): - assert "install" in completion.list and "update" in completion.list + assert all(x in completion for x in "install update".split()) @pytest.mark.complete("apt-get install ./", cwd="dpkg") def test_2(self, completion): - assert completion.list == ["./bash-completion-test-subject.deb"] + assert completion == "./bash-completion-test-subject.deb" diff --git a/test/t/test_aptitude.py b/test/t/test_aptitude.py index 33fa5be5ac5..621dea3ce63 100644 --- a/test/t/test_aptitude.py +++ b/test/t/test_aptitude.py @@ -5,4 +5,4 @@ class TestAptitude: @pytest.mark.complete("aptitude ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_arch.py b/test/t/test_arch.py index 840ff13c05f..dfbf8e616f7 100644 --- a/test/t/test_arch.py +++ b/test/t/test_arch.py @@ -10,4 +10,4 @@ class TestArch: @pytest.mark.complete("arch -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_arp.py b/test/t/test_arp.py index 05e7f9d26ed..c78ae30e69f 100644 --- a/test/t/test_arp.py +++ b/test/t/test_arp.py @@ -8,8 +8,8 @@ class TestArp: @pytest.mark.xfail(in_docker(), reason="Probably fails in docker") @pytest.mark.complete("arp ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("arp -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_arping.py b/test/t/test_arping.py index 104d590f639..02e9360a25e 100644 --- a/test/t/test_arping.py +++ b/test/t/test_arping.py @@ -5,8 +5,8 @@ class TestArping: @pytest.mark.complete("arping ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("arping -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_arpspoof.py b/test/t/test_arpspoof.py index 2f933a1614a..40ecb8ddedd 100644 --- a/test/t/test_arpspoof.py +++ b/test/t/test_arpspoof.py @@ -5,4 +5,4 @@ class TestArpspoof: @pytest.mark.complete("arpspoof -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_asciidoc.py b/test/t/test_asciidoc.py index 21c0000e066..20a34ea7e38 100644 --- a/test/t/test_asciidoc.py +++ b/test/t/test_asciidoc.py @@ -5,4 +5,4 @@ class TestAsciidoc: @pytest.mark.complete("asciidoc ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_aspell.py b/test/t/test_aspell.py index 7e7193b6230..2a7e87c8f7b 100644 --- a/test/t/test_aspell.py +++ b/test/t/test_aspell.py @@ -5,4 +5,4 @@ class TestAspell: @pytest.mark.complete("aspell ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_autoconf.py b/test/t/test_autoconf.py index 287959b9a21..7636b8b3384 100644 --- a/test/t/test_autoconf.py +++ b/test/t/test_autoconf.py @@ -5,4 +5,4 @@ class TestAutoconf: @pytest.mark.complete("autoconf ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_autoheader.py b/test/t/test_autoheader.py index fa78cdb95c6..2c680660277 100644 --- a/test/t/test_autoheader.py +++ b/test/t/test_autoheader.py @@ -5,4 +5,4 @@ class TestAutoheader: @pytest.mark.complete("autoheader ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_automake.py b/test/t/test_automake.py index 53f2230b711..0ae039e4cc1 100644 --- a/test/t/test_automake.py +++ b/test/t/test_automake.py @@ -5,4 +5,4 @@ class TestAutomake: @pytest.mark.complete("automake ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_autoreconf.py b/test/t/test_autoreconf.py index f924869c507..c9bca1ef7a5 100644 --- a/test/t/test_autoreconf.py +++ b/test/t/test_autoreconf.py @@ -5,4 +5,4 @@ class TestAutoreconf: @pytest.mark.complete("autoreconf ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_autorpm.py b/test/t/test_autorpm.py index 9492b81720b..df1c3812085 100644 --- a/test/t/test_autorpm.py +++ b/test/t/test_autorpm.py @@ -5,4 +5,4 @@ class TestAutorpm: @pytest.mark.complete("autorpm ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_autoscan.py b/test/t/test_autoscan.py index 31ac0883811..9dbd13dff41 100644 --- a/test/t/test_autoscan.py +++ b/test/t/test_autoscan.py @@ -5,4 +5,4 @@ class TestAutoscan: @pytest.mark.complete("autoscan ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_autoupdate.py b/test/t/test_autoupdate.py index a40225bc669..1701ffe680d 100644 --- a/test/t/test_autoupdate.py +++ b/test/t/test_autoupdate.py @@ -5,4 +5,4 @@ class TestAutoupdate: @pytest.mark.complete("autoupdate ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_avctrl.py b/test/t/test_avctrl.py index 96a5d6f5614..23eca7bb8d0 100644 --- a/test/t/test_avctrl.py +++ b/test/t/test_avctrl.py @@ -5,4 +5,4 @@ class TestAvctrl: @pytest.mark.complete("avctrl ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_awk.py b/test/t/test_awk.py index d92df2e3069..7ae0c9c60c2 100644 --- a/test/t/test_awk.py +++ b/test/t/test_awk.py @@ -5,4 +5,4 @@ class TestAwk: @pytest.mark.complete("awk ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_badblocks.py b/test/t/test_badblocks.py index 3384ef689ad..c4e62bf576a 100644 --- a/test/t/test_badblocks.py +++ b/test/t/test_badblocks.py @@ -5,4 +5,4 @@ class TestBadblocks: @pytest.mark.complete("badblocks ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_base64.py b/test/t/test_base64.py index 803036609f8..20c5c18dac5 100644 --- a/test/t/test_base64.py +++ b/test/t/test_base64.py @@ -5,4 +5,4 @@ class TestBase64: @pytest.mark.complete("base64 ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_bash.py b/test/t/test_bash.py index 148fbbf1e23..fe788e43d10 100644 --- a/test/t/test_bash.py +++ b/test/t/test_bash.py @@ -5,4 +5,4 @@ class TestBash: @pytest.mark.complete("bash --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_bc.py b/test/t/test_bc.py index 80835afc4ff..6924103ff93 100644 --- a/test/t/test_bc.py +++ b/test/t/test_bc.py @@ -5,4 +5,4 @@ class TestBc: @pytest.mark.complete("bc --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_bind.py b/test/t/test_bind.py index 8740d514c62..5e783547303 100644 --- a/test/t/test_bind.py +++ b/test/t/test_bind.py @@ -5,8 +5,8 @@ class TestBind: @pytest.mark.complete("bind -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("bind k") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_bison.py b/test/t/test_bison.py index ddcdf75fc7b..f6e4c201464 100644 --- a/test/t/test_bison.py +++ b/test/t/test_bison.py @@ -5,4 +5,4 @@ class TestBison: @pytest.mark.complete("bison --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_bk.py b/test/t/test_bk.py index 451cbcf8018..724f1a74a67 100644 --- a/test/t/test_bk.py +++ b/test/t/test_bk.py @@ -5,4 +5,4 @@ class TestBk: @pytest.mark.complete("bk ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_brctl.py b/test/t/test_brctl.py index 256104fc179..18d49e11ee0 100644 --- a/test/t/test_brctl.py +++ b/test/t/test_brctl.py @@ -5,4 +5,4 @@ class TestBrctl: @pytest.mark.complete("brctl ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_btdownloadcurses_py.py b/test/t/test_btdownloadcurses_py.py index 79c32f7e890..db0509bf6b0 100644 --- a/test/t/test_btdownloadcurses_py.py +++ b/test/t/test_btdownloadcurses_py.py @@ -8,4 +8,4 @@ class TestBtdownloadcursesPy: @pytest.mark.complete("btdownloadcurses.py ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_btdownloadgui_py.py b/test/t/test_btdownloadgui_py.py index a453cba16bc..eabf78e2f06 100644 --- a/test/t/test_btdownloadgui_py.py +++ b/test/t/test_btdownloadgui_py.py @@ -8,4 +8,4 @@ class TestBtdownloadguiPy: @pytest.mark.complete("btdownloadgui.py ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_btdownloadheadless_py.py b/test/t/test_btdownloadheadless_py.py index 38928e5a917..31affd5a796 100644 --- a/test/t/test_btdownloadheadless_py.py +++ b/test/t/test_btdownloadheadless_py.py @@ -8,4 +8,4 @@ class TestBtdownloadheadlessPy: @pytest.mark.complete("btdownloadheadless.py ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_bts.py b/test/t/test_bts.py index bebcece4d18..aafb98f2f24 100644 --- a/test/t/test_bts.py +++ b/test/t/test_bts.py @@ -5,8 +5,8 @@ class TestBts: @pytest.mark.complete("bts ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("bts -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_bzip2.py b/test/t/test_bzip2.py index d378fe9d773..e1063a743a6 100644 --- a/test/t/test_bzip2.py +++ b/test/t/test_bzip2.py @@ -5,8 +5,8 @@ class TestBzip2: @pytest.mark.complete("bzip2 ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("bzip2 ~") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_cal.py b/test/t/test_cal.py index f5208c443bd..80ae28eb0bc 100644 --- a/test/t/test_cal.py +++ b/test/t/test_cal.py @@ -5,4 +5,4 @@ class TestCal: @pytest.mark.complete("cal ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_cancel.py b/test/t/test_cancel.py index 0d2a438a943..29651f6de1b 100644 --- a/test/t/test_cancel.py +++ b/test/t/test_cancel.py @@ -21,4 +21,4 @@ def added_job(self, request, bash): def test_1(self, bash, completion, added_job): got = assert_bash_exec(bash, "lpstat | awk '{print $1}'", want_output=True).strip().split() - assert completion.list == sorted(got) + assert completion == sorted(got) diff --git a/test/t/test_cardctl.py b/test/t/test_cardctl.py index 21d274db511..379e5483469 100644 --- a/test/t/test_cardctl.py +++ b/test/t/test_cardctl.py @@ -5,4 +5,4 @@ class TestCardctl: @pytest.mark.complete("cardctl ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_cat.py b/test/t/test_cat.py index a972ae84419..40a604779f9 100644 --- a/test/t/test_cat.py +++ b/test/t/test_cat.py @@ -5,4 +5,4 @@ class TestCat: @pytest.mark.complete("cat ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_cc.py b/test/t/test_cc.py index 6a0eef5db91..192685d670b 100644 --- a/test/t/test_cc.py +++ b/test/t/test_cc.py @@ -5,4 +5,4 @@ class TestCc: @pytest.mark.complete("cc ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ccache.py b/test/t/test_ccache.py index 24867da2444..af10f38302e 100644 --- a/test/t/test_ccache.py +++ b/test/t/test_ccache.py @@ -5,24 +5,24 @@ class TestCcache: @pytest.mark.complete("ccache -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("ccache --clea") def test_2(self, completion): - assert "--cleanup" in completion.list and "--clear" in completion.list + assert all(x in completion for x in "--cleanup --clear".split()) @pytest.mark.complete("ccache stt") def test_3(self, completion): - assert "stty" in completion.list + assert "stty" in completion @pytest.mark.complete("ccache --zero-stats stt") def test_4(self, completion): - assert "stty" in completion.list + assert "stty" in completion @pytest.mark.complete("ccache --hel") def test_5(self, completion): - assert "--help" in completion.list + assert "--help" in completion @pytest.mark.complete("ccache --zero-stats ls --hel") def test_6(self, completion): - assert "--help" in completion.list + assert "--help" in completion diff --git a/test/t/test_ccze.py b/test/t/test_ccze.py index dffdf02ad26..32ddd84fd70 100644 --- a/test/t/test_ccze.py +++ b/test/t/test_ccze.py @@ -5,16 +5,16 @@ class TestCcze: @pytest.mark.complete("ccze ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("ccze -? ") def test_2(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("ccze -o ") def test_3(self, completion): - assert completion.list + assert completion @pytest.mark.complete("ccze --plugin=") def test_4(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_cd.py b/test/t/test_cd.py index 6624c4466a3..ff4f056cada 100644 --- a/test/t/test_cd.py +++ b/test/t/test_cd.py @@ -4,21 +4,20 @@ @pytest.mark.bashcomp(ignore_env=r"^\+CDPATH=$") class TestCd: - @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("cd shared/default/") def test_1(self, completion): - assert completion.list == ["bar bar.d/" "foo.d/"] + assert completion == ["bar bar.d/", "foo.d/"] @pytest.mark.complete("cd fo", env=dict(CDPATH="shared/default")) def test_2(self, completion): - assert completion.list == ["foo.d/"] + assert completion == "foo.d/" @pytest.mark.complete("cd fo") def test_3(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("cd ", cwd="shared/default/foo.d", env=dict(CDPATH="")) def test_4(self, completion): - assert not completion.list # No subdirs nor CDPATH + assert not completion # No subdirs nor CDPATH diff --git a/test/t/test_cdrecord.py b/test/t/test_cdrecord.py index 7762d3749a7..f414432cbcc 100644 --- a/test/t/test_cdrecord.py +++ b/test/t/test_cdrecord.py @@ -5,4 +5,4 @@ class TestCdrecord: @pytest.mark.complete("cdrecord -d") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_cfagent.py b/test/t/test_cfagent.py index 57444640d97..a3079c8539b 100644 --- a/test/t/test_cfagent.py +++ b/test/t/test_cfagent.py @@ -5,4 +5,4 @@ class TestCfagent: @pytest.mark.complete("cfagent -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_cfrun.py b/test/t/test_cfrun.py index 15d7e192979..2fb8b950187 100644 --- a/test/t/test_cfrun.py +++ b/test/t/test_cfrun.py @@ -5,4 +5,4 @@ class TestCfrun: @pytest.mark.complete("cfrun -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_chage.py b/test/t/test_chage.py index 432d3b3072b..3129ced74bd 100644 --- a/test/t/test_chage.py +++ b/test/t/test_chage.py @@ -5,4 +5,4 @@ class TestChage: @pytest.mark.complete("chage ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_change_pw.py b/test/t/test_change_pw.py index beb4e95c8d9..db664a70624 100644 --- a/test/t/test_change_pw.py +++ b/test/t/test_change_pw.py @@ -10,4 +10,4 @@ class TestChangePw: @pytest.mark.complete("change_pw -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_check_db.py b/test/t/test_check_db.py index a6ccc760be0..65968a908ec 100644 --- a/test/t/test_check_db.py +++ b/test/t/test_check_db.py @@ -5,4 +5,4 @@ class TestCheckDb: @pytest.mark.complete("check_db -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_check_perms.py b/test/t/test_check_perms.py index c1e38cef2a6..5c5b38a727e 100644 --- a/test/t/test_check_perms.py +++ b/test/t/test_check_perms.py @@ -5,4 +5,4 @@ class TestCheckPerms: @pytest.mark.complete("check_perms -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_checksec.py b/test/t/test_checksec.py index 5c4b915c712..5842b494c9c 100644 --- a/test/t/test_checksec.py +++ b/test/t/test_checksec.py @@ -5,4 +5,4 @@ class TestChecksec: @pytest.mark.complete("checksec -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_chfn.py b/test/t/test_chfn.py index 535b9efe1bb..c26655271eb 100644 --- a/test/t/test_chfn.py +++ b/test/t/test_chfn.py @@ -5,4 +5,4 @@ class TestChfn: @pytest.mark.complete("chfn ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_chgrp.py b/test/t/test_chgrp.py index dcffebcd840..0adf4770ca3 100644 --- a/test/t/test_chgrp.py +++ b/test/t/test_chgrp.py @@ -5,4 +5,4 @@ class TestChgrp: @pytest.mark.complete("chgrp ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_chkconfig.py b/test/t/test_chkconfig.py index fb001ea4209..2868b22541c 100644 --- a/test/t/test_chkconfig.py +++ b/test/t/test_chkconfig.py @@ -5,11 +5,11 @@ class TestChkconfig: @pytest.mark.complete("chkconfig -") def test_1(self, completion): - assert completion.list + assert completion # systemd may not be running e.g. in a docker container, and listing # services will then fail. @pytest.mark.complete("chkconfig ", skipif="! systemctl list-units &>/dev/null") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_chmod.py b/test/t/test_chmod.py index 19c661a36fe..ed59cf137c6 100644 --- a/test/t/test_chmod.py +++ b/test/t/test_chmod.py @@ -6,20 +6,20 @@ class TestChmod: # No completion here until mode completion is implemented @pytest.mark.complete("chmod ") def test_1(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("chmod 755 ") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("chmod -") def test_3(self, completion): - assert completion.list + assert completion @pytest.mark.complete("chmod -x ") def test_4(self, completion): - assert completion.list + assert completion @pytest.mark.complete("chmod -77 ") def test_5(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_chown.py b/test/t/test_chown.py index 9e1a75d142b..41437635515 100644 --- a/test/t/test_chown.py +++ b/test/t/test_chown.py @@ -15,36 +15,34 @@ class TestChown: def test_1(self, bash, completion): users = sorted(assert_bash_exec( bash, "compgen -A user", want_output=True).split()) - assert completion.list == users + assert completion == users - @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("chown foo: shared/default/") def test_2(self, completion): - assert completion.list == ["bar", "bar bar.d/", "foo", "foo.d/"] + assert completion == ["bar", "bar bar.d/", "foo", "foo.d/"] - @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("chown :foo shared/default/") def test_3(self, completion): - assert completion.list == ["bar", "bar bar.d/", "foo", "foo.d/"] + assert completion == ["bar", "bar bar.d/", "foo", "foo.d/"] def test_4(self, bash, part_full_user): part, full = part_full_user completion = assert_complete(bash, "chown %s" % part) - assert completion.list == [full] - assert completion.output.endswith(" ") + assert completion == full + assert completion.endswith(" ") def test_5(self, bash, part_full_user, part_full_group): _, user = part_full_user partgroup, fullgroup = part_full_group completion = assert_complete( bash, "chown %s:%s" % (user, partgroup)) - assert completion.list == ["%s:%s" % (user, fullgroup)] + assert completion == "%s:%s" % (user, fullgroup) assert completion.output.endswith(" ") def test_6(self, bash, part_full_group): part, full = part_full_group completion = assert_complete(bash, "chown dot.user:%s" % part) - assert completion.list == ["dot.user:%s" % full] + assert completion == "dot.user:%s" % full assert completion.output.endswith(" ") @pytest.mark.xfail # TODO check escaping, whitespace @@ -56,7 +54,7 @@ def test_7(self, bash, part_full_group): r"foo\_b\ a\.r\ :"): completion = assert_complete( bash, "chown %s%s" % (prefix, part)) - assert completion.list == ["%s%s" % (prefix, full)] + assert completion == "%s%s" % (prefix, full) assert completion.output.endswith(" ") def test_8(self, bash, part_full_user, part_full_group): @@ -66,10 +64,10 @@ def test_8(self, bash, part_full_user, part_full_group): for x in range(2, 5): completion = assert_complete( bash, "chown %s%s:%s" % (user, x * "\\", partgroup)) - assert not completion.list + assert not completion def test_9(self, bash, part_full_group): """Test graceful fail on colon in user/group name.""" part, _ = part_full_group completion = assert_complete(bash, "chown foo:bar:%s" % part) - assert not completion.list + assert not completion diff --git a/test/t/test_chpasswd.py b/test/t/test_chpasswd.py index de8822203ed..132b70ee716 100644 --- a/test/t/test_chpasswd.py +++ b/test/t/test_chpasswd.py @@ -5,4 +5,4 @@ class TestChpasswd: @pytest.mark.complete("chpasswd -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_chromium_browser.py b/test/t/test_chromium_browser.py index a175b34b673..58695f945db 100644 --- a/test/t/test_chromium_browser.py +++ b/test/t/test_chromium_browser.py @@ -8,9 +8,9 @@ class TestChromiumBrowser: @pytest.mark.complete("chromium-browser ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("chromium-browser -") def test_2(self, completion): - assert completion.list - assert not completion.output.endswith(" ") + assert completion + assert not completion.endswith(" ") diff --git a/test/t/test_chronyc.py b/test/t/test_chronyc.py index d54b623ed87..b221013ce00 100644 --- a/test/t/test_chronyc.py +++ b/test/t/test_chronyc.py @@ -5,8 +5,8 @@ class TestChronyc: @pytest.mark.complete("chronyc ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("chronyc -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_chroot.py b/test/t/test_chroot.py index a7cb369df4e..41d00ae3bb5 100644 --- a/test/t/test_chroot.py +++ b/test/t/test_chroot.py @@ -5,4 +5,4 @@ class TestChroot: @pytest.mark.complete("chroot ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_chrpath.py b/test/t/test_chrpath.py index 8922c428dcd..40a4a7e1d25 100644 --- a/test/t/test_chrpath.py +++ b/test/t/test_chrpath.py @@ -5,8 +5,8 @@ class TestChrpath: @pytest.mark.complete("chrpath ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("chrpath -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_chsh.py b/test/t/test_chsh.py index 7b94cd40fe1..59866f5de48 100644 --- a/test/t/test_chsh.py +++ b/test/t/test_chsh.py @@ -5,8 +5,8 @@ class TestChsh: @pytest.mark.complete("chsh ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("chsh -s ") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ci.py b/test/t/test_ci.py index 902f29e99a9..ac88903e9a1 100644 --- a/test/t/test_ci.py +++ b/test/t/test_ci.py @@ -5,4 +5,4 @@ class TestCi: @pytest.mark.complete("ci ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ciptool.py b/test/t/test_ciptool.py index 2f56011adec..086023da462 100644 --- a/test/t/test_ciptool.py +++ b/test/t/test_ciptool.py @@ -5,4 +5,4 @@ class TestCiptool: @pytest.mark.complete("ciptool ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_civclient.py b/test/t/test_civclient.py index 3f72a346707..99e0c7641d3 100644 --- a/test/t/test_civclient.py +++ b/test/t/test_civclient.py @@ -5,4 +5,4 @@ class TestCivclient: @pytest.mark.complete("civclient -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_civserver.py b/test/t/test_civserver.py index 3c6c1ab3f94..991dea41559 100644 --- a/test/t/test_civserver.py +++ b/test/t/test_civserver.py @@ -5,4 +5,4 @@ class TestCivserver: @pytest.mark.complete("civserver -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_cksfv.py b/test/t/test_cksfv.py index ec2cff5fc35..d8a5c477105 100644 --- a/test/t/test_cksfv.py +++ b/test/t/test_cksfv.py @@ -5,4 +5,4 @@ class TestCksfv: @pytest.mark.complete("cksfv -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_cleanarch.py b/test/t/test_cleanarch.py index 33cec2aa38e..9f3a7fd140d 100644 --- a/test/t/test_cleanarch.py +++ b/test/t/test_cleanarch.py @@ -10,4 +10,4 @@ class TestCleanarch: @pytest.mark.complete("cleanarch -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_clisp.py b/test/t/test_clisp.py index 8f0a4e11c39..8c317923717 100644 --- a/test/t/test_clisp.py +++ b/test/t/test_clisp.py @@ -5,4 +5,4 @@ class TestClisp: @pytest.mark.complete("clisp ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_clone_member.py b/test/t/test_clone_member.py index 1a53f46c22a..1ee003b482a 100644 --- a/test/t/test_clone_member.py +++ b/test/t/test_clone_member.py @@ -5,4 +5,4 @@ class TestCloneMember: @pytest.mark.complete("clone_member -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_co.py b/test/t/test_co.py index 3404b424426..f20f8294f73 100644 --- a/test/t/test_co.py +++ b/test/t/test_co.py @@ -5,4 +5,4 @@ class TestCo: @pytest.mark.complete("co ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_compare.py b/test/t/test_compare.py index 5da42e3e483..8a6996a0693 100644 --- a/test/t/test_compare.py +++ b/test/t/test_compare.py @@ -5,4 +5,4 @@ class TestCompare: @pytest.mark.complete("compare ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_complete.py b/test/t/test_complete.py index 47f1bef9e8e..084f8f45fc3 100644 --- a/test/t/test_complete.py +++ b/test/t/test_complete.py @@ -5,4 +5,4 @@ class TestComplete: @pytest.mark.complete("complete -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_composite.py b/test/t/test_composite.py index 5820b428f62..5b58f2d7897 100644 --- a/test/t/test_composite.py +++ b/test/t/test_composite.py @@ -5,4 +5,4 @@ class TestComposite: @pytest.mark.complete("composite ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_config_list.py b/test/t/test_config_list.py index d86f5019f91..cb344b6d609 100644 --- a/test/t/test_config_list.py +++ b/test/t/test_config_list.py @@ -5,4 +5,4 @@ class TestConfigList: @pytest.mark.complete("config_list -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_configure.py b/test/t/test_configure.py index 3cd9e80dab5..5c245e20e1d 100644 --- a/test/t/test_configure.py +++ b/test/t/test_configure.py @@ -11,8 +11,8 @@ class TestConfigure: @pytest.mark.complete("configure --") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("configure --prefix ") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_conjure.py b/test/t/test_conjure.py index 1d74f584279..e748a1ffd9e 100644 --- a/test/t/test_conjure.py +++ b/test/t/test_conjure.py @@ -5,4 +5,4 @@ class TestConjure: @pytest.mark.complete("conjure ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_convert.py b/test/t/test_convert.py index 9317aa0894b..fff407e7f04 100644 --- a/test/t/test_convert.py +++ b/test/t/test_convert.py @@ -5,8 +5,8 @@ class TestConvert: @pytest.mark.complete("convert ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("convert -format ") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_cowsay.py b/test/t/test_cowsay.py index 0f6ce0781c1..8b7da13ac44 100644 --- a/test/t/test_cowsay.py +++ b/test/t/test_cowsay.py @@ -5,4 +5,4 @@ class TestCowsay: @pytest.mark.complete("cowsay ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_cp.py b/test/t/test_cp.py index b974e2d9343..93f41e5c33d 100644 --- a/test/t/test_cp.py +++ b/test/t/test_cp.py @@ -5,4 +5,4 @@ class TestCp: @pytest.mark.complete("cp ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_cpan2dist.py b/test/t/test_cpan2dist.py index f6901056a4b..42473bc3325 100644 --- a/test/t/test_cpan2dist.py +++ b/test/t/test_cpan2dist.py @@ -5,4 +5,4 @@ class TestCpan2dist: @pytest.mark.complete("cpan2dist -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_cpio.py b/test/t/test_cpio.py index 51fd4e85f4c..fb2eedb51df 100644 --- a/test/t/test_cpio.py +++ b/test/t/test_cpio.py @@ -7,10 +7,10 @@ class TestCpio: @pytest.mark.complete("cpio --") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("cpio -R ") def test_2(self, bash, completion): users = sorted(assert_bash_exec( bash, "compgen -A user", want_output=True).split()) - assert completion.list == users + assert completion == users diff --git a/test/t/test_cplusplus.py b/test/t/test_cplusplus.py index 12469018f33..239c71103e9 100644 --- a/test/t/test_cplusplus.py +++ b/test/t/test_cplusplus.py @@ -6,4 +6,4 @@ class TestCPlusPlus: @pytest.mark.complete("c++ ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_cppcheck.py b/test/t/test_cppcheck.py index 07ba0060486..05cb630d635 100644 --- a/test/t/test_cppcheck.py +++ b/test/t/test_cppcheck.py @@ -5,28 +5,28 @@ class TestCppcheck: @pytest.mark.complete("cppcheck ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("cppcheck -") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("cppcheck -DFOO=BAR ") def test_3(self, completion): - assert completion.list + assert completion @pytest.mark.complete("cppcheck -D ") def test_4(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("cppcheck --enable=al") def test_5(self, completion): - assert completion.list == ["--enable=all"] + assert completion == "--enable=all" @pytest.mark.complete("cppcheck --enable=xx,styl") def test_6(self, completion): - assert completion.list == ["--enable=xx,style"] + assert completion == "--enable=xx,style" @pytest.mark.complete("cppcheck --enable=xx,yy,styl") def test_7(self, completion): - assert completion.list == ["--enable=xx,yy,style"] + assert completion == "--enable=xx,yy,style" diff --git a/test/t/test_createdb.py b/test/t/test_createdb.py index 3c12aa40010..672196cc4e0 100644 --- a/test/t/test_createdb.py +++ b/test/t/test_createdb.py @@ -7,4 +7,4 @@ class TestCreatedb: @pytest.mark.complete("createdb -", skipif="! createdb --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_createuser.py b/test/t/test_createuser.py index 783c52b78f0..d8e5a04e741 100644 --- a/test/t/test_createuser.py +++ b/test/t/test_createuser.py @@ -7,4 +7,4 @@ class TestCreateuser: @pytest.mark.complete("createuser -", skipif="! createuser --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_crontab.py b/test/t/test_crontab.py index d18a0d840f9..ca0e6038785 100644 --- a/test/t/test_crontab.py +++ b/test/t/test_crontab.py @@ -5,4 +5,4 @@ class TestCrontab: @pytest.mark.complete("crontab ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_cryptsetup.py b/test/t/test_cryptsetup.py index 581d1a82b10..b1c61c97758 100644 --- a/test/t/test_cryptsetup.py +++ b/test/t/test_cryptsetup.py @@ -5,4 +5,4 @@ class TestCryptsetup: @pytest.mark.complete("cryptsetup ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_csplit.py b/test/t/test_csplit.py index e97c89922f0..27fde525daa 100644 --- a/test/t/test_csplit.py +++ b/test/t/test_csplit.py @@ -5,4 +5,4 @@ class TestCsplit: @pytest.mark.complete("csplit ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_curl.py b/test/t/test_curl.py index f47f5cac171..9cdb2a623a3 100644 --- a/test/t/test_curl.py +++ b/test/t/test_curl.py @@ -5,16 +5,16 @@ class TestCurl: @pytest.mark.complete("curl --h") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("curl -o f", cwd="shared/default/foo.d") def test_2(self, completion): - assert completion.list == ["foo"] + assert completion == "foo" @pytest.mark.complete("curl -LRo f", cwd="shared/default/foo.d") def test_3(self, completion): - assert completion.list == ["foo"] + assert completion == "foo" @pytest.mark.complete("curl --o f") def test_4(self, completion): - assert not completion.list + assert not completion diff --git a/test/t/test_cut.py b/test/t/test_cut.py index f3615967ec4..08ed32de9a4 100644 --- a/test/t/test_cut.py +++ b/test/t/test_cut.py @@ -5,4 +5,4 @@ class TestCut: @pytest.mark.complete("cut ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_cvs.py b/test/t/test_cvs.py index 65b3397b576..20ecfc77aea 100644 --- a/test/t/test_cvs.py +++ b/test/t/test_cvs.py @@ -10,12 +10,12 @@ class TestCvs: @pytest.mark.complete("cvs ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("cvs -d ") def test_2(self, completion): - assert [x for x in completion.list if ":pserver:" in x] + assert [x for x in completion if ":pserver:" in x] @pytest.mark.complete("cvs diff foo/", cwd="cvs") def test_3(self, completion): - assert completion.list == ["foo/bar"] + assert completion == "foo/bar" diff --git a/test/t/test_cvsps.py b/test/t/test_cvsps.py index 8f357e678a0..a42b87d5bb4 100644 --- a/test/t/test_cvsps.py +++ b/test/t/test_cvsps.py @@ -10,8 +10,8 @@ class TestCvsps: @pytest.mark.complete("cvsps -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("cvsps ") def test_2(self, completion): - assert [x for x in completion.list if ":pserver:" in x] + assert [x for x in completion if ":pserver:" in x] diff --git a/test/t/test_date.py b/test/t/test_date.py index 49463904702..8d3152fc4af 100644 --- a/test/t/test_date.py +++ b/test/t/test_date.py @@ -5,4 +5,4 @@ class TestDate: @pytest.mark.complete("date ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_dcop.py b/test/t/test_dcop.py index 1239689d75e..c184159400f 100644 --- a/test/t/test_dcop.py +++ b/test/t/test_dcop.py @@ -10,6 +10,6 @@ def test_1(self, completion): try: subprocess.check_call("dcop &>/dev/null", shell=True) except BaseException: - assert not completion.list + assert not completion else: - assert completion.list + assert completion diff --git a/test/t/test_dd.py b/test/t/test_dd.py index 90a85b11189..0cc75eb71fb 100644 --- a/test/t/test_dd.py +++ b/test/t/test_dd.py @@ -5,8 +5,8 @@ class TestDd: @pytest.mark.complete("dd --") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("dd bs") def test_2(self, completion): - assert completion.list == ["bs="] + assert completion == "bs=" diff --git a/test/t/test_declare.py b/test/t/test_declare.py index d5a39a395c3..6e3ddb09bdf 100644 --- a/test/t/test_declare.py +++ b/test/t/test_declare.py @@ -5,16 +5,16 @@ class TestDeclare: @pytest.mark.complete("declare -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("declare +") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("declare -p BASH_ARG") def test_3(self, completion): - assert completion.list == "BASH_ARGC BASH_ARGV".split() + assert completion == "BASH_ARGC BASH_ARGV".split() @pytest.mark.complete("declare -f _parse_") def test_4(self, completion): - assert "_parse_help" in completion.list + assert "_parse_help" in completion diff --git a/test/t/test_deja_dup.py b/test/t/test_deja_dup.py index 79f770507c4..0fa3b25eeb0 100644 --- a/test/t/test_deja_dup.py +++ b/test/t/test_deja_dup.py @@ -8,8 +8,8 @@ class TestDejaDup: @pytest.mark.complete("deja-dup -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("deja-dup --help ") def test_2(self, completion): - assert not completion.list + assert not completion diff --git a/test/t/test_desktop_file_validate.py b/test/t/test_desktop_file_validate.py index c80cd86dcf5..018766f01bc 100644 --- a/test/t/test_desktop_file_validate.py +++ b/test/t/test_desktop_file_validate.py @@ -8,4 +8,4 @@ class TestDesktopFileValidate: @pytest.mark.complete("desktop-file-validate ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_df.py b/test/t/test_df.py index 08783927ed7..53be7f89de3 100644 --- a/test/t/test_df.py +++ b/test/t/test_df.py @@ -5,4 +5,4 @@ class TestDf: @pytest.mark.complete("df ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_dfutool.py b/test/t/test_dfutool.py index 68d7b78e458..b1a0f8d70a2 100644 --- a/test/t/test_dfutool.py +++ b/test/t/test_dfutool.py @@ -5,4 +5,4 @@ class TestDfutool: @pytest.mark.complete("dfutool ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_dhclient.py b/test/t/test_dhclient.py index 1807b6cf909..3dcceead67a 100644 --- a/test/t/test_dhclient.py +++ b/test/t/test_dhclient.py @@ -5,4 +5,4 @@ class TestDhclient: @pytest.mark.complete("dhclient -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_dict.py b/test/t/test_dict.py index 9de9aa59b41..d635be36d8a 100644 --- a/test/t/test_dict.py +++ b/test/t/test_dict.py @@ -5,4 +5,4 @@ class TestDict: @pytest.mark.complete("dict -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_diff.py b/test/t/test_diff.py index 04dedb909ca..478a7b6fa32 100644 --- a/test/t/test_diff.py +++ b/test/t/test_diff.py @@ -5,4 +5,4 @@ class TestDiff: @pytest.mark.complete("diff --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_dir.py b/test/t/test_dir.py index 8c862b21464..ab81308facd 100644 --- a/test/t/test_dir.py +++ b/test/t/test_dir.py @@ -5,4 +5,4 @@ class TestDir: @pytest.mark.complete("dir ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_display.py b/test/t/test_display.py index adf5c8eb85e..422f95e6548 100644 --- a/test/t/test_display.py +++ b/test/t/test_display.py @@ -5,8 +5,8 @@ class TestDisplay: @pytest.mark.complete("display ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("display -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_dmesg.py b/test/t/test_dmesg.py index 52abe954913..e09e956df08 100644 --- a/test/t/test_dmesg.py +++ b/test/t/test_dmesg.py @@ -5,4 +5,4 @@ class TestDmesg: @pytest.mark.complete("dmesg -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_dnsspoof.py b/test/t/test_dnsspoof.py index a0e82f31b22..39725df528b 100644 --- a/test/t/test_dnsspoof.py +++ b/test/t/test_dnsspoof.py @@ -5,4 +5,4 @@ class TestDnsspoof: @pytest.mark.complete("dnsspoof -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_dot.py b/test/t/test_dot.py index 3f8e2245579..c3964718eee 100644 --- a/test/t/test_dot.py +++ b/test/t/test_dot.py @@ -5,4 +5,4 @@ class TestDot: @pytest.mark.complete("dot ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_dpkg.py b/test/t/test_dpkg.py index 05fbc96017f..feca081ffbb 100644 --- a/test/t/test_dpkg.py +++ b/test/t/test_dpkg.py @@ -5,13 +5,13 @@ class TestDpkg: @pytest.mark.complete("dpkg --c") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("dpkg -L ", skipif='test -z "$(dpkg -l 2>/dev/null)"') def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("dpkg -i ~") def test_3(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_dpkg_deb.py b/test/t/test_dpkg_deb.py index 745df129790..1d156793342 100644 --- a/test/t/test_dpkg_deb.py +++ b/test/t/test_dpkg_deb.py @@ -8,4 +8,4 @@ class TestDpkgDeb: @pytest.mark.complete("dpkg-deb --c") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_dpkg_reconfigure.py b/test/t/test_dpkg_reconfigure.py index a64e8c65d92..15108ea93f5 100644 --- a/test/t/test_dpkg_reconfigure.py +++ b/test/t/test_dpkg_reconfigure.py @@ -8,4 +8,4 @@ class TestDpkgReconfigure: @pytest.mark.complete("dpkg-reconfigure --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_dpkg_source.py b/test/t/test_dpkg_source.py index 7d3216df5ca..a4652b5acfb 100644 --- a/test/t/test_dpkg_source.py +++ b/test/t/test_dpkg_source.py @@ -8,4 +8,4 @@ class TestDpkgSource: @pytest.mark.complete("dpkg-source -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_dropdb.py b/test/t/test_dropdb.py index 6e2bf45e7fd..5b36b56ec9a 100644 --- a/test/t/test_dropdb.py +++ b/test/t/test_dropdb.py @@ -7,4 +7,4 @@ class TestDropdb: @pytest.mark.complete("dropdb -", skipif="! dropdb --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_dropuser.py b/test/t/test_dropuser.py index e8622976010..1c4e152eb39 100644 --- a/test/t/test_dropuser.py +++ b/test/t/test_dropuser.py @@ -5,4 +5,4 @@ class TestDropuser: @pytest.mark.complete("dropuser ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_dselect.py b/test/t/test_dselect.py index 6e08ccfac98..e9cae2e55ea 100644 --- a/test/t/test_dselect.py +++ b/test/t/test_dselect.py @@ -5,8 +5,8 @@ class TestDselect: @pytest.mark.complete("dselect ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("dselect -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_dsniff.py b/test/t/test_dsniff.py index 76b420eb548..793bc08cf43 100644 --- a/test/t/test_dsniff.py +++ b/test/t/test_dsniff.py @@ -5,4 +5,4 @@ class TestDsniff: @pytest.mark.complete("dsniff -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_du.py b/test/t/test_du.py index 7b05de1c7d2..d026840a2f7 100644 --- a/test/t/test_du.py +++ b/test/t/test_du.py @@ -5,4 +5,4 @@ class TestDu: @pytest.mark.complete("du ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_dumpdb.py b/test/t/test_dumpdb.py index b9b9540d2d5..7c21fca852d 100644 --- a/test/t/test_dumpdb.py +++ b/test/t/test_dumpdb.py @@ -10,4 +10,4 @@ class TestDumpdb: @pytest.mark.complete("dumpdb ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_dumpe2fs.py b/test/t/test_dumpe2fs.py index 84c03ef08ce..b5ca6a25075 100644 --- a/test/t/test_dumpe2fs.py +++ b/test/t/test_dumpe2fs.py @@ -5,4 +5,4 @@ class TestDumpe2fs: @pytest.mark.complete("dumpe2fs ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_e2freefrag.py b/test/t/test_e2freefrag.py index 1e9f887c691..0201d96e442 100644 --- a/test/t/test_e2freefrag.py +++ b/test/t/test_e2freefrag.py @@ -5,4 +5,4 @@ class TestE2freefrag: @pytest.mark.complete("e2freefrag ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_e2label.py b/test/t/test_e2label.py index bfa71ac3127..788ee74be73 100644 --- a/test/t/test_e2label.py +++ b/test/t/test_e2label.py @@ -5,4 +5,4 @@ class TestE2label: @pytest.mark.complete("e2label ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ebtables.py b/test/t/test_ebtables.py index b2593c956cf..1ea89d3e8e6 100644 --- a/test/t/test_ebtables.py +++ b/test/t/test_ebtables.py @@ -5,4 +5,4 @@ class TestEbtables: @pytest.mark.complete("ebtables -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ecryptfs_migrate_home.py b/test/t/test_ecryptfs_migrate_home.py index 10ae84fbffb..08f407e7856 100644 --- a/test/t/test_ecryptfs_migrate_home.py +++ b/test/t/test_ecryptfs_migrate_home.py @@ -8,4 +8,4 @@ class TestEcryptfsMigrateHome: @pytest.mark.complete("ecryptfs-migrate-home ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_eject.py b/test/t/test_eject.py index 9598665f2d2..e7c65a4c78d 100644 --- a/test/t/test_eject.py +++ b/test/t/test_eject.py @@ -5,4 +5,4 @@ class TestEject: @pytest.mark.complete("eject -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_enscript.py b/test/t/test_enscript.py index 21050823a29..d5f6d1e0521 100644 --- a/test/t/test_enscript.py +++ b/test/t/test_enscript.py @@ -5,4 +5,4 @@ class TestEnscript: @pytest.mark.complete("enscript --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_env.py b/test/t/test_env.py index 1bb92de0dee..90663483ece 100644 --- a/test/t/test_env.py +++ b/test/t/test_env.py @@ -6,4 +6,4 @@ class TestEnv: @pytest.mark.complete("env --", skipif="! env --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_eog.py b/test/t/test_eog.py index b1fbdd536a7..cb127340742 100644 --- a/test/t/test_eog.py +++ b/test/t/test_eog.py @@ -5,4 +5,4 @@ class TestEog: @pytest.mark.complete("eog ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ether_wake.py b/test/t/test_ether_wake.py index 405d0faf3a7..57bde949fd9 100644 --- a/test/t/test_ether_wake.py +++ b/test/t/test_ether_wake.py @@ -8,4 +8,4 @@ class TestEtherWake: @pytest.mark.complete("ether-wake ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_etherwake.py b/test/t/test_etherwake.py index 335741bf087..ac613d35eee 100644 --- a/test/t/test_etherwake.py +++ b/test/t/test_etherwake.py @@ -5,4 +5,4 @@ class TestEtherwake: @pytest.mark.complete("etherwake -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_evince.py b/test/t/test_evince.py index 7c4483470a4..eec8922e838 100644 --- a/test/t/test_evince.py +++ b/test/t/test_evince.py @@ -6,7 +6,7 @@ class TestEvince: @pytest.mark.complete("evince ", cwd="evince") def test_1(self, completion): # .txt should not be here - assert completion.list == sorted( + assert completion == sorted( "foo/ .bmp .BMP .cbr .CBR .cbz .CBZ .djv .DJV .djvu .DJVU .dvi " ".DVI .dvi.bz2 .dvi.BZ2 .DVI.bz2 .DVI.BZ2 .dvi.gz .dvi.GZ " ".DVI.gz .DVI.GZ .eps .EPS .eps.bz2 .eps.BZ2 .EPS.bz2 .EPS.BZ2 " diff --git a/test/t/test_expand.py b/test/t/test_expand.py index 013ac459e67..5099480e7bc 100644 --- a/test/t/test_expand.py +++ b/test/t/test_expand.py @@ -6,4 +6,4 @@ class TestExpand: @pytest.mark.complete("expand --", skipif="! expand --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_explodepkg.py b/test/t/test_explodepkg.py index 04b32aaaed2..79d7e82bf2d 100644 --- a/test/t/test_explodepkg.py +++ b/test/t/test_explodepkg.py @@ -14,4 +14,4 @@ def test_1(self, completion): or (os.path.isfile("./%s" % x) and fnmatch.fnmatch(x, "*.t[bglx]z")) ) - assert completion.list == expected + assert completion == expected diff --git a/test/t/test_export.py b/test/t/test_export.py index 20b4f4e15ed..22469eb5a11 100644 --- a/test/t/test_export.py +++ b/test/t/test_export.py @@ -5,34 +5,33 @@ class TestExport: @pytest.mark.complete("export BASH") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("export -n BASH") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("export -p ") def test_3(self, completion): - assert not completion.list + assert not completion - @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("export FOO=", cwd="shared/default") def test_4(self, completion): - assert completion.list == ["bar", "bar bar.d/", "foo", "foo.d/"] + assert completion == ["bar", "bar bar.d/", "foo", "foo.d/"] @pytest.mark.complete("export FOO=f", cwd="shared/default") def test_5(self, completion): - assert completion.list == ["foo", "foo.d/"] + assert completion == ["foo", "foo.d/"] @pytest.mark.complete("export -fn _ex") def test_6(self, completion): - assert "_expand" in completion.list - assert "_export" in completion.list + assert "_expand" in completion + assert "_export" in completion @pytest.mark.complete(r"export FOO=$BASH") def test_7(self, completion): - assert completion.list + assert completion @pytest.mark.complete("export -") def test_8(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_faillog.py b/test/t/test_faillog.py index 0b6bd5ee7c8..d71a2d6c75e 100644 --- a/test/t/test_faillog.py +++ b/test/t/test_faillog.py @@ -5,4 +5,4 @@ class TestFaillog: @pytest.mark.complete("faillog -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_fbgs.py b/test/t/test_fbgs.py index d6cf9237d58..fc949d2dec3 100644 --- a/test/t/test_fbgs.py +++ b/test/t/test_fbgs.py @@ -5,4 +5,4 @@ class TestFbgs: @pytest.mark.complete("fbgs ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_fbi.py b/test/t/test_fbi.py index 87ca4d553e3..14c3c86bc34 100644 --- a/test/t/test_fbi.py +++ b/test/t/test_fbi.py @@ -5,4 +5,4 @@ class TestFbi: @pytest.mark.complete("fbi ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_feh.py b/test/t/test_feh.py index 96ae9364d54..16eeb0d31f8 100644 --- a/test/t/test_feh.py +++ b/test/t/test_feh.py @@ -5,25 +5,25 @@ class TestFeh: @pytest.mark.complete("feh ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("feh --lis", skipif="feh --help 2>&1 | grep -qF 'man feh'") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("feh -S pix") def test_3(self, completion): - assert completion.list == ["pixels"] + assert completion == "pixels" @pytest.mark.complete("feh --zoom ma") def test_4(self, completion): - assert completion.list == ["max"] + assert completion == "max" @pytest.mark.complete("feh -g 640") def test_5(self, completion): - assert completion.list == "0 1 2 3 4 5 6 7 8 9 x".split() + assert completion == "0 1 2 3 4 5 6 7 8 9 x".split() @pytest.mark.complete("feh -g 640x48") def test_6(self, completion): - assert completion.list == "0 1 2 3 4 5 6 7 8 9".split() + assert completion == "0 1 2 3 4 5 6 7 8 9".split() diff --git a/test/t/test_file.py b/test/t/test_file.py index b3c86745f11..60ad77dda63 100644 --- a/test/t/test_file.py +++ b/test/t/test_file.py @@ -5,8 +5,8 @@ class TestFile: @pytest.mark.complete("file ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("file -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_file_roller.py b/test/t/test_file_roller.py index 55e62a2dcee..bff61e09bb7 100644 --- a/test/t/test_file_roller.py +++ b/test/t/test_file_roller.py @@ -8,4 +8,4 @@ class TestFileRoller: @pytest.mark.complete("file-roller ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_filefrag.py b/test/t/test_filefrag.py index cb4f5ed3f06..a4569d370f4 100644 --- a/test/t/test_filefrag.py +++ b/test/t/test_filefrag.py @@ -5,4 +5,4 @@ class TestFilefrag: @pytest.mark.complete("filefrag ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_filesnarf.py b/test/t/test_filesnarf.py index 6ae79312fdd..1dd55b820ac 100644 --- a/test/t/test_filesnarf.py +++ b/test/t/test_filesnarf.py @@ -5,4 +5,4 @@ class TestFilesnarf: @pytest.mark.complete("filesnarf -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_find.py b/test/t/test_find.py index 219c9be88bc..360c8e39a83 100644 --- a/test/t/test_find.py +++ b/test/t/test_find.py @@ -5,25 +5,25 @@ class TestFind: @pytest.mark.complete("find ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("find -fstype ") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("find -") def test_3(self, completion): - assert completion.list + assert completion @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("find -wholename ", cwd="shared/default") def test_4(self, completion): - assert completion.list == ["bar", "bar bar.d/", "foo", "foo foo.d/"] + assert completion == ["bar", "bar bar.d/", "foo", "foo foo.d/"] @pytest.mark.complete("find -uid ") def test_5(self, completion): - assert not [x for x in completion.list if not x.isdigit()] + assert not [x for x in completion if not x.isdigit()] @pytest.mark.complete("find -gid ") def test_6(self, completion): - assert not [x for x in completion.list if not x.isdigit()] + assert not [x for x in completion if not x.isdigit()] diff --git a/test/t/test_find_member.py b/test/t/test_find_member.py index 18384efb848..334608ac187 100644 --- a/test/t/test_find_member.py +++ b/test/t/test_find_member.py @@ -5,4 +5,4 @@ class TestFindMember: @pytest.mark.complete("find_member -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_finger.py b/test/t/test_finger.py index deb1fc46511..9c567324f2f 100644 --- a/test/t/test_finger.py +++ b/test/t/test_finger.py @@ -9,4 +9,4 @@ class TestFinger: def test_1(self, bash, completion): users_at = sorted(assert_bash_exec( bash, "compgen -A user -S @", want_output=True).split()) - assert completion.list == users_at + assert completion == users_at diff --git a/test/t/test_fio.py b/test/t/test_fio.py index 1a0e349bdba..e1b493c6b6c 100644 --- a/test/t/test_fio.py +++ b/test/t/test_fio.py @@ -5,12 +5,12 @@ class TestFio: @pytest.mark.complete("fio ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("fio --") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("fio --debug=foo,") def test_3(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_firefox.py b/test/t/test_firefox.py index 8096abc7f16..de4a2b2093a 100644 --- a/test/t/test_firefox.py +++ b/test/t/test_firefox.py @@ -5,9 +5,9 @@ class TestFirefox: @pytest.mark.complete("firefox ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("firefox -") def test_2(self, completion): - assert completion.list - assert not completion.output.endswith(" ") + assert completion + assert not completion.endswith(" ") diff --git a/test/t/test_flake8.py b/test/t/test_flake8.py index a53bf6cdd7e..1a18dbd404f 100644 --- a/test/t/test_flake8.py +++ b/test/t/test_flake8.py @@ -8,12 +8,12 @@ class TestFlake8: @pytest.mark.complete("flake8 ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("flake8 -") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("flake8 --doesnt-exist=") def test_3(self, completion): - assert not completion.list + assert not completion diff --git a/test/t/test_fmt.py b/test/t/test_fmt.py index eb3efb22d2c..ceed737b50b 100644 --- a/test/t/test_fmt.py +++ b/test/t/test_fmt.py @@ -6,4 +6,4 @@ class TestFmt: @pytest.mark.complete("fmt -", skipif="! fmt --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_fold.py b/test/t/test_fold.py index 7166e8deb20..dc0d924b7af 100644 --- a/test/t/test_fold.py +++ b/test/t/test_fold.py @@ -6,4 +6,4 @@ class TestFold: @pytest.mark.complete("fold --", skipif="! fold --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_freebsd_update.py b/test/t/test_freebsd_update.py index 9aa3dd0981c..51a26ba7a29 100644 --- a/test/t/test_freebsd_update.py +++ b/test/t/test_freebsd_update.py @@ -8,4 +8,4 @@ class TestFreebsdUpdate: @pytest.mark.complete("freebsd-update ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_freeciv.py b/test/t/test_freeciv.py index 2a8250e7751..81192b11927 100644 --- a/test/t/test_freeciv.py +++ b/test/t/test_freeciv.py @@ -5,4 +5,4 @@ class TestFreeciv: @pytest.mark.complete("freeciv -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_freeciv_server.py b/test/t/test_freeciv_server.py index b2c277a3c2e..8bbd39d44c8 100644 --- a/test/t/test_freeciv_server.py +++ b/test/t/test_freeciv_server.py @@ -8,4 +8,4 @@ class TestFreecivServer: @pytest.mark.complete("freeciv-server -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_function.py b/test/t/test_function.py index fe55d1b17a3..2bc41d59af1 100644 --- a/test/t/test_function.py +++ b/test/t/test_function.py @@ -5,4 +5,4 @@ class TestFunction: @pytest.mark.complete("function _parse_") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_fusermount.py b/test/t/test_fusermount.py index eb006f569d1..25a71d0ecb9 100644 --- a/test/t/test_fusermount.py +++ b/test/t/test_fusermount.py @@ -5,4 +5,4 @@ class TestFusermount: @pytest.mark.complete("fusermount ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_g4.py b/test/t/test_g4.py index fc7e0a23aea..330d2e8bbf6 100644 --- a/test/t/test_g4.py +++ b/test/t/test_g4.py @@ -5,4 +5,4 @@ class TestG4: @pytest.mark.complete("g4 ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_g77.py b/test/t/test_g77.py index 2d6bd86dee2..08518469f07 100644 --- a/test/t/test_g77.py +++ b/test/t/test_g77.py @@ -5,4 +5,4 @@ class TestG77: @pytest.mark.complete("g77 ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gcc.py b/test/t/test_gcc.py index 17e94379cfd..b6099444271 100644 --- a/test/t/test_gcc.py +++ b/test/t/test_gcc.py @@ -5,4 +5,4 @@ class TestGcc: @pytest.mark.complete("gcc ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gcj.py b/test/t/test_gcj.py index 3a5a93ef26c..c9438291a02 100644 --- a/test/t/test_gcj.py +++ b/test/t/test_gcj.py @@ -5,4 +5,4 @@ class TestGcj: @pytest.mark.complete("gcj ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gcl.py b/test/t/test_gcl.py index f4d7cc02a33..ba2ba1fe8f5 100644 --- a/test/t/test_gcl.py +++ b/test/t/test_gcl.py @@ -5,4 +5,4 @@ class TestGcl: @pytest.mark.complete("gcl ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gdb.py b/test/t/test_gdb.py index 1d4d0558a9d..3627fb8cc34 100644 --- a/test/t/test_gdb.py +++ b/test/t/test_gdb.py @@ -5,4 +5,4 @@ class TestGdb: @pytest.mark.complete("gdb - ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_genaliases.py b/test/t/test_genaliases.py index de266de58ba..9ace72aca41 100644 --- a/test/t/test_genaliases.py +++ b/test/t/test_genaliases.py @@ -10,4 +10,4 @@ class TestGenaliases: @pytest.mark.complete("genaliases -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gendiff.py b/test/t/test_gendiff.py index af6934f1ba6..0aec0459294 100644 --- a/test/t/test_gendiff.py +++ b/test/t/test_gendiff.py @@ -5,4 +5,4 @@ class TestGendiff: @pytest.mark.complete("gendiff ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_genisoimage.py b/test/t/test_genisoimage.py index 402b2f26242..2a2ed4997c2 100644 --- a/test/t/test_genisoimage.py +++ b/test/t/test_genisoimage.py @@ -5,4 +5,4 @@ class TestGenisoimage: @pytest.mark.complete("genisoimage ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_geoiplookup.py b/test/t/test_geoiplookup.py index f7b965d9888..a2e72b813cf 100644 --- a/test/t/test_geoiplookup.py +++ b/test/t/test_geoiplookup.py @@ -5,4 +5,4 @@ class TestGeoiplookup: @pytest.mark.complete("geoiplookup -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_getconf.py b/test/t/test_getconf.py index e416c3e592c..88165eaf72a 100644 --- a/test/t/test_getconf.py +++ b/test/t/test_getconf.py @@ -5,20 +5,20 @@ class TestGetconf: @pytest.mark.complete("getconf P") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("getconf -") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("getconf -a ") def test_3(self, completion): - assert completion.list + assert completion @pytest.mark.complete("getconf -v ") def test_4(self, completion): - assert completion.list + assert completion @pytest.mark.complete("getconf PATH_MAX ") def test_5(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_getent.py b/test/t/test_getent.py index f5ad81c0f1f..2ff6542e8c9 100644 --- a/test/t/test_getent.py +++ b/test/t/test_getent.py @@ -5,4 +5,4 @@ class TestGetent: @pytest.mark.complete("getent ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gkrellm.py b/test/t/test_gkrellm.py index cdc628ac2ef..b3189818cda 100644 --- a/test/t/test_gkrellm.py +++ b/test/t/test_gkrellm.py @@ -8,4 +8,4 @@ class TestGkrellm: @pytest.mark.complete("gkrellm -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gm.py b/test/t/test_gm.py index 3cfa534d63a..bd631dd936d 100644 --- a/test/t/test_gm.py +++ b/test/t/test_gm.py @@ -5,16 +5,16 @@ class TestGm: @pytest.mark.complete("gm ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("gm help ") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("gm time ") def test_3(self, completion): - assert completion.list + assert completion @pytest.mark.complete("gm version ") def test_4(self, completion): - assert not completion.list + assert not completion diff --git a/test/t/test_gmplayer.py b/test/t/test_gmplayer.py index d8dcd882a70..2603d3cc692 100644 --- a/test/t/test_gmplayer.py +++ b/test/t/test_gmplayer.py @@ -5,4 +5,4 @@ class TestGmplayer: @pytest.mark.complete("gmplayer ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gnatmake.py b/test/t/test_gnatmake.py index b4cd48b5c17..104ba703652 100644 --- a/test/t/test_gnatmake.py +++ b/test/t/test_gnatmake.py @@ -5,4 +5,4 @@ class TestGnatmake: @pytest.mark.complete("gnatmake ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gnokii.py b/test/t/test_gnokii.py index 867238f36dc..1f1c98a7f6f 100644 --- a/test/t/test_gnokii.py +++ b/test/t/test_gnokii.py @@ -5,4 +5,4 @@ class TestGnokii: @pytest.mark.complete("gnokii ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gnome_mplayer.py b/test/t/test_gnome_mplayer.py index c34b7b720df..bffbed20e6e 100644 --- a/test/t/test_gnome_mplayer.py +++ b/test/t/test_gnome_mplayer.py @@ -8,4 +8,4 @@ class TestGnomeMplayer: @pytest.mark.complete("gnome-mplayer ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gnome_screenshot.py b/test/t/test_gnome_screenshot.py index 9aaba5af446..0448a0ec47e 100644 --- a/test/t/test_gnome_screenshot.py +++ b/test/t/test_gnome_screenshot.py @@ -8,4 +8,4 @@ class TestGnomeScreenshot: @pytest.mark.complete("gnome-screenshot --help") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gpasswd.py b/test/t/test_gpasswd.py index b0dc15e6c3b..fdada2e96bb 100644 --- a/test/t/test_gpasswd.py +++ b/test/t/test_gpasswd.py @@ -5,4 +5,4 @@ class TestGpasswd: @pytest.mark.complete("gpasswd ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gpc.py b/test/t/test_gpc.py index 63d7940313e..ccf67355c02 100644 --- a/test/t/test_gpc.py +++ b/test/t/test_gpc.py @@ -5,4 +5,4 @@ class TestGpc: @pytest.mark.complete("gpc ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gperf.py b/test/t/test_gperf.py index cb5e31c5f60..f6f5f5970d5 100644 --- a/test/t/test_gperf.py +++ b/test/t/test_gperf.py @@ -5,4 +5,4 @@ class TestGperf: @pytest.mark.complete("gperf --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gpg.py b/test/t/test_gpg.py index 18a638d13a9..bee9047397c 100644 --- a/test/t/test_gpg.py +++ b/test/t/test_gpg.py @@ -5,4 +5,4 @@ class TestGpg: @pytest.mark.complete("gpg ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gpg2.py b/test/t/test_gpg2.py index 74aed8523e4..bddd27402c2 100644 --- a/test/t/test_gpg2.py +++ b/test/t/test_gpg2.py @@ -5,4 +5,4 @@ class TestGpg2: @pytest.mark.complete("gpg2 --h") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gpgv.py b/test/t/test_gpgv.py index dc11c22d9be..29a3dc2287a 100644 --- a/test/t/test_gpgv.py +++ b/test/t/test_gpgv.py @@ -5,12 +5,12 @@ class TestGpgv: @pytest.mark.complete("gpgv ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("gpgv -") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("gpgv foo.sig foo ") def test_3(self, completion): - assert not completion.list + assert not completion diff --git a/test/t/test_gphoto2.py b/test/t/test_gphoto2.py index 0e60b5c4cb6..9b96923b15d 100644 --- a/test/t/test_gphoto2.py +++ b/test/t/test_gphoto2.py @@ -5,4 +5,4 @@ class TestGphoto2: @pytest.mark.complete("gphoto2 --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gplusplus.py b/test/t/test_gplusplus.py index e5fe7c7a763..c2ab0d983dd 100644 --- a/test/t/test_gplusplus.py +++ b/test/t/test_gplusplus.py @@ -6,4 +6,4 @@ class TestGPlusPlus: @pytest.mark.complete("g++ ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gprof.py b/test/t/test_gprof.py index 494a88f65bb..195c58d2edc 100644 --- a/test/t/test_gprof.py +++ b/test/t/test_gprof.py @@ -6,4 +6,4 @@ class TestGprof: @pytest.mark.complete("gprof --", skipif="! gprof --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_grep.py b/test/t/test_grep.py index 4ea0e47f51b..64d325569e3 100644 --- a/test/t/test_grep.py +++ b/test/t/test_grep.py @@ -5,4 +5,4 @@ class TestGrep: @pytest.mark.complete("grep --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_groupadd.py b/test/t/test_groupadd.py index 31f59b7020e..126b1656aaf 100644 --- a/test/t/test_groupadd.py +++ b/test/t/test_groupadd.py @@ -5,8 +5,8 @@ class TestGroupadd: @pytest.mark.complete("groupadd ") def test_1(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("groupadd -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_groupdel.py b/test/t/test_groupdel.py index 3aa30f9c143..0f0953350f4 100644 --- a/test/t/test_groupdel.py +++ b/test/t/test_groupdel.py @@ -5,4 +5,4 @@ class TestGroupdel: @pytest.mark.complete("groupdel ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_groupmems.py b/test/t/test_groupmems.py index 1ac9e5b7249..3e454b76eb2 100644 --- a/test/t/test_groupmems.py +++ b/test/t/test_groupmems.py @@ -5,4 +5,4 @@ class TestGroupmems: @pytest.mark.complete("groupmems -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_groupmod.py b/test/t/test_groupmod.py index cc74eee4e75..1e471a3b0a5 100644 --- a/test/t/test_groupmod.py +++ b/test/t/test_groupmod.py @@ -5,8 +5,8 @@ class TestGroupmod: @pytest.mark.complete("groupmod ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("groupmod -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_growisofs.py b/test/t/test_growisofs.py index 36654d98bb3..4e314aed898 100644 --- a/test/t/test_growisofs.py +++ b/test/t/test_growisofs.py @@ -5,4 +5,4 @@ class TestGrowisofs: @pytest.mark.complete("growisofs ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_grpck.py b/test/t/test_grpck.py index 91db06426f2..f46a62eebad 100644 --- a/test/t/test_grpck.py +++ b/test/t/test_grpck.py @@ -5,8 +5,8 @@ class TestGrpck: @pytest.mark.complete("grpck ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("grpck -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_grub.py b/test/t/test_grub.py index dda2b534a92..e26d5fa95df 100644 --- a/test/t/test_grub.py +++ b/test/t/test_grub.py @@ -5,4 +5,4 @@ class TestGrub: @pytest.mark.complete("grub --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_gzip.py b/test/t/test_gzip.py index c6b15bbff8b..80468eab703 100644 --- a/test/t/test_gzip.py +++ b/test/t/test_gzip.py @@ -5,8 +5,8 @@ class TestGzip: @pytest.mark.complete("gzip ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("gzip ~") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_hciattach.py b/test/t/test_hciattach.py index 7538bc63d71..e631af44c65 100644 --- a/test/t/test_hciattach.py +++ b/test/t/test_hciattach.py @@ -5,4 +5,4 @@ class TestHciattach: @pytest.mark.complete("hciattach ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_hciconfig.py b/test/t/test_hciconfig.py index 00ebfc7a150..e86fb571f55 100644 --- a/test/t/test_hciconfig.py +++ b/test/t/test_hciconfig.py @@ -5,4 +5,4 @@ class TestHciconfig: @pytest.mark.complete("hciconfig ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_hcitool.py b/test/t/test_hcitool.py index 9afbbc2be63..866b248300d 100644 --- a/test/t/test_hcitool.py +++ b/test/t/test_hcitool.py @@ -5,4 +5,4 @@ class TestHcitool: @pytest.mark.complete("hcitool ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_hddtemp.py b/test/t/test_hddtemp.py index b34f0ab6697..40132bbf45c 100644 --- a/test/t/test_hddtemp.py +++ b/test/t/test_hddtemp.py @@ -5,4 +5,4 @@ class TestHddtemp: @pytest.mark.complete("hddtemp -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_head.py b/test/t/test_head.py index 5ac9b5d426d..0e160689560 100644 --- a/test/t/test_head.py +++ b/test/t/test_head.py @@ -6,4 +6,4 @@ class TestHead: @pytest.mark.complete("head --", skipif="! head --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_hexdump.py b/test/t/test_hexdump.py index 7da07dee37a..bde25ce8887 100644 --- a/test/t/test_hexdump.py +++ b/test/t/test_hexdump.py @@ -5,4 +5,4 @@ class TestHexdump: @pytest.mark.complete("hexdump -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_hid2hci.py b/test/t/test_hid2hci.py index 8aa2628806d..410e60e662c 100644 --- a/test/t/test_hid2hci.py +++ b/test/t/test_hid2hci.py @@ -10,4 +10,4 @@ class TestHid2hci: @pytest.mark.complete("hid2hci -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_host.py b/test/t/test_host.py index 976593f3347..b5ebe6ef3bc 100644 --- a/test/t/test_host.py +++ b/test/t/test_host.py @@ -5,4 +5,4 @@ class TestHost: @pytest.mark.complete("host -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_hostname.py b/test/t/test_hostname.py index e87a4915e6f..922777e4b23 100644 --- a/test/t/test_hostname.py +++ b/test/t/test_hostname.py @@ -5,4 +5,4 @@ class TestHostname: @pytest.mark.complete("hostname -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_hping2.py b/test/t/test_hping2.py index cb1b7212543..d9dc16bb198 100644 --- a/test/t/test_hping2.py +++ b/test/t/test_hping2.py @@ -5,4 +5,4 @@ class TestHping2: @pytest.mark.complete("hping2 ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_hping3.py b/test/t/test_hping3.py index 60ab7ac12ff..067dfe29c6c 100644 --- a/test/t/test_hping3.py +++ b/test/t/test_hping3.py @@ -5,4 +5,4 @@ class TestHping3: @pytest.mark.complete("hping3 ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_htop.py b/test/t/test_htop.py index 614c8fe1d9d..f182c06a136 100644 --- a/test/t/test_htop.py +++ b/test/t/test_htop.py @@ -5,4 +5,4 @@ class TestHtop: @pytest.mark.complete("htop -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_htpasswd.py b/test/t/test_htpasswd.py index c1586d89d10..c80570ef875 100644 --- a/test/t/test_htpasswd.py +++ b/test/t/test_htpasswd.py @@ -5,16 +5,16 @@ class TestHtpasswd: @pytest.mark.complete("htpasswd ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("htpasswd -n htpasswd/ht") def test_2(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("htpasswd ", cwd="htpasswd") def test_3(self, completion): - assert completion.list == ["htpasswd"] + assert completion == "htpasswd" @pytest.mark.complete("htpasswd -D htpasswd ", cwd="htpasswd") def test_4(self, completion): - assert completion.list == "foo quux".split() + assert completion == "foo quux".split() diff --git a/test/t/test_hunspell.py b/test/t/test_hunspell.py index 762c6ea4676..55c8fdc3a46 100644 --- a/test/t/test_hunspell.py +++ b/test/t/test_hunspell.py @@ -5,8 +5,8 @@ class TestHunspell: @pytest.mark.complete("hunspell ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("hunspell -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_hwclock.py b/test/t/test_hwclock.py index 24b3bc62c9b..79826d25174 100644 --- a/test/t/test_hwclock.py +++ b/test/t/test_hwclock.py @@ -5,4 +5,4 @@ class TestHwclock: @pytest.mark.complete("hwclock -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_iconv.py b/test/t/test_iconv.py index b629eebbe00..b381d313f37 100644 --- a/test/t/test_iconv.py +++ b/test/t/test_iconv.py @@ -5,8 +5,8 @@ class TestIconv: @pytest.mark.complete("iconv -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("iconv -f UTF") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_id.py b/test/t/test_id.py index 157e87761a2..d1b13085095 100644 --- a/test/t/test_id.py +++ b/test/t/test_id.py @@ -5,4 +5,4 @@ class TestId: @pytest.mark.complete("id -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_identify.py b/test/t/test_identify.py index 0af1072db90..e51e02f38be 100644 --- a/test/t/test_identify.py +++ b/test/t/test_identify.py @@ -5,4 +5,4 @@ class TestIdentify: @pytest.mark.complete("identify -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_idn.py b/test/t/test_idn.py index d4f1fae50e9..6d2ef15bd54 100644 --- a/test/t/test_idn.py +++ b/test/t/test_idn.py @@ -5,4 +5,4 @@ class TestIdn: @pytest.mark.complete("idn -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ifdown.py b/test/t/test_ifdown.py index 53b4e585175..4fc40ae761b 100644 --- a/test/t/test_ifdown.py +++ b/test/t/test_ifdown.py @@ -8,8 +8,8 @@ class TestIfdown: @pytest.mark.xfail(in_docker(), reason="Probably fails in docker") @pytest.mark.complete("ifdown ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("ifdown bash-completion ") def test_2(self, completion): - assert not completion.list + assert not completion diff --git a/test/t/test_iftop.py b/test/t/test_iftop.py index 08cd1834338..281a09fdd55 100644 --- a/test/t/test_iftop.py +++ b/test/t/test_iftop.py @@ -5,4 +5,4 @@ class TestIftop: @pytest.mark.complete("iftop ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ifup.py b/test/t/test_ifup.py index b09c60d5b6c..6786c607a37 100644 --- a/test/t/test_ifup.py +++ b/test/t/test_ifup.py @@ -8,12 +8,12 @@ class TestIfup: @pytest.mark.xfail(in_docker(), reason="Probably fails in docker") @pytest.mark.complete("ifup ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("ifup --", skipif="! ifup --help &>/dev/null") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("ifup bash-completion ") def test_3(self, completion): - assert not completion.list + assert not completion diff --git a/test/t/test_import.py b/test/t/test_import.py index 60ec501a3ac..9d247ed74a4 100644 --- a/test/t/test_import.py +++ b/test/t/test_import.py @@ -5,4 +5,4 @@ class TestImport: @pytest.mark.complete("import ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_info.py b/test/t/test_info.py index c770954867a..145dae9b8f1 100644 --- a/test/t/test_info.py +++ b/test/t/test_info.py @@ -10,8 +10,8 @@ class TestInfo: @pytest.mark.complete("info bash") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("info -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_inject.py b/test/t/test_inject.py index 68872df61b9..4cf294b2952 100644 --- a/test/t/test_inject.py +++ b/test/t/test_inject.py @@ -10,4 +10,4 @@ class TestInject: @pytest.mark.complete("inject ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_inotifywait.py b/test/t/test_inotifywait.py index 97c44fa5558..e853dff23e6 100644 --- a/test/t/test_inotifywait.py +++ b/test/t/test_inotifywait.py @@ -5,12 +5,12 @@ class TestInotifywait: @pytest.mark.complete("inotifywait ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("inotifywait --") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("inotifywait -e ") def test_3(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_inotifywatch.py b/test/t/test_inotifywatch.py index d842c5272b5..f2a57ff5387 100644 --- a/test/t/test_inotifywatch.py +++ b/test/t/test_inotifywatch.py @@ -5,12 +5,12 @@ class TestInotifywatch: @pytest.mark.complete("inotifywatch ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("inotifywatch --") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("inotifywatch -e ") def test_3(self, completion): - assert len(completion.list) > 1 + assert len(completion) > 1 diff --git a/test/t/test_insmod.py b/test/t/test_insmod.py index dee0e5e20da..338ccbdce0b 100644 --- a/test/t/test_insmod.py +++ b/test/t/test_insmod.py @@ -5,4 +5,4 @@ class TestInsmod: @pytest.mark.complete("insmod ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_installpkg.py b/test/t/test_installpkg.py index 6f65a616c45..bcf1f3c8432 100644 --- a/test/t/test_installpkg.py +++ b/test/t/test_installpkg.py @@ -8,17 +8,17 @@ class TestInstallpkg: @pytest.mark.complete("installpkg -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("installpkg --") def test_2(self, completion): - assert completion.list == "--ask --infobox --md5sum --menu " \ + assert completion == "--ask --infobox --md5sum --menu " \ "--priority --root --tagfile --terse --warn".split() @pytest.mark.complete("installpkg --root ") def test_3(self, completion): dirs = sorted(x for x in os.listdir(".") if os.path.isdir("./%s" % x)) - assert completion.list == ["%s/" % x for x in dirs] + assert completion == ["%s/" % x for x in dirs] @pytest.mark.complete("installpkg --root ") def test_4(self, completion): @@ -29,4 +29,4 @@ def test_4(self, completion): x for x in os.listdir("slackware/home") if os.path.isfile("./%s" % x) and fnmatch.fnmatch(x, "*.t[bglx]z") ]) - assert completion.list == expected + assert completion == expected diff --git a/test/t/test_interdiff.py b/test/t/test_interdiff.py index 44892e0a131..32dc20e226d 100644 --- a/test/t/test_interdiff.py +++ b/test/t/test_interdiff.py @@ -5,4 +5,4 @@ class TestInterdiff: @pytest.mark.complete("interdiff ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_invoke_rc_d.py b/test/t/test_invoke_rc_d.py index c81f8a0a395..e2b2f878f05 100644 --- a/test/t/test_invoke_rc_d.py +++ b/test/t/test_invoke_rc_d.py @@ -8,4 +8,4 @@ class TestInvokeRcD: @pytest.mark.complete("invoke-rc.d ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ionice.py b/test/t/test_ionice.py index 3a10e7b4d41..4d0adbd1f90 100644 --- a/test/t/test_ionice.py +++ b/test/t/test_ionice.py @@ -5,4 +5,4 @@ class TestIonice: @pytest.mark.complete("ionice -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ip.py b/test/t/test_ip.py index 61dd08a4bb1..7136e34351e 100644 --- a/test/t/test_ip.py +++ b/test/t/test_ip.py @@ -5,8 +5,8 @@ class TestIp: @pytest.mark.complete("ip ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("ip a ") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_iperf.py b/test/t/test_iperf.py index a9589f22d23..d6ac4ed3d26 100644 --- a/test/t/test_iperf.py +++ b/test/t/test_iperf.py @@ -5,16 +5,17 @@ class TestIperf: @pytest.mark.complete("iperf ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("iperf --bind ") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("iperf --client foo --") def test_3(self, completion): - assert completion.list and "--daemon" not in completion.list + assert completion + assert "--daemon" not in completion @pytest.mark.complete("iperf --server --") def test_4(self, completion): - assert "--daemon" in completion.list + assert "--daemon" in completion diff --git a/test/t/test_iperf3.py b/test/t/test_iperf3.py index 9d12a66c615..18690fa5f09 100644 --- a/test/t/test_iperf3.py +++ b/test/t/test_iperf3.py @@ -5,16 +5,17 @@ class TestIperf3: @pytest.mark.complete("iperf3 ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("iperf3 --bind ") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("iperf3 --client foo --") def test_3(self, completion): - assert completion.list and "--daemon" not in completion.list + assert completion + assert "--daemon" not in completion @pytest.mark.complete("iperf3 --server --") def test_4(self, completion): - assert "--daemon" in completion.list + assert "--daemon" in completion diff --git a/test/t/test_ipmitool.py b/test/t/test_ipmitool.py index c8f82ea598b..3a357bf5547 100644 --- a/test/t/test_ipmitool.py +++ b/test/t/test_ipmitool.py @@ -5,4 +5,4 @@ class TestIpmitool: @pytest.mark.complete("ipmitool ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ipsec.py b/test/t/test_ipsec.py index ef9d9500bda..8639573441c 100644 --- a/test/t/test_ipsec.py +++ b/test/t/test_ipsec.py @@ -5,4 +5,4 @@ class TestIpsec: @pytest.mark.complete("ipsec ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_iptables.py b/test/t/test_iptables.py index c53e0f701fa..2894b954c50 100644 --- a/test/t/test_iptables.py +++ b/test/t/test_iptables.py @@ -5,4 +5,4 @@ class TestIptables: @pytest.mark.complete("iptables -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ipv6calc.py b/test/t/test_ipv6calc.py index e037f7ba019..62bc2651f3c 100644 --- a/test/t/test_ipv6calc.py +++ b/test/t/test_ipv6calc.py @@ -5,8 +5,8 @@ class TestIpv6calc: @pytest.mark.complete("ipv6calc -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("ipv6calc --in ") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_irb.py b/test/t/test_irb.py index e8fd605b317..1c03ef60ead 100644 --- a/test/t/test_irb.py +++ b/test/t/test_irb.py @@ -5,4 +5,4 @@ class TestIrb: @pytest.mark.complete("irb ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_iscsiadm.py b/test/t/test_iscsiadm.py index d38a5a58678..1fe4b9b157d 100644 --- a/test/t/test_iscsiadm.py +++ b/test/t/test_iscsiadm.py @@ -5,4 +5,4 @@ class TestIscsiadm: @pytest.mark.complete("iscsiadm --mode") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_isort.py b/test/t/test_isort.py index 01527fb3903..a826529a471 100644 --- a/test/t/test_isort.py +++ b/test/t/test_isort.py @@ -5,8 +5,8 @@ class TestIsort: @pytest.mark.complete("isort ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("isort -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_isql.py b/test/t/test_isql.py index 8222ca18489..aa7e80fe1e8 100644 --- a/test/t/test_isql.py +++ b/test/t/test_isql.py @@ -10,4 +10,4 @@ class TestIsql: @pytest.mark.complete("isql ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_iwconfig.py b/test/t/test_iwconfig.py index e7dc2c033e0..a6b83bd3501 100644 --- a/test/t/test_iwconfig.py +++ b/test/t/test_iwconfig.py @@ -5,4 +5,4 @@ class TestIwconfig: @pytest.mark.complete("iwconfig --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_iwlist.py b/test/t/test_iwlist.py index 056860f0be3..ee2dda58f4e 100644 --- a/test/t/test_iwlist.py +++ b/test/t/test_iwlist.py @@ -5,4 +5,4 @@ class TestIwlist: @pytest.mark.complete("iwlist --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_iwpriv.py b/test/t/test_iwpriv.py index be582680c55..0d6eef466d3 100644 --- a/test/t/test_iwpriv.py +++ b/test/t/test_iwpriv.py @@ -5,4 +5,4 @@ class TestIwpriv: @pytest.mark.complete("iwpriv --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_iwspy.py b/test/t/test_iwspy.py index 10505be68ee..7f817646066 100644 --- a/test/t/test_iwspy.py +++ b/test/t/test_iwspy.py @@ -5,4 +5,4 @@ class TestIwspy: @pytest.mark.complete("iwspy --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_jar.py b/test/t/test_jar.py index f22dc17b3ee..ee61463e27f 100644 --- a/test/t/test_jar.py +++ b/test/t/test_jar.py @@ -5,4 +5,4 @@ class TestJar: @pytest.mark.complete("jar ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_jarsigner.py b/test/t/test_jarsigner.py index c221790e249..8c0f56d094c 100644 --- a/test/t/test_jarsigner.py +++ b/test/t/test_jarsigner.py @@ -5,4 +5,4 @@ class TestJarsigner: @pytest.mark.complete("jarsigner ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_java.py b/test/t/test_java.py index 6b3598dec56..d54fb8caec1 100644 --- a/test/t/test_java.py +++ b/test/t/test_java.py @@ -10,24 +10,24 @@ class TestJava: @pytest.mark.complete("java -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("java ") def test_2(self, completion): - assert completion.list == "b bashcomp.jarred c. toplevel".split() + assert completion == "b bashcomp.jarred c. toplevel".split() @pytest.mark.complete("java -classpath java/bashcomp.jar ") def test_3(self, completion): - assert completion.list == "bashcomp.jarred toplevel".split() + assert completion == "bashcomp.jarred toplevel".split() @pytest.mark.complete("java -cp java/bashcomp.jar:java/a/c ") def test_4(self, completion): - assert completion.list == "bashcomp.jarred d toplevel".split() + assert completion == "bashcomp.jarred d toplevel".split() @pytest.mark.complete("java -cp '' ") def test_5(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("java -jar java/") def test_6(self, completion): - assert completion.list == "a/ bashcomp.jar bashcomp.war".split() + assert completion == "a/ bashcomp.jar bashcomp.war".split() diff --git a/test/t/test_javac.py b/test/t/test_javac.py index daed598f1aa..c915d923bc1 100644 --- a/test/t/test_javac.py +++ b/test/t/test_javac.py @@ -5,8 +5,8 @@ class TestJavac: @pytest.mark.complete("javac ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("javac -cp java/") def test_2(self, completion): - assert completion.list == "a/ bashcomp.jar".split() + assert completion == "a/ bashcomp.jar".split() diff --git a/test/t/test_javadoc.py b/test/t/test_javadoc.py index ac5b7595736..c2edad4f423 100644 --- a/test/t/test_javadoc.py +++ b/test/t/test_javadoc.py @@ -5,15 +5,13 @@ class TestJavadoc: @pytest.mark.complete("javadoc ") def test_1(self, completion): - assert completion.list + assert completion - @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("javadoc -linkoffline shared/default/") def test_2(self, completion): - assert completion.list == ["bar bar.d/", "foo.d/"] + assert completion == ["bar bar.d/", "foo.d/"] - @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete( "javadoc -nodeprecated -linkoffline foo shared/default/") def test_3(self, completion): - assert completion.list == ["bar bar.d/", "foo.d/"] + assert completion == ["bar bar.d/", "foo.d/"] diff --git a/test/t/test_javaws.py b/test/t/test_javaws.py index 76d90b4215e..cd2eb9d9054 100644 --- a/test/t/test_javaws.py +++ b/test/t/test_javaws.py @@ -5,4 +5,4 @@ class TestJavaws: @pytest.mark.complete("javaws ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_jpegoptim.py b/test/t/test_jpegoptim.py index 859952011dc..b19d45672fe 100644 --- a/test/t/test_jpegoptim.py +++ b/test/t/test_jpegoptim.py @@ -5,4 +5,4 @@ class TestJpegoptim: @pytest.mark.complete("jpegoptim ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_jps.py b/test/t/test_jps.py index ffe9af60c70..3b5b4519fda 100644 --- a/test/t/test_jps.py +++ b/test/t/test_jps.py @@ -5,4 +5,4 @@ class TestJps: @pytest.mark.complete("jps -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_jq.py b/test/t/test_jq.py index 95c27f60168..34bbd383df4 100644 --- a/test/t/test_jq.py +++ b/test/t/test_jq.py @@ -5,26 +5,26 @@ class TestJq: @pytest.mark.complete("jq ") def test_1(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("jq . ") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("jq -", skipif="! (jq --help 2>&1 || :) | " "command grep -qF 'options include'") def test_3(self, completion): - assert completion.list + assert completion @pytest.mark.complete("jq --arg ") def test_4(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("jq --slurpfile ") def test_5(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("jq --slurpfile foo ") def test_6(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_jshint.py b/test/t/test_jshint.py index d8eeefe56a2..e9a03ca3579 100644 --- a/test/t/test_jshint.py +++ b/test/t/test_jshint.py @@ -5,4 +5,4 @@ class TestJshint: @pytest.mark.complete("jshint ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_json_xs.py b/test/t/test_json_xs.py index a2f1d6b49cd..6298613e63f 100644 --- a/test/t/test_json_xs.py +++ b/test/t/test_json_xs.py @@ -5,8 +5,8 @@ class TestJsonXs: @pytest.mark.complete("json_xs ") def test_1(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("json_xs -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_k3b.py b/test/t/test_k3b.py index 1df73719688..9ff790653b8 100644 --- a/test/t/test_k3b.py +++ b/test/t/test_k3b.py @@ -5,4 +5,4 @@ class TestK3b: @pytest.mark.complete("k3b ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_kcov.py b/test/t/test_kcov.py index 124a22a85ee..fb7b0ab6b5b 100644 --- a/test/t/test_kcov.py +++ b/test/t/test_kcov.py @@ -5,13 +5,13 @@ class TestKcov: @pytest.mark.complete("kcov ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("kcov --exclude-patter") def test_2(self, completion): - assert completion.list == ["--exclude-pattern="] - assert completion.output.endswith("=") + assert completion == "--exclude-pattern=" + assert completion.endswith("=") @pytest.mark.complete("kcov -l 42,") def test_3(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_kdvi.py b/test/t/test_kdvi.py index 92392a3bf11..d4ad2f6cb95 100644 --- a/test/t/test_kdvi.py +++ b/test/t/test_kdvi.py @@ -5,5 +5,5 @@ class TestKdvi: @pytest.mark.complete("kdvi ", cwd="kdvi") def test_1(self, completion): - assert completion.list == "foo/ .dvi .DVI .dvi.bz2 .DVI.bz2 .dvi.gz " \ + assert completion == "foo/ .dvi .DVI .dvi.bz2 .DVI.bz2 .dvi.gz " \ ".DVI.gz .dvi.Z .DVI.Z".split() diff --git a/test/t/test_kill.py b/test/t/test_kill.py index d712b351efb..171330e39c8 100644 --- a/test/t/test_kill.py +++ b/test/t/test_kill.py @@ -5,14 +5,12 @@ class TestKill: @pytest.mark.complete("kill 1", skipif="! type ps &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("kill -s ") def test_2(self, completion): - for arg in "HUP QUIT".split(): - assert arg in completion.list + assert all(x in completion for x in "HUP QUIT".split()) @pytest.mark.complete("kill -") def test_3(self, completion): - for arg in "l s ABRT USR1".split(): - assert "-%s" % arg in completion.list + assert all("-%s" % x in completion for x in "l s ABRT USR1".split()) diff --git a/test/t/test_killall.py b/test/t/test_killall.py index 7a657c07b6e..725a16e4d60 100644 --- a/test/t/test_killall.py +++ b/test/t/test_killall.py @@ -6,9 +6,8 @@ class TestKillall: # "p": Assume our process name completion runs ps and at least it is shown @pytest.mark.complete("killall p") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("killall --signal ") def test_2(self, completion): - for arg in "INT KILL TERM".split(): - assert arg in completion.list + assert all(x in completion for x in "INT KILL TERM".split()) diff --git a/test/t/test_kldload.py b/test/t/test_kldload.py index 0d0800e7c2d..d9f2cc09f5c 100644 --- a/test/t/test_kldload.py +++ b/test/t/test_kldload.py @@ -5,4 +5,4 @@ class TestKldload: @pytest.mark.complete("kldload ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_kldunload.py b/test/t/test_kldunload.py index 4804cfc7f68..ffc725843db 100644 --- a/test/t/test_kldunload.py +++ b/test/t/test_kldunload.py @@ -11,6 +11,6 @@ def test_1(self, completion): subprocess.check_call( r"kldstat 2>/dev/null | command grep -q '\.ko$'", shell=True) except BaseException: - assert not completion.list + assert not completion else: - assert completion.list + assert completion diff --git a/test/t/test_koji.py b/test/t/test_koji.py index 16bc03b7431..990c4029781 100644 --- a/test/t/test_koji.py +++ b/test/t/test_koji.py @@ -5,8 +5,8 @@ class TestKoji: @pytest.mark.complete("koji ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("koji -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_kpdf.py b/test/t/test_kpdf.py index 96d5b02c784..7e308f3fdc6 100644 --- a/test/t/test_kpdf.py +++ b/test/t/test_kpdf.py @@ -5,4 +5,4 @@ class TestKpdf: @pytest.mark.complete("kpdf ", cwd="kpdf") def test_1(self, completion): - assert completion.list == "foo/ .eps .ps .EPS .PS .pdf .PDF".split() + assert completion == "foo/ .eps .ps .EPS .PS .pdf .PDF".split() diff --git a/test/t/test_kplayer.py b/test/t/test_kplayer.py index 6b3214c3ca9..2ee61882ea3 100644 --- a/test/t/test_kplayer.py +++ b/test/t/test_kplayer.py @@ -5,4 +5,4 @@ class TestKplayer: @pytest.mark.complete("kplayer ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ktutil.py b/test/t/test_ktutil.py index a3390129209..1d9370251dd 100644 --- a/test/t/test_ktutil.py +++ b/test/t/test_ktutil.py @@ -5,8 +5,8 @@ class TestKtutil: @pytest.mark.complete("ktutil ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("ktutil -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_l2ping.py b/test/t/test_l2ping.py index fcaf586b983..232575cc786 100644 --- a/test/t/test_l2ping.py +++ b/test/t/test_l2ping.py @@ -5,4 +5,4 @@ class TestL2ping: @pytest.mark.complete("l2ping -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_larch.py b/test/t/test_larch.py index 3329ec583ac..9fc46e368e8 100644 --- a/test/t/test_larch.py +++ b/test/t/test_larch.py @@ -5,4 +5,4 @@ class TestLarch: @pytest.mark.complete("larch library-") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lastlog.py b/test/t/test_lastlog.py index 78d3dea064d..a6ae81a9648 100644 --- a/test/t/test_lastlog.py +++ b/test/t/test_lastlog.py @@ -5,4 +5,4 @@ class TestLastlog: @pytest.mark.complete("lastlog -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ld.py b/test/t/test_ld.py index 6c506a2a928..acc5d7bfbcd 100644 --- a/test/t/test_ld.py +++ b/test/t/test_ld.py @@ -5,4 +5,4 @@ class TestLd: @pytest.mark.complete("ld ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ldapadd.py b/test/t/test_ldapadd.py index 8b8f5a28e5b..12106e3faf0 100644 --- a/test/t/test_ldapadd.py +++ b/test/t/test_ldapadd.py @@ -5,4 +5,4 @@ class TestLdapadd: @pytest.mark.complete("ldapadd -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ldapcompare.py b/test/t/test_ldapcompare.py index 5865c4535f7..5a86f0aea41 100644 --- a/test/t/test_ldapcompare.py +++ b/test/t/test_ldapcompare.py @@ -5,4 +5,4 @@ class TestLdapcompare: @pytest.mark.complete("ldapcompare -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ldapdelete.py b/test/t/test_ldapdelete.py index 1158a4f0997..b2a5bbb1c5b 100644 --- a/test/t/test_ldapdelete.py +++ b/test/t/test_ldapdelete.py @@ -5,4 +5,4 @@ class TestLdapdelete: @pytest.mark.complete("ldapdelete -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ldapmodrdn.py b/test/t/test_ldapmodrdn.py index 91b1180583f..dc58e601482 100644 --- a/test/t/test_ldapmodrdn.py +++ b/test/t/test_ldapmodrdn.py @@ -5,4 +5,4 @@ class TestLdapmodrdn: @pytest.mark.complete("ldapmodrdn -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ldappasswd.py b/test/t/test_ldappasswd.py index aafa7efc0da..36f5e42e1c8 100644 --- a/test/t/test_ldappasswd.py +++ b/test/t/test_ldappasswd.py @@ -5,4 +5,4 @@ class TestLdappasswd: @pytest.mark.complete("ldappasswd -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ldapsearch.py b/test/t/test_ldapsearch.py index f6d135c31f4..4f54f6e4fab 100644 --- a/test/t/test_ldapsearch.py +++ b/test/t/test_ldapsearch.py @@ -5,4 +5,4 @@ class TestLdapsearch: @pytest.mark.complete("ldapsearch -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ldapvi.py b/test/t/test_ldapvi.py index b3923d69478..e8299061e4a 100644 --- a/test/t/test_ldapvi.py +++ b/test/t/test_ldapvi.py @@ -5,4 +5,4 @@ class TestLdapvi: @pytest.mark.complete("ldapvi -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ldapwhoami.py b/test/t/test_ldapwhoami.py index 686d6dcd7c6..a6e46ab5e38 100644 --- a/test/t/test_ldapwhoami.py +++ b/test/t/test_ldapwhoami.py @@ -5,4 +5,4 @@ class TestLdapwhoami: @pytest.mark.complete("ldapwhoami -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ldd.py b/test/t/test_ldd.py index 0a366c5ffea..d1974066888 100644 --- a/test/t/test_ldd.py +++ b/test/t/test_ldd.py @@ -5,4 +5,4 @@ class TestLdd: @pytest.mark.complete("ldd ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_less.py b/test/t/test_less.py index 14a4f64c6a6..6334c6a4d51 100644 --- a/test/t/test_less.py +++ b/test/t/test_less.py @@ -5,4 +5,4 @@ class TestLess: @pytest.mark.complete("less --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lftp.py b/test/t/test_lftp.py index 6cde8229a34..2dbd7c3334d 100644 --- a/test/t/test_lftp.py +++ b/test/t/test_lftp.py @@ -14,6 +14,5 @@ class TestLftp: def test_1(self, bash, completion): hosts = assert_bash_exec( bash, "compgen -A hostname", want_output=True).split() - for host in hosts: - assert host in completion.list - assert "lftptest" in completion.list # defined in lftp/.lftp/bookmarks + assert all(x in completion for x in hosts) + assert "lftptest" in completion # defined in lftp/.lftp/bookmarks diff --git a/test/t/test_lftpget.py b/test/t/test_lftpget.py index b950893fc03..a30010376f1 100644 --- a/test/t/test_lftpget.py +++ b/test/t/test_lftpget.py @@ -5,4 +5,4 @@ class TestLftpget: @pytest.mark.complete("lftpget -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lilo.py b/test/t/test_lilo.py index 4eae81e65e1..375858da2a2 100644 --- a/test/t/test_lilo.py +++ b/test/t/test_lilo.py @@ -5,4 +5,4 @@ class TestLilo: @pytest.mark.complete("lilo -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_links.py b/test/t/test_links.py index 6360c21f6c3..fb762028a68 100644 --- a/test/t/test_links.py +++ b/test/t/test_links.py @@ -5,8 +5,8 @@ class TestLinks: @pytest.mark.complete("links ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("links -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lintian.py b/test/t/test_lintian.py index 67a2eddd474..8fefe176371 100644 --- a/test/t/test_lintian.py +++ b/test/t/test_lintian.py @@ -5,4 +5,4 @@ class TestLintian: @pytest.mark.complete("lintian --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lintian_info.py b/test/t/test_lintian_info.py index 48f55d3b86d..32338cf0df0 100644 --- a/test/t/test_lintian_info.py +++ b/test/t/test_lintian_info.py @@ -8,8 +8,8 @@ class TestLintianInfo: @pytest.mark.complete("lintian-info ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("lintian-info --") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lisp.py b/test/t/test_lisp.py index dfe40568748..2382aeb9308 100644 --- a/test/t/test_lisp.py +++ b/test/t/test_lisp.py @@ -5,4 +5,4 @@ class TestLisp: @pytest.mark.complete("lisp ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_list_admins.py b/test/t/test_list_admins.py index b36b98cf859..aecf3aa5267 100644 --- a/test/t/test_list_admins.py +++ b/test/t/test_list_admins.py @@ -5,4 +5,4 @@ class TestListAdmins: @pytest.mark.complete("list_admins -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_list_lists.py b/test/t/test_list_lists.py index f498c7b5983..e3ec870e6b0 100644 --- a/test/t/test_list_lists.py +++ b/test/t/test_list_lists.py @@ -5,4 +5,4 @@ class TestListLists: @pytest.mark.complete("list_lists -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_list_members.py b/test/t/test_list_members.py index 1f3e9265044..32bf400d755 100644 --- a/test/t/test_list_members.py +++ b/test/t/test_list_members.py @@ -5,4 +5,4 @@ class TestListMembers: @pytest.mark.complete("list_members -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_list_owners.py b/test/t/test_list_owners.py index e18191d80ee..21c1b280e30 100644 --- a/test/t/test_list_owners.py +++ b/test/t/test_list_owners.py @@ -10,4 +10,4 @@ class TestListOwners: @pytest.mark.complete("list_owners -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ln.py b/test/t/test_ln.py index 85f554cdce6..8c451bc2709 100644 --- a/test/t/test_ln.py +++ b/test/t/test_ln.py @@ -5,4 +5,4 @@ class TestLn: @pytest.mark.complete("ln ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_locale_gen.py b/test/t/test_locale_gen.py index 54813349d7d..2bf6c8339b8 100644 --- a/test/t/test_locale_gen.py +++ b/test/t/test_locale_gen.py @@ -8,8 +8,8 @@ class TestLocaleGen: @pytest.mark.complete("locale-gen ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("locale-gen --") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_look.py b/test/t/test_look.py index bff5dd94545..b28155a69b0 100644 --- a/test/t/test_look.py +++ b/test/t/test_look.py @@ -11,6 +11,6 @@ def test_1(self, completion): subprocess.check_call( "look foo 2>/dev/null | command grep -q ^foo", shell=True) except BaseException: - assert not completion.list + assert not completion else: - assert completion.list + assert completion diff --git a/test/t/test_lpq.py b/test/t/test_lpq.py index 59a36136f4c..a3f89ed121f 100644 --- a/test/t/test_lpq.py +++ b/test/t/test_lpq.py @@ -5,4 +5,4 @@ class TestLpq: @pytest.mark.complete("lpq ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lpr.py b/test/t/test_lpr.py index 1a55c29afe5..df4c284a643 100644 --- a/test/t/test_lpr.py +++ b/test/t/test_lpr.py @@ -5,4 +5,4 @@ class TestLpr: @pytest.mark.complete("lpr ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lrzip.py b/test/t/test_lrzip.py index ac4e7d93360..4731693c8a2 100644 --- a/test/t/test_lrzip.py +++ b/test/t/test_lrzip.py @@ -5,8 +5,8 @@ class TestLrzip: @pytest.mark.complete("lrzip ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("lrzip ~") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ls.py b/test/t/test_ls.py index 9dd706d7cad..06e3a0a5700 100644 --- a/test/t/test_ls.py +++ b/test/t/test_ls.py @@ -9,11 +9,11 @@ class TestLs: @pytest.mark.complete("ls --", skipif="! ls --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("ls ~") def test_2(self, completion): - assert completion.list + assert completion def test_3(self, bash): """~part should complete to ~full if home dir does not exist.""" @@ -27,5 +27,5 @@ def test_3(self, bash): return part, full = part_full completion = assert_complete(bash, "ls ~%s" % part) - assert completion.list == ["~%s" % full] - assert completion.output.endswith(" ") + assert completion == "~%s" % full + assert completion.endswith(" ") diff --git a/test/t/test_lsof.py b/test/t/test_lsof.py index ab9d794ec69..f156faef9e8 100644 --- a/test/t/test_lsof.py +++ b/test/t/test_lsof.py @@ -5,8 +5,8 @@ class TestLsof: @pytest.mark.complete("lsof ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("lsof -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lspci.py b/test/t/test_lspci.py index e5188addec3..af52302efe4 100644 --- a/test/t/test_lspci.py +++ b/test/t/test_lspci.py @@ -5,8 +5,8 @@ class TestLspci: @pytest.mark.complete("lspci -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("lspci -A ") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lsscsi.py b/test/t/test_lsscsi.py index a4b65040551..9e4cec5d5e3 100644 --- a/test/t/test_lsscsi.py +++ b/test/t/test_lsscsi.py @@ -5,8 +5,8 @@ class TestLsscsi: @pytest.mark.complete("lsscsi ") def test_1(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("lsscsi -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lsusb.py b/test/t/test_lsusb.py index 3c3d634306c..17bb3f91335 100644 --- a/test/t/test_lsusb.py +++ b/test/t/test_lsusb.py @@ -5,4 +5,4 @@ class TestLsusb: @pytest.mark.complete("lsusb -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lua.py b/test/t/test_lua.py index a0f6c0fe490..958e1f91941 100644 --- a/test/t/test_lua.py +++ b/test/t/test_lua.py @@ -5,4 +5,4 @@ class TestLua: @pytest.mark.complete("lua ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_luac.py b/test/t/test_luac.py index ce0264827e0..c77eee4168c 100644 --- a/test/t/test_luac.py +++ b/test/t/test_luac.py @@ -5,4 +5,4 @@ class TestLuac: @pytest.mark.complete("luac ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_luseradd.py b/test/t/test_luseradd.py index df15bf23c46..d5fc233dab7 100644 --- a/test/t/test_luseradd.py +++ b/test/t/test_luseradd.py @@ -5,4 +5,4 @@ class TestLuseradd: @pytest.mark.complete("luseradd -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_luserdel.py b/test/t/test_luserdel.py index cd6417b8534..8a7285e85de 100644 --- a/test/t/test_luserdel.py +++ b/test/t/test_luserdel.py @@ -5,4 +5,4 @@ class TestLuserdel: @pytest.mark.complete("luserdel ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lusermod.py b/test/t/test_lusermod.py index b3c99b40d48..794d7194b71 100644 --- a/test/t/test_lusermod.py +++ b/test/t/test_lusermod.py @@ -5,4 +5,4 @@ class TestLusermod: @pytest.mark.complete("lusermod ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lvchange.py b/test/t/test_lvchange.py index 147febd7c3c..07837df4df6 100644 --- a/test/t/test_lvchange.py +++ b/test/t/test_lvchange.py @@ -6,4 +6,4 @@ class TestLvchange: @pytest.mark.complete("lvchange --", skipif="! lvchange --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lvcreate.py b/test/t/test_lvcreate.py index 05209283d85..93efdc102f4 100644 --- a/test/t/test_lvcreate.py +++ b/test/t/test_lvcreate.py @@ -6,4 +6,4 @@ class TestLvcreate: @pytest.mark.complete("lvcreate --", skipif="! lvcreate --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lvdisplay.py b/test/t/test_lvdisplay.py index a75c2e22933..c123e43c40f 100644 --- a/test/t/test_lvdisplay.py +++ b/test/t/test_lvdisplay.py @@ -6,4 +6,4 @@ class TestLvdisplay: @pytest.mark.complete("lvdisplay --", skipif="! lvdisplay --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lvextend.py b/test/t/test_lvextend.py index 47e322a3cf4..77d8f922824 100644 --- a/test/t/test_lvextend.py +++ b/test/t/test_lvextend.py @@ -6,4 +6,4 @@ class TestLvextend: @pytest.mark.complete("lvextend --", skipif="! lvextend --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lvm.py b/test/t/test_lvm.py index f68a97712f3..ec8fc8f5789 100644 --- a/test/t/test_lvm.py +++ b/test/t/test_lvm.py @@ -5,4 +5,4 @@ class TestLvm: @pytest.mark.complete("lvm pv") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lvmdiskscan.py b/test/t/test_lvmdiskscan.py index 87b831a1612..e4f954a8354 100644 --- a/test/t/test_lvmdiskscan.py +++ b/test/t/test_lvmdiskscan.py @@ -6,4 +6,4 @@ class TestLvmdiskscan: @pytest.mark.complete("lvmdiskscan --", skipif="! lvmdiskscan --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lvreduce.py b/test/t/test_lvreduce.py index 3cbe9098187..5bf917534ad 100644 --- a/test/t/test_lvreduce.py +++ b/test/t/test_lvreduce.py @@ -6,4 +6,4 @@ class TestLvreduce: @pytest.mark.complete("lvreduce --", skipif="! lvreduce --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lvremove.py b/test/t/test_lvremove.py index f25e7b42e2c..a888a07f476 100644 --- a/test/t/test_lvremove.py +++ b/test/t/test_lvremove.py @@ -6,4 +6,4 @@ class TestLvremove: @pytest.mark.complete("lvremove --", skipif="! lvremove --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lvrename.py b/test/t/test_lvrename.py index 7578c2dbf1e..68b2302ae06 100644 --- a/test/t/test_lvrename.py +++ b/test/t/test_lvrename.py @@ -6,4 +6,4 @@ class TestLvrename: @pytest.mark.complete("lvrename --", skipif="! lvrename --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lvresize.py b/test/t/test_lvresize.py index 1d1685d7544..c87f5ce07de 100644 --- a/test/t/test_lvresize.py +++ b/test/t/test_lvresize.py @@ -6,4 +6,4 @@ class TestLvresize: @pytest.mark.complete("lvresize --", skipif="! lvresize --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lvs.py b/test/t/test_lvs.py index 8be81913231..5703a0bcfa8 100644 --- a/test/t/test_lvs.py +++ b/test/t/test_lvs.py @@ -6,4 +6,4 @@ class TestLvs: @pytest.mark.complete("lvs --", skipif="! lvs --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lvscan.py b/test/t/test_lvscan.py index 707bfa94bf8..7ebaf6b1f20 100644 --- a/test/t/test_lvscan.py +++ b/test/t/test_lvscan.py @@ -6,4 +6,4 @@ class TestLvscan: @pytest.mark.complete("lvscan --", skipif="! lvscan --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lz4.py b/test/t/test_lz4.py index 5ceccf0bdea..88643a96945 100644 --- a/test/t/test_lz4.py +++ b/test/t/test_lz4.py @@ -5,8 +5,8 @@ class TestLz4: @pytest.mark.complete("lz4 ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("lz4 ~") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lzip.py b/test/t/test_lzip.py index ca449d20a75..485fb1e1eaf 100644 --- a/test/t/test_lzip.py +++ b/test/t/test_lzip.py @@ -5,4 +5,4 @@ class TestLzip: @pytest.mark.complete("lzip ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lzma.py b/test/t/test_lzma.py index 371da25ab04..0649dcc764e 100644 --- a/test/t/test_lzma.py +++ b/test/t/test_lzma.py @@ -5,16 +5,16 @@ class TestLzma: @pytest.mark.complete("lzma ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("lzma -") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("lzma -d xz/") def test_3(self, completion): - assert completion.list == "a/ bashcomp.lzma bashcomp.tlz".split() + assert completion == "a/ bashcomp.lzma bashcomp.tlz".split() @pytest.mark.complete("lzma ~") def test_4(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_lzop.py b/test/t/test_lzop.py index 03df8186d8d..6031ee88047 100644 --- a/test/t/test_lzop.py +++ b/test/t/test_lzop.py @@ -5,8 +5,8 @@ class TestLzop: @pytest.mark.complete("lzop ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("lzop ~") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_m4.py b/test/t/test_m4.py index 8884009dbd9..f146d0b68ce 100644 --- a/test/t/test_m4.py +++ b/test/t/test_m4.py @@ -6,4 +6,4 @@ class TestM4: @pytest.mark.complete("m4 --", skipif="! m4 --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_macof.py b/test/t/test_macof.py index 964ca2d4709..89d7678fe5c 100644 --- a/test/t/test_macof.py +++ b/test/t/test_macof.py @@ -5,4 +5,4 @@ class TestMacof: @pytest.mark.complete("macof -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mailmanctl.py b/test/t/test_mailmanctl.py index 4dd9cd3810c..2b3181b249f 100644 --- a/test/t/test_mailmanctl.py +++ b/test/t/test_mailmanctl.py @@ -10,4 +10,4 @@ class TestMailmanctl: @pytest.mark.complete("mailmanctl ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mailsnarf.py b/test/t/test_mailsnarf.py index 512c39b4afd..c6510fee3b7 100644 --- a/test/t/test_mailsnarf.py +++ b/test/t/test_mailsnarf.py @@ -5,4 +5,4 @@ class TestMailsnarf: @pytest.mark.complete("mailsnarf -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_make.py b/test/t/test_make.py index c36b651a695..c1e8031c3d8 100644 --- a/test/t/test_make.py +++ b/test/t/test_make.py @@ -9,31 +9,30 @@ class TestMake: @pytest.mark.complete("make -f Ma", cwd="make") def test_1(self, completion): - assert completion.list == ["Makefile"] + assert completion == "Makefile" @pytest.mark.complete("make .", cwd="make") def test_2(self, bash, completion): """Hidden targets.""" - assert completion.list == ".cache/ .test_passes".split() + assert completion == ".cache/ .test_passes".split() os.remove("%s/make/%s" % (bash.cwd, "extra_makefile")) @pytest.mark.complete("make .cache/", cwd="make") def test_3(self, bash, completion): - assert completion.list == "1 2".split() + assert completion == "1 2".split() os.remove("%s/make/%s" % (bash.cwd, "extra_makefile")) @pytest.mark.complete("make ", cwd="shared/empty_dir") def test_4(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("make -j ") def test_5(self, completion): - assert completion.list + assert completion @pytest.mark.complete("make ", cwd="make") def test_6(self, bash, completion): - assert completion.list == \ - "all clean extra_makefile install sample".split() + assert completion == "all clean extra_makefile install sample".split() os.remove("%s/make/%s" % (bash.cwd, "extra_makefile")) @pytest.mark.xfail(in_docker() and os.environ.get("DIST") == "centos6", @@ -41,5 +40,5 @@ def test_6(self, bash, completion): "even though the behavior appears to be correct") @pytest.mark.complete("make .cache/.", cwd="make") def test_7(self, bash, completion): - assert completion.list == ".1 .2".split() + assert completion == ".1 .2".split() os.remove("%s/make/%s" % (bash.cwd, "extra_makefile")) diff --git a/test/t/test_makepkg.py b/test/t/test_makepkg.py index ecf8e8b0903..30e98adc754 100644 --- a/test/t/test_makepkg.py +++ b/test/t/test_makepkg.py @@ -8,9 +8,9 @@ class TestMakepkg: @pytest.mark.complete("makepkg ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("makepkg --") def test_2(self, completion): - assert all(x in completion.list + assert all(x in completion for x in "--chown --linkadd --prepend".split()) diff --git a/test/t/test_man.py b/test/t/test_man.py index 8017bc3c87f..1be6f4c585b 100644 --- a/test/t/test_man.py +++ b/test/t/test_man.py @@ -14,15 +14,15 @@ class TestMan: @pytest.mark.complete("man bash-completion-testcas", env=dict(MANPATH=manpath)) def test_1(self, completion): - assert completion.list == ["bash-completion-testcase"] + assert completion == "bash-completion-testcase" @pytest.mark.complete("man man1/f", cwd="man", env=dict(MANPATH=manpath)) def test_2(self, completion): - assert completion.list == ["man1/foo.1"] + assert completion == "man1/foo.1" @pytest.mark.complete("man man/", cwd="man", env=dict(MANPATH=manpath)) def test_3(self, completion): - assert completion.list == ["man/quux.8"] + assert completion == "man/quux.8" @pytest.mark.xfail(in_docker() and os.environ.get("DIST") == "centos6", reason="TODO: Fails in CentOS for some reason, unknown " @@ -37,35 +37,35 @@ def test_4(self, completion): Assumed present should not be completed complete when there's no leading/trailing colon in $MANPATH. """ - assert not completion.list + assert not completion @pytest.mark.complete("man %s" % assumed_present, cwd="shared/empty_dir", env=dict(MANPATH="%s:" % manpath)) def test_5(self, completion): """Trailing colon appends system man path.""" - assert completion.list + assert completion @pytest.mark.complete( "man bash-completion-testcas", env=dict(MANPATH="%s:" % manpath)) def test_6(self, completion): - assert completion.list == ["bash-completion-testcase"] + assert completion == "bash-completion-testcase" @pytest.mark.complete("man %s" % assumed_present, cwd="shared/empty_dir", env=dict(MANPATH=":%s" % manpath)) def test_7(self, completion): """Leading colon prepends system man path.""" - assert completion.list + assert completion @pytest.mark.complete( "man bash-completion-testcas", env=dict(MANPATH=":%s" % manpath)) def test_8(self, completion): - assert completion.list == ["bash-completion-testcase"] + assert completion == "bash-completion-testcase" @pytest.mark.complete("man %s" % assumed_present, cwd="shared/empty_dir", pre_cmds=("shopt -s failglob",)) def test_9(self, bash, completion): - assert self.assumed_present in completion.list + assert self.assumed_present in completion assert_bash_exec(bash, "shopt -u failglob") diff --git a/test/t/test_mc.py b/test/t/test_mc.py index b173b227045..fddc0310014 100644 --- a/test/t/test_mc.py +++ b/test/t/test_mc.py @@ -5,4 +5,4 @@ class TestMc: @pytest.mark.complete("mc -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mcrypt.py b/test/t/test_mcrypt.py index b04259371b1..6f434b310a9 100644 --- a/test/t/test_mcrypt.py +++ b/test/t/test_mcrypt.py @@ -5,12 +5,12 @@ class TestMcrypt: @pytest.mark.complete("mcrypt ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("mcrypt -a ") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("mcrypt -m ") def test_3(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_md5sum.py b/test/t/test_md5sum.py index 2ba70e82d5d..6e9d14d5671 100644 --- a/test/t/test_md5sum.py +++ b/test/t/test_md5sum.py @@ -5,4 +5,4 @@ class TestMd5sum: @pytest.mark.complete("md5sum ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mdadm.py b/test/t/test_mdadm.py index 05a86f55ab7..d2c47f48217 100644 --- a/test/t/test_mdadm.py +++ b/test/t/test_mdadm.py @@ -5,4 +5,4 @@ class TestMdadm: @pytest.mark.complete("mdadm ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mdecrypt.py b/test/t/test_mdecrypt.py index 72a659562e8..4092c6896e3 100644 --- a/test/t/test_mdecrypt.py +++ b/test/t/test_mdecrypt.py @@ -5,4 +5,4 @@ class TestMdecrypt: @pytest.mark.complete("mdecrypt ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mdtool.py b/test/t/test_mdtool.py index 149a117ef6d..2b29a344213 100644 --- a/test/t/test_mdtool.py +++ b/test/t/test_mdtool.py @@ -5,4 +5,4 @@ class TestMdtool: @pytest.mark.complete("mdtool ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_medusa.py b/test/t/test_medusa.py index 5db22f4121a..74ee7a34157 100644 --- a/test/t/test_medusa.py +++ b/test/t/test_medusa.py @@ -5,4 +5,4 @@ class TestMedusa: @pytest.mark.complete("medusa -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mencoder.py b/test/t/test_mencoder.py index 73b29b1002b..ddba57b866d 100644 --- a/test/t/test_mencoder.py +++ b/test/t/test_mencoder.py @@ -10,8 +10,8 @@ class TestMencoder: @pytest.mark.complete("mencoder ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("mencoder -v") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mii_diag.py b/test/t/test_mii_diag.py index b0cd4f41050..3c4113084a8 100644 --- a/test/t/test_mii_diag.py +++ b/test/t/test_mii_diag.py @@ -8,4 +8,4 @@ class TestMiiDiag: @pytest.mark.complete("mii-diag ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mii_tool.py b/test/t/test_mii_tool.py index fc7a6e1407f..7d11bc285a5 100644 --- a/test/t/test_mii_tool.py +++ b/test/t/test_mii_tool.py @@ -8,4 +8,4 @@ class TestMiiTool: @pytest.mark.complete("mii-tool ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_minicom.py b/test/t/test_minicom.py index 89f030dea22..d04bd1be220 100644 --- a/test/t/test_minicom.py +++ b/test/t/test_minicom.py @@ -5,4 +5,4 @@ class TestMinicom: @pytest.mark.complete("minicom -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mkdir.py b/test/t/test_mkdir.py index 3b42f3c3e8f..3019c3bc62e 100644 --- a/test/t/test_mkdir.py +++ b/test/t/test_mkdir.py @@ -5,16 +5,15 @@ class TestMkdir: @pytest.mark.complete("mkdir ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("mkdir ", cwd="shared/default") def test_2(self, completion): - assert completion.list == ["bar bar.d/", "foo", "foo.d/"] + assert completion == ["bar bar.d/", "foo", "foo.d/"] - # TODO: why path in completion.list, basename in .output? - @pytest.mark.xfail + @pytest.mark.xfail # TODO: why path in completion, basename in .output? @pytest.mark.complete("mkdir shared/default/foo.d/") def test_3(self, completion): assert completion.output == "foo" - assert completion.list == [completion.output] + assert completion == [completion.output] diff --git a/test/t/test_mkfifo.py b/test/t/test_mkfifo.py index 3ca8bb45e84..1853c150a10 100644 --- a/test/t/test_mkfifo.py +++ b/test/t/test_mkfifo.py @@ -5,4 +5,4 @@ class TestMkfifo: @pytest.mark.complete("mkfifo ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mkinitrd.py b/test/t/test_mkinitrd.py index 834617aecd1..c404150bc4b 100644 --- a/test/t/test_mkinitrd.py +++ b/test/t/test_mkinitrd.py @@ -5,4 +5,4 @@ class TestMkinitrd: @pytest.mark.complete("mkinitrd ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mkisofs.py b/test/t/test_mkisofs.py index 6a668d4590e..5d330cb717e 100644 --- a/test/t/test_mkisofs.py +++ b/test/t/test_mkisofs.py @@ -5,12 +5,12 @@ class TestMkisofs: @pytest.mark.complete("mkisofs ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("mkisofs -uid ") def test_2(self, completion): - assert not [x for x in completion.list if not x.isdigit()] + assert not [x for x in completion if not x.isdigit()] @pytest.mark.complete("mkisofs -gid ") def test_3(self, completion): - assert not [x for x in completion.list if not x.isdigit()] + assert not [x for x in completion if not x.isdigit()] diff --git a/test/t/test_mknod.py b/test/t/test_mknod.py index 4a6c2692d50..3e0d4b60a07 100644 --- a/test/t/test_mknod.py +++ b/test/t/test_mknod.py @@ -5,4 +5,4 @@ class TestMknod: @pytest.mark.complete("mknod ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mktemp.py b/test/t/test_mktemp.py index fa6d91f28c8..fd99a4d1662 100644 --- a/test/t/test_mktemp.py +++ b/test/t/test_mktemp.py @@ -5,4 +5,4 @@ class TestMktemp: @pytest.mark.complete("mktemp -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mmsitepass.py b/test/t/test_mmsitepass.py index 12f11813176..7bedcc2aaa9 100644 --- a/test/t/test_mmsitepass.py +++ b/test/t/test_mmsitepass.py @@ -5,4 +5,4 @@ class TestMmsitepass: @pytest.mark.complete("mmsitepass -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mock.py b/test/t/test_mock.py index bec255afc43..2bdcf8ef051 100644 --- a/test/t/test_mock.py +++ b/test/t/test_mock.py @@ -5,4 +5,4 @@ class TestMock: @pytest.mark.complete("mock ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_modinfo.py b/test/t/test_modinfo.py index 4dc61040f34..c8fbbb209ad 100644 --- a/test/t/test_modinfo.py +++ b/test/t/test_modinfo.py @@ -7,7 +7,7 @@ class TestModinfo: @pytest.mark.complete("modinfo -") def test_1(self, completion): - assert completion.list + assert completion # "in": intel*, ... @pytest.mark.complete("modinfo in", @@ -17,14 +17,14 @@ def test_1(self, completion): "echo non-existent-kernel", shell=True).decode().strip()) def test_2(self, completion): - assert completion.list + assert completion # "in": intel*, ... @pytest.mark.complete("modinfo -k non-existent-kernel in") def test_3(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("modinfo /tm") def test_4(self, completion): - assert completion.list - assert not completion.output.endswith(" ") + assert completion + assert not completion.endswith(" ") diff --git a/test/t/test_modprobe.py b/test/t/test_modprobe.py index 0ac2eaf3bea..33b8bfecb75 100644 --- a/test/t/test_modprobe.py +++ b/test/t/test_modprobe.py @@ -7,7 +7,7 @@ class TestModprobe: @pytest.mark.complete("modprobe --al") def test_1(self, completion): - assert completion.list == ["--all"] + assert completion == "--all" # "in": intel*, ... @pytest.mark.complete("modprobe in", @@ -17,18 +17,18 @@ def test_1(self, completion): "echo non-existent-kernel", shell=True).decode().strip()) def test_2(self, completion): - assert completion.list + assert completion # "in": intel*, ... @pytest.mark.complete("modprobe -S non-existent-kernel in") def test_3(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("modprobe non-existent-module ") def test_4(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("modprobe /tm") def test_5(self, completion): - assert completion.list - assert not completion.output.endswith(" ") + assert completion + assert not completion.endswith(" ") diff --git a/test/t/test_module.py b/test/t/test_module.py index 67e407b37dc..7f2f75e603b 100644 --- a/test/t/test_module.py +++ b/test/t/test_module.py @@ -5,4 +5,4 @@ class TestModule: @pytest.mark.complete("module ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mogrify.py b/test/t/test_mogrify.py index 3ae76218760..1884bb1c1a8 100644 --- a/test/t/test_mogrify.py +++ b/test/t/test_mogrify.py @@ -5,4 +5,4 @@ class TestMogrify: @pytest.mark.complete("mogrify ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_monodevelop.py b/test/t/test_monodevelop.py index 1f2bbd5143a..dfdad07a1e4 100644 --- a/test/t/test_monodevelop.py +++ b/test/t/test_monodevelop.py @@ -5,4 +5,4 @@ class TestMonodevelop: @pytest.mark.complete("monodevelop ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_montage.py b/test/t/test_montage.py index c4e053eaec1..521e82f32e2 100644 --- a/test/t/test_montage.py +++ b/test/t/test_montage.py @@ -5,4 +5,4 @@ class TestMontage: @pytest.mark.complete("montage ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mount.py b/test/t/test_mount.py index 2deb57489ee..b36d92b3d54 100644 --- a/test/t/test_mount.py +++ b/test/t/test_mount.py @@ -5,18 +5,18 @@ class TestMount: @pytest.mark.complete("mount ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("mount -t ") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("mount /dev/sda1 def", cwd="shared") def test_3(self, completion): - assert completion.list == ["default/"] - assert not completion.output.endswith(" ") + assert completion == "default/" + assert not completion.endswith(" ") @pytest.mark.complete("mount mocksrv:/", env=dict(PATH="$PWD/mount/bin:$PATH")) def test_4(self, completion): - assert completion.list == "/second/path /test/path /test/path2".split() + assert completion == "/second/path /test/path /test/path2".split() diff --git a/test/t/test_mplayer.py b/test/t/test_mplayer.py index 8ede0caaa6d..24c2bc98486 100644 --- a/test/t/test_mplayer.py +++ b/test/t/test_mplayer.py @@ -10,8 +10,8 @@ class TestMplayer: @pytest.mark.complete("mplayer ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("mplayer -h") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mr.py b/test/t/test_mr.py index b0a5cd6654a..41bec5d0860 100644 --- a/test/t/test_mr.py +++ b/test/t/test_mr.py @@ -5,39 +5,38 @@ class TestMr: @pytest.mark.complete("mr ") def test_1(self, completion): - assert completion.list + assert completion # man -h tests below: Some mr versions require man to be around in order # to provide useful output. @pytest.mark.complete("mr --", skipif="! man -h &>/dev/null") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("mr -c shared/default/foo.d/", skipif="! man -h &>/dev/null") def test_3(self, completion): - assert completion.list == ["shared/default/foo.d/foo"] + assert completion == "shared/default/foo.d/foo" - @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("mr bootstrap shared/default/", skipif="! man -h &>/dev/null") def test_4(self, completion): - assert completion.list == ["bar", "bar bar.d/", "foo", "foo.d/"] + assert completion == ["bar", "bar bar.d/", "foo", "foo.d/"] @pytest.mark.xfail # "clean" doesn't exist before mr 1.20141023 @pytest.mark.complete("mr clean -", skipif="! man -h &>/dev/null") def test_5(self, completion): - assert completion.list == ["-f"] + assert completion == "-f" @pytest.mark.complete("mr commit -", skipif="! man -h &>/dev/null") def test_6(self, completion): - assert completion.list == ["-m"] + assert completion == "-m" @pytest.mark.complete("mr status ", skipif="! man -h &>/dev/null") def test_7(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("mr run ", skipif="! man -h &>/dev/null") def test_8(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_msgsnarf.py b/test/t/test_msgsnarf.py index 267e5e5ff6d..17a3ea2620f 100644 --- a/test/t/test_msgsnarf.py +++ b/test/t/test_msgsnarf.py @@ -5,4 +5,4 @@ class TestMsgsnarf: @pytest.mark.complete("msgsnarf -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_msynctool.py b/test/t/test_msynctool.py index ac61be088ae..3e0a219974f 100644 --- a/test/t/test_msynctool.py +++ b/test/t/test_msynctool.py @@ -5,4 +5,4 @@ class TestMsynctool: @pytest.mark.complete("msynctool ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mtx.py b/test/t/test_mtx.py index 97bf27e8140..6db7ff026b5 100644 --- a/test/t/test_mtx.py +++ b/test/t/test_mtx.py @@ -5,4 +5,4 @@ class TestMtx: @pytest.mark.complete("mtx ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_munin_node_configure.py b/test/t/test_munin_node_configure.py index 0048d6ceda5..c99d85aca75 100644 --- a/test/t/test_munin_node_configure.py +++ b/test/t/test_munin_node_configure.py @@ -8,4 +8,4 @@ class TestMuninNodeConfigure: @pytest.mark.complete("munin-node-configure --libdir ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_munin_run.py b/test/t/test_munin_run.py index 981d1bb2525..233ef7735ed 100644 --- a/test/t/test_munin_run.py +++ b/test/t/test_munin_run.py @@ -8,4 +8,4 @@ class TestMuninRun: @pytest.mark.complete("munin-run -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_munindoc.py b/test/t/test_munindoc.py index db2c7b82c3b..6b226e43ef9 100644 --- a/test/t/test_munindoc.py +++ b/test/t/test_munindoc.py @@ -6,4 +6,4 @@ class TestMunindoc: # Assume at least munin* available @pytest.mark.complete("munindoc m") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mussh.py b/test/t/test_mussh.py index 0bde28885f1..cad36be3c58 100644 --- a/test/t/test_mussh.py +++ b/test/t/test_mussh.py @@ -5,4 +5,4 @@ class TestMussh: @pytest.mark.complete("mussh -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mutt.py b/test/t/test_mutt.py index 0a87995494e..735337896eb 100644 --- a/test/t/test_mutt.py +++ b/test/t/test_mutt.py @@ -12,15 +12,15 @@ class TestMutt: @pytest.mark.complete("mutt -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("mutt -F muttrc -f =", cwd="mutt") def test_2(self, completion): - assert completion.list == "bar/ foo/ muttrc".split() + assert completion == "bar/ foo/ muttrc".split() @pytest.mark.complete("mutt -F muttrc -A ", cwd="mutt") def test_3(self, completion): - assert completion.list == "a1 a2".split() + assert completion == "a1 a2".split() def test_4(self, bash): got = assert_bash_exec( diff --git a/test/t/test_muttng.py b/test/t/test_muttng.py index ee45f5db3fb..2cf38f07cf4 100644 --- a/test/t/test_muttng.py +++ b/test/t/test_muttng.py @@ -5,4 +5,4 @@ class TestMuttng: @pytest.mark.complete("muttng -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mv.py b/test/t/test_mv.py index a1ae230631c..21277659c04 100644 --- a/test/t/test_mv.py +++ b/test/t/test_mv.py @@ -5,4 +5,4 @@ class TestMv: @pytest.mark.complete("mv ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mypy.py b/test/t/test_mypy.py index 4d401208ffc..2a731058acf 100644 --- a/test/t/test_mypy.py +++ b/test/t/test_mypy.py @@ -5,8 +5,8 @@ class TestMypy: @pytest.mark.complete("mypy ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("mypy --") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mysql.py b/test/t/test_mysql.py index a3d325235f4..d04570e4d4e 100644 --- a/test/t/test_mysql.py +++ b/test/t/test_mysql.py @@ -5,8 +5,8 @@ class TestMysql: @pytest.mark.complete("mysql --") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("mysql --default-character-set=") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_mysqladmin.py b/test/t/test_mysqladmin.py index cc574805e88..b63f586bb0c 100644 --- a/test/t/test_mysqladmin.py +++ b/test/t/test_mysqladmin.py @@ -5,4 +5,4 @@ class TestMysqladmin: @pytest.mark.complete("mysqladmin -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_nc.py b/test/t/test_nc.py index 9adefd7adfd..7c07ffa3f3f 100644 --- a/test/t/test_nc.py +++ b/test/t/test_nc.py @@ -5,4 +5,4 @@ class TestNc: @pytest.mark.complete("nc -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ncftp.py b/test/t/test_ncftp.py index d41903e0ed3..23b8218ca36 100644 --- a/test/t/test_ncftp.py +++ b/test/t/test_ncftp.py @@ -5,8 +5,8 @@ class TestNcftp: @pytest.mark.complete("ncftp ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("ncftp -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_nethogs.py b/test/t/test_nethogs.py index e0e38839136..c45a5946628 100644 --- a/test/t/test_nethogs.py +++ b/test/t/test_nethogs.py @@ -5,4 +5,4 @@ class TestNethogs: @pytest.mark.complete("nethogs ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_netstat.py b/test/t/test_netstat.py index ebbdd0717f3..011b61fe3d7 100644 --- a/test/t/test_netstat.py +++ b/test/t/test_netstat.py @@ -5,4 +5,4 @@ class TestNetstat: @pytest.mark.complete("netstat ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_newgrp.py b/test/t/test_newgrp.py index e547a68c8e1..8f4a14c0c00 100644 --- a/test/t/test_newgrp.py +++ b/test/t/test_newgrp.py @@ -5,4 +5,4 @@ class TestNewgrp: @pytest.mark.complete("newgrp ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_newlist.py b/test/t/test_newlist.py index d1436d3db24..17c957fe11f 100644 --- a/test/t/test_newlist.py +++ b/test/t/test_newlist.py @@ -5,4 +5,4 @@ class TestNewlist: @pytest.mark.complete("newlist -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_newusers.py b/test/t/test_newusers.py index 370d8cb86f0..a88411f916e 100644 --- a/test/t/test_newusers.py +++ b/test/t/test_newusers.py @@ -5,4 +5,4 @@ class TestNewusers: @pytest.mark.complete("newusers ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ngrep.py b/test/t/test_ngrep.py index 738d04b9363..63c869041e1 100644 --- a/test/t/test_ngrep.py +++ b/test/t/test_ngrep.py @@ -5,8 +5,8 @@ class TestNgrep: @pytest.mark.complete("ngrep -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("ngrep -d ") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_nl.py b/test/t/test_nl.py index 8e107d452c0..fa9c1440800 100644 --- a/test/t/test_nl.py +++ b/test/t/test_nl.py @@ -5,4 +5,4 @@ class TestNl: @pytest.mark.complete("nl ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_nm.py b/test/t/test_nm.py index 3159801cfce..fc12ed70343 100644 --- a/test/t/test_nm.py +++ b/test/t/test_nm.py @@ -5,4 +5,4 @@ class TestNm: @pytest.mark.complete("nm ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_nmap.py b/test/t/test_nmap.py index 85533e64905..198524fc608 100644 --- a/test/t/test_nmap.py +++ b/test/t/test_nmap.py @@ -5,4 +5,4 @@ class TestNmap: @pytest.mark.complete("nmap --v") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_nmcli.py b/test/t/test_nmcli.py index 4d3870e0a9d..8a3a1e44ed0 100644 --- a/test/t/test_nmcli.py +++ b/test/t/test_nmcli.py @@ -5,4 +5,4 @@ class TestNmcli: @pytest.mark.complete("nmcli ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_nproc.py b/test/t/test_nproc.py index 8540a9e9394..f32ca2d11a6 100644 --- a/test/t/test_nproc.py +++ b/test/t/test_nproc.py @@ -5,8 +5,8 @@ class TestNproc: @pytest.mark.complete("nproc ") def test_1(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("nproc -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_nslookup.py b/test/t/test_nslookup.py index 008377609fd..1270eac1285 100644 --- a/test/t/test_nslookup.py +++ b/test/t/test_nslookup.py @@ -5,4 +5,4 @@ class TestNslookup: @pytest.mark.complete("nslookup -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ntpdate.py b/test/t/test_ntpdate.py index 7d276781d65..dc810f422b2 100644 --- a/test/t/test_ntpdate.py +++ b/test/t/test_ntpdate.py @@ -5,4 +5,4 @@ class TestNtpdate: @pytest.mark.complete("ntpdate -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_objcopy.py b/test/t/test_objcopy.py index c159d19da2d..a757197107c 100644 --- a/test/t/test_objcopy.py +++ b/test/t/test_objcopy.py @@ -5,4 +5,4 @@ class TestObjcopy: @pytest.mark.complete("objcopy ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_objdump.py b/test/t/test_objdump.py index 3be236508a7..f2d5c48b883 100644 --- a/test/t/test_objdump.py +++ b/test/t/test_objdump.py @@ -5,4 +5,4 @@ class TestObjdump: @pytest.mark.complete("objdump ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_od.py b/test/t/test_od.py index 216eb225ca7..9a9312d53bc 100644 --- a/test/t/test_od.py +++ b/test/t/test_od.py @@ -5,4 +5,4 @@ class TestOd: @pytest.mark.complete("od ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_oggdec.py b/test/t/test_oggdec.py index 66391a273d5..fde8b08f08a 100644 --- a/test/t/test_oggdec.py +++ b/test/t/test_oggdec.py @@ -5,8 +5,8 @@ class TestOggdec: @pytest.mark.complete("oggdec ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("oggdec --") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_op.py b/test/t/test_op.py index 3309bee0e5f..6f24abc0955 100644 --- a/test/t/test_op.py +++ b/test/t/test_op.py @@ -5,8 +5,8 @@ class TestOp: @pytest.mark.complete("op ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("op --") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_openssl.py b/test/t/test_openssl.py index 775b9443429..69b7af150c2 100644 --- a/test/t/test_openssl.py +++ b/test/t/test_openssl.py @@ -5,12 +5,12 @@ class TestOpenssl: @pytest.mark.complete("openssl ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("openssl pkey -cipher ") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("openssl dgst -s") def test_3(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_opera.py b/test/t/test_opera.py index b24c0a1932d..d6573e311e1 100644 --- a/test/t/test_opera.py +++ b/test/t/test_opera.py @@ -5,4 +5,4 @@ class TestOpera: @pytest.mark.complete("opera ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_optipng.py b/test/t/test_optipng.py index a00e7aa2554..cac14805987 100644 --- a/test/t/test_optipng.py +++ b/test/t/test_optipng.py @@ -5,4 +5,4 @@ class TestOptipng: @pytest.mark.complete("optipng ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_p4.py b/test/t/test_p4.py index 91a8c749b0f..691ad465644 100644 --- a/test/t/test_p4.py +++ b/test/t/test_p4.py @@ -5,4 +5,4 @@ class TestP4: @pytest.mark.complete("p4 ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pack200.py b/test/t/test_pack200.py index 3ffbeb467f9..35b2b122ccb 100644 --- a/test/t/test_pack200.py +++ b/test/t/test_pack200.py @@ -5,4 +5,4 @@ class TestPack200: @pytest.mark.complete("pack200 ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_passwd.py b/test/t/test_passwd.py index c6e75a2ad80..4f75d65de3c 100644 --- a/test/t/test_passwd.py +++ b/test/t/test_passwd.py @@ -5,8 +5,8 @@ class TestPasswd: @pytest.mark.complete("passwd ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("passwd -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_paste.py b/test/t/test_paste.py index bc2d52e9682..fa30abe0f18 100644 --- a/test/t/test_paste.py +++ b/test/t/test_paste.py @@ -5,4 +5,4 @@ class TestPaste: @pytest.mark.complete("paste ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_patch.py b/test/t/test_patch.py index a1fc0e147fc..dec96de0c7d 100644 --- a/test/t/test_patch.py +++ b/test/t/test_patch.py @@ -5,4 +5,4 @@ class TestPatch: @pytest.mark.complete("patch ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pdftotext.py b/test/t/test_pdftotext.py index 64d87d849ef..10876dcead0 100644 --- a/test/t/test_pdftotext.py +++ b/test/t/test_pdftotext.py @@ -5,4 +5,4 @@ class TestPdftotext: @pytest.mark.complete("pdftotext ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_perl.py b/test/t/test_perl.py index a2afb16849a..a13ab7d9297 100644 --- a/test/t/test_perl.py +++ b/test/t/test_perl.py @@ -6,76 +6,75 @@ class TestPerl: @pytest.mark.complete("perl ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("perl -e ") def test_2(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("perl -V:install") def test_3(self, completion): - assert completion.list + assert completion @pytest.mark.complete("perl -V::install") def test_4(self, completion): - assert completion.list + assert completion # Assume File::Spec and friends are always installed @pytest.mark.complete("perl -MFile") def test_5(self, completion): - assert completion.list + assert completion @pytest.mark.complete("perl -MFile::Sp") def test_6(self, completion): - assert completion.list + assert completion @pytest.mark.complete("perl -MFile::Spec::Func") def test_7(self, completion): - assert completion.list + assert completion @pytest.mark.complete("perl -M-File") def test_8(self, completion): - assert completion.list + assert completion @pytest.mark.complete("perl -m-File::") def test_9(self, completion): - assert completion.list + assert completion @pytest.mark.complete("perl -") def test_10(self, completion): - assert completion.list + assert completion @pytest.mark.complete("perl foo shared/default/f") def test_11(self, completion): """Second arg should complete files+dirs.""" - assert completion.list == "foo foo.d/".split() + assert completion == "foo foo.d/".split() @pytest.mark.complete("perl -Ishared/default/") def test_12(self, completion): """-I without space should complete dirs.""" - assert completion.list == ["bar bar.d/", "foo.d/"] + assert completion == ["bar bar.d/", "foo.d/"] - @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("perl -I shared/default/") def test_13(self, completion): """-I with space should complete dirs.""" - assert completion.list == ["bar bar.d/", "foo.d/"] + assert completion == ["bar bar.d/", "foo.d/"] @pytest.mark.complete("perl -xshared/default/b") def test_14(self, completion): """-x without space should complete dirs.""" - assert completion.list == ["-xshared/default/bar bar.d/"] + assert completion == ["-xshared/default/bar bar.d/"] @pytest.mark.complete("perl -x shared/default/b") def test_15(self, completion): """-x with space should complete dirs.""" - assert completion.list == ["shared/default/bar bar.d/"] + assert completion == ["shared/default/bar bar.d/"] @pytest.mark.complete("perl -d:", env=dict(PERL5LIB="$PWD/perl")) def test_16(self, completion): - assert "BashCompletion" in completion.list + assert "BashCompletion" in completion @pytest.mark.complete("perl -dt:", env=dict(PERL5LIB="$PWD/perl")) def test_17(self, completion): - assert "BashCompletion" in completion.list + assert "BashCompletion" in completion diff --git a/test/t/test_perlcritic.py b/test/t/test_perlcritic.py index efe6e781e03..e22f2e48384 100644 --- a/test/t/test_perlcritic.py +++ b/test/t/test_perlcritic.py @@ -5,12 +5,12 @@ class TestPerlcritic: @pytest.mark.complete("perlcritic ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("perlcritic --") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("perlcritic --theme ") def test_3(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_perldoc.py b/test/t/test_perldoc.py index e97c48203f1..f350e4e0680 100644 --- a/test/t/test_perldoc.py +++ b/test/t/test_perldoc.py @@ -10,14 +10,14 @@ class TestPerldoc: @pytest.mark.complete("perldoc File::") def test_1(self, completion): - assert "Path" in completion.list # Assume File::Path always installed - assert "fixtures/" not in completion.list # Our fixtures/ dir - assert not [x for x in completion.list if "File::File::" in x] + assert "Path" in completion # Assume File::Path always installed + assert "fixtures/" not in completion # Our fixtures/ dir + assert not [x for x in completion if "File::File::" in x] @pytest.mark.complete("perldoc -") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("perldoc BashCompletion") def test_3(self, completion): - assert completion.list == ["BashCompletionDoc", "BashCompletionModule"] + assert completion == "BashCompletionDoc BashCompletionModule".split() diff --git a/test/t/test_perltidy.py b/test/t/test_perltidy.py index 295bc2434b3..c1c40549461 100644 --- a/test/t/test_perltidy.py +++ b/test/t/test_perltidy.py @@ -5,16 +5,16 @@ class TestPerltidy: @pytest.mark.complete("perltidy ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("perltidy -h") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("perltidy -ole=") def test_3(self, completion): - assert completion.list + assert completion @pytest.mark.complete("perltidy -doesntexist=") def test_4(self, completion): - assert not completion.list + assert not completion diff --git a/test/t/test_pgrep.py b/test/t/test_pgrep.py index 7042f1be416..1155e582b70 100644 --- a/test/t/test_pgrep.py +++ b/test/t/test_pgrep.py @@ -6,4 +6,4 @@ class TestPgrep: # "p": Assume that our process name completion runs ps @pytest.mark.complete("pgrep p") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_phing.py b/test/t/test_phing.py index 71d077d078b..33ffd977851 100644 --- a/test/t/test_phing.py +++ b/test/t/test_phing.py @@ -5,4 +5,4 @@ class TestPhing: @pytest.mark.complete("phing -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pidof.py b/test/t/test_pidof.py index 77fcaa8f684..fb553e5539a 100644 --- a/test/t/test_pidof.py +++ b/test/t/test_pidof.py @@ -6,4 +6,4 @@ class TestPidof: # "p": Assume that our process name completion runs ps @pytest.mark.complete("pidof p") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pine.py b/test/t/test_pine.py index 9c08c6dfe43..055e6779c63 100644 --- a/test/t/test_pine.py +++ b/test/t/test_pine.py @@ -5,4 +5,4 @@ class TestPine: @pytest.mark.complete("pine -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pinfo.py b/test/t/test_pinfo.py index 7661723751c..24da55393e7 100644 --- a/test/t/test_pinfo.py +++ b/test/t/test_pinfo.py @@ -10,8 +10,8 @@ class TestPinfo: @pytest.mark.complete("pinfo -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("pinfo bash") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ping.py b/test/t/test_ping.py index 19adfd9ebbc..86f1318c43b 100644 --- a/test/t/test_ping.py +++ b/test/t/test_ping.py @@ -5,8 +5,8 @@ class TestPing: @pytest.mark.complete("ping ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("ping -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pkg_config.py b/test/t/test_pkg_config.py index deb1de385d4..e38d5380808 100644 --- a/test/t/test_pkg_config.py +++ b/test/t/test_pkg_config.py @@ -8,8 +8,8 @@ class TestPkgConfig: @pytest.mark.complete("pkg-config ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("pkg-config -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pkg_deinstall.py b/test/t/test_pkg_deinstall.py index 79a73a8c1e0..825ed05a1db 100644 --- a/test/t/test_pkg_deinstall.py +++ b/test/t/test_pkg_deinstall.py @@ -14,4 +14,4 @@ class TestPkgDeinstall: def test_1(self, completion): dirs = sorted(x for x in os.listdir("pkgtools/db") if os.path.isdir("pkgtools/db/%s" % x)) - assert completion.list == dirs + assert completion == dirs diff --git a/test/t/test_pkg_delete.py b/test/t/test_pkg_delete.py index 83506f88996..c0f255ad449 100644 --- a/test/t/test_pkg_delete.py +++ b/test/t/test_pkg_delete.py @@ -5,4 +5,4 @@ class TestPkgDelete: @pytest.mark.complete("pkg_delete ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pkg_get.py b/test/t/test_pkg_get.py index a8049785347..c07d2dbd8e1 100644 --- a/test/t/test_pkg_get.py +++ b/test/t/test_pkg_get.py @@ -8,4 +8,4 @@ class TestPkgGet: @pytest.mark.complete("pkg-get ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pkg_info.py b/test/t/test_pkg_info.py index 0e29b3edccc..6496f0cff77 100644 --- a/test/t/test_pkg_info.py +++ b/test/t/test_pkg_info.py @@ -5,4 +5,4 @@ class TestPkgInfo: @pytest.mark.complete("pkg_info ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pkgadd.py b/test/t/test_pkgadd.py index ddff07f8969..4ed73a87eaa 100644 --- a/test/t/test_pkgadd.py +++ b/test/t/test_pkgadd.py @@ -5,4 +5,4 @@ class TestPkgadd: @pytest.mark.complete("pkgadd ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pkgrm.py b/test/t/test_pkgrm.py index 5cdcfd53184..477eb6d5208 100644 --- a/test/t/test_pkgrm.py +++ b/test/t/test_pkgrm.py @@ -5,4 +5,4 @@ class TestPkgrm: @pytest.mark.complete("pkgrm ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pkgtool.py b/test/t/test_pkgtool.py index baec2b9225e..c0adeef98b4 100644 --- a/test/t/test_pkgtool.py +++ b/test/t/test_pkgtool.py @@ -5,4 +5,4 @@ class TestPkgtool: @pytest.mark.complete("pkgtool -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pkgutil.py b/test/t/test_pkgutil.py index d5f9c8e711d..b370eadb9ef 100644 --- a/test/t/test_pkgutil.py +++ b/test/t/test_pkgutil.py @@ -5,4 +5,4 @@ class TestPkgutil: @pytest.mark.complete("pkgutil ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pkill.py b/test/t/test_pkill.py index 392d669f70d..1c193fe0d9b 100644 --- a/test/t/test_pkill.py +++ b/test/t/test_pkill.py @@ -5,4 +5,4 @@ class TestPkill: @pytest.mark.complete("pkill ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_plague_client.py b/test/t/test_plague_client.py index b05c778453e..47e56ca7f23 100644 --- a/test/t/test_plague_client.py +++ b/test/t/test_plague_client.py @@ -8,4 +8,4 @@ class TestPlagueClient: @pytest.mark.complete("plague-client ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pm_hibernate.py b/test/t/test_pm_hibernate.py index 4b3d92f6b77..d6b0cbe10a5 100644 --- a/test/t/test_pm_hibernate.py +++ b/test/t/test_pm_hibernate.py @@ -8,4 +8,4 @@ class TestPmHibernate: @pytest.mark.complete("pm-hibernate -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pm_is_supported.py b/test/t/test_pm_is_supported.py index 72c75aeecfb..19ebed97dd6 100644 --- a/test/t/test_pm_is_supported.py +++ b/test/t/test_pm_is_supported.py @@ -8,4 +8,4 @@ class TestPmIsSupported: @pytest.mark.complete("pm-is-supported -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pm_powersave.py b/test/t/test_pm_powersave.py index 87dfdfb516b..96d5407014f 100644 --- a/test/t/test_pm_powersave.py +++ b/test/t/test_pm_powersave.py @@ -8,4 +8,4 @@ class TestPmPowersave: @pytest.mark.complete("pm-powersave ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pngfix.py b/test/t/test_pngfix.py index 44875431bbc..f8099c8efe5 100644 --- a/test/t/test_pngfix.py +++ b/test/t/test_pngfix.py @@ -5,8 +5,8 @@ class TestPngfix: @pytest.mark.complete("pngfix ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("pngfix -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_portinstall.py b/test/t/test_portinstall.py index 417072787fe..a4ddde4a13a 100644 --- a/test/t/test_portinstall.py +++ b/test/t/test_portinstall.py @@ -16,6 +16,6 @@ def portsdir(self, request, bash): @pytest.mark.complete("portinstall ", env=dict(PORTSDIR="$TESTDIR/tmp")) def test_1(self, completion, portsdir): - assert completion.list == \ + assert completion == \ "bash-2.05b.007_6 bash-3.1.17 bash-completion-20060301_2 " \ "shells/bash shells/bash-completion shells/bash2".split() diff --git a/test/t/test_portsnap.py b/test/t/test_portsnap.py index 82ccbd787bd..572dd409792 100644 --- a/test/t/test_portsnap.py +++ b/test/t/test_portsnap.py @@ -5,4 +5,4 @@ class TestPortsnap: @pytest.mark.complete("portsnap ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_portupgrade.py b/test/t/test_portupgrade.py index 11e99d46ff6..0125916d6b5 100644 --- a/test/t/test_portupgrade.py +++ b/test/t/test_portupgrade.py @@ -10,5 +10,5 @@ class TestPortupgrade: @pytest.mark.complete("portupgrade ") def test_1(self, completion): - assert completion.list == "a b-c-d".split() - assert completion.output.endswith(" ") + assert completion == "a b-c-d".split() + assert completion.endswith(" ") diff --git a/test/t/test_postcat.py b/test/t/test_postcat.py index ebe23c0dd59..6409ef29c94 100644 --- a/test/t/test_postcat.py +++ b/test/t/test_postcat.py @@ -5,4 +5,4 @@ class TestPostcat: @pytest.mark.complete("postcat ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_postconf.py b/test/t/test_postconf.py index a7349564732..df917fb9da2 100644 --- a/test/t/test_postconf.py +++ b/test/t/test_postconf.py @@ -5,7 +5,7 @@ class TestPostconf: @pytest.mark.complete("postconf -") def test_1(self, completion): - assert len(completion.list) > 1 + assert len(completion) > 1 # Broken configs may abort output of postconf halfway through, so use # something from early output to not trigger false positives because of @@ -16,4 +16,4 @@ def test_1(self, completion): # ...or be completely missing, so all we can do is to skip. @pytest.mark.complete("postconf al", skipif="! postconf &>/dev/null") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_postfix.py b/test/t/test_postfix.py index 83af4d84f8b..2530992fb88 100644 --- a/test/t/test_postfix.py +++ b/test/t/test_postfix.py @@ -5,4 +5,4 @@ class TestPostfix: @pytest.mark.complete("postfix ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_postmap.py b/test/t/test_postmap.py index e9d11944ca6..fc248d4f28f 100644 --- a/test/t/test_postmap.py +++ b/test/t/test_postmap.py @@ -5,4 +5,4 @@ class TestPostmap: @pytest.mark.complete("postmap ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_postsuper.py b/test/t/test_postsuper.py index 3f783d1a029..a22b6d59ddb 100644 --- a/test/t/test_postsuper.py +++ b/test/t/test_postsuper.py @@ -5,4 +5,4 @@ class TestPostsuper: @pytest.mark.complete("postsuper ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_povray.py b/test/t/test_povray.py index 8490343562d..d7dbc7b5a14 100644 --- a/test/t/test_povray.py +++ b/test/t/test_povray.py @@ -5,4 +5,4 @@ class TestPovray: @pytest.mark.complete("povray ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pr.py b/test/t/test_pr.py index 8840e352375..843084e8e8e 100644 --- a/test/t/test_pr.py +++ b/test/t/test_pr.py @@ -5,4 +5,4 @@ class TestPr: @pytest.mark.complete("pr ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_prelink.py b/test/t/test_prelink.py index 338feb2ced4..504c78aae6b 100644 --- a/test/t/test_prelink.py +++ b/test/t/test_prelink.py @@ -5,8 +5,8 @@ class TestPrelink: @pytest.mark.complete("prelink ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("prelink -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_protoc.py b/test/t/test_protoc.py index c53ac0f47d7..cba7e313a7a 100644 --- a/test/t/test_protoc.py +++ b/test/t/test_protoc.py @@ -5,4 +5,4 @@ class TestProtoc: @pytest.mark.complete("protoc ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_psql.py b/test/t/test_psql.py index 47b5a53cddb..3b115d776e4 100644 --- a/test/t/test_psql.py +++ b/test/t/test_psql.py @@ -7,4 +7,4 @@ class TestPsql: @pytest.mark.complete("psql -", skipif="! psql --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ptx.py b/test/t/test_ptx.py index 2ef69e874b2..e40e0c75778 100644 --- a/test/t/test_ptx.py +++ b/test/t/test_ptx.py @@ -5,4 +5,4 @@ class TestPtx: @pytest.mark.complete("ptx ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_puppet.py b/test/t/test_puppet.py index 39e5530109a..8cf67281a0d 100644 --- a/test/t/test_puppet.py +++ b/test/t/test_puppet.py @@ -5,8 +5,8 @@ class TestPuppet: @pytest.mark.complete("puppet ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("puppet agent --") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pushd.py b/test/t/test_pushd.py index a542ce50c9a..19d2d9c781e 100644 --- a/test/t/test_pushd.py +++ b/test/t/test_pushd.py @@ -5,4 +5,4 @@ class TestPushd: @pytest.mark.complete("pushd ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pv.py b/test/t/test_pv.py index 50ca589d2f3..e9bb7051f00 100644 --- a/test/t/test_pv.py +++ b/test/t/test_pv.py @@ -5,12 +5,12 @@ class TestPv: @pytest.mark.complete("pv ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("pv -") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("pv --pidfile ") def test_3(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pvchange.py b/test/t/test_pvchange.py index 7b0df9d9073..d3cac47b7a4 100644 --- a/test/t/test_pvchange.py +++ b/test/t/test_pvchange.py @@ -6,4 +6,4 @@ class TestPvchange: @pytest.mark.complete("pvchange --", skipif="! pvchange --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pvcreate.py b/test/t/test_pvcreate.py index 1782d1b8428..87cda0df679 100644 --- a/test/t/test_pvcreate.py +++ b/test/t/test_pvcreate.py @@ -6,4 +6,4 @@ class TestPvcreate: @pytest.mark.complete("pvcreate --", skipif="! pvcreate --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pvdisplay.py b/test/t/test_pvdisplay.py index 28c7749b546..ad71e900fbe 100644 --- a/test/t/test_pvdisplay.py +++ b/test/t/test_pvdisplay.py @@ -6,4 +6,4 @@ class TestPvdisplay: @pytest.mark.complete("pvdisplay --", skipif="! pvdisplay --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pvmove.py b/test/t/test_pvmove.py index 80da20c6320..c7f8bb24ff6 100644 --- a/test/t/test_pvmove.py +++ b/test/t/test_pvmove.py @@ -5,4 +5,4 @@ class TestPvmove: @pytest.mark.complete("pvmove --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pvremove.py b/test/t/test_pvremove.py index 13278f6c1dc..421c4657868 100644 --- a/test/t/test_pvremove.py +++ b/test/t/test_pvremove.py @@ -6,4 +6,4 @@ class TestPvremove: @pytest.mark.complete("pvremove --", skipif="! pvremove --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pvs.py b/test/t/test_pvs.py index 220f9c4d386..a2ce84f0506 100644 --- a/test/t/test_pvs.py +++ b/test/t/test_pvs.py @@ -6,4 +6,4 @@ class TestPvs: @pytest.mark.complete("pvs --", skipif="! pvs --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pvscan.py b/test/t/test_pvscan.py index d0c99f2229d..8f2021dc3eb 100644 --- a/test/t/test_pvscan.py +++ b/test/t/test_pvscan.py @@ -5,4 +5,4 @@ class TestPvscan: @pytest.mark.complete("pvscan --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pwck.py b/test/t/test_pwck.py index a3907ecdc43..777d9d0602d 100644 --- a/test/t/test_pwck.py +++ b/test/t/test_pwck.py @@ -5,4 +5,4 @@ class TestPwck: @pytest.mark.complete("pwck ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pwd.py b/test/t/test_pwd.py index 3e67d17507a..b2de0d84f88 100644 --- a/test/t/test_pwd.py +++ b/test/t/test_pwd.py @@ -5,4 +5,4 @@ class TestPwd: @pytest.mark.complete("pwd -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pwdx.py b/test/t/test_pwdx.py index 24fc3ea340b..ecf2d8973f5 100644 --- a/test/t/test_pwdx.py +++ b/test/t/test_pwdx.py @@ -5,4 +5,4 @@ class TestPwdx: @pytest.mark.complete("pwdx ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pwgen.py b/test/t/test_pwgen.py index f917faddcbb..9ed61e13512 100644 --- a/test/t/test_pwgen.py +++ b/test/t/test_pwgen.py @@ -5,4 +5,4 @@ class TestPwgen: @pytest.mark.complete("pwgen -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pycodestyle.py b/test/t/test_pycodestyle.py index 464f96e6343..1c3211a166e 100644 --- a/test/t/test_pycodestyle.py +++ b/test/t/test_pycodestyle.py @@ -5,12 +5,12 @@ class TestPycodestyle: @pytest.mark.complete("pycodestyle ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("pycodestyle -") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("pycodestyle --doesnt-exist=") def test_3(self, completion): - assert not completion.list + assert not completion diff --git a/test/t/test_pydoc.py b/test/t/test_pydoc.py index 67d35b2a759..3ffe19dc262 100644 --- a/test/t/test_pydoc.py +++ b/test/t/test_pydoc.py @@ -5,4 +5,4 @@ class TestPydoc: @pytest.mark.complete("pydoc r") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pydocstyle.py b/test/t/test_pydocstyle.py index e152716c7ec..7b7a6f29118 100644 --- a/test/t/test_pydocstyle.py +++ b/test/t/test_pydocstyle.py @@ -5,8 +5,8 @@ class TestPydocstyle: @pytest.mark.complete("pydocstyle ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("pydocstyle -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pyflakes.py b/test/t/test_pyflakes.py index 8d74afdff5a..06d3d65698e 100644 --- a/test/t/test_pyflakes.py +++ b/test/t/test_pyflakes.py @@ -5,4 +5,4 @@ class TestPyflakes: @pytest.mark.complete("pyflakes ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pylint.py b/test/t/test_pylint.py index 074bca7b0be..975024a369d 100644 --- a/test/t/test_pylint.py +++ b/test/t/test_pylint.py @@ -5,8 +5,8 @@ class TestPylint: @pytest.mark.complete("pylint --v") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("pylint --confidence=HIGH,") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pylint_3.py b/test/t/test_pylint_3.py index 1923ea45c9e..a071c900446 100644 --- a/test/t/test_pylint_3.py +++ b/test/t/test_pylint_3.py @@ -8,8 +8,8 @@ class TestPylint3: @pytest.mark.complete("pylint-3 --v") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("pylint-3 http.clien") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pytest.py b/test/t/test_pytest.py index 672055b0aba..32889c11c85 100644 --- a/test/t/test_pytest.py +++ b/test/t/test_pytest.py @@ -5,8 +5,8 @@ class TestPytest: @pytest.mark.complete("pytest ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("pytest -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_python.py b/test/t/test_python.py index 8fe78f09375..b06eb36bf4b 100644 --- a/test/t/test_python.py +++ b/test/t/test_python.py @@ -5,34 +5,32 @@ class TestPython: @pytest.mark.complete("python ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("python -") def test_2(self, completion): - assert len(completion.list) > 1 + assert len(completion) > 1 @pytest.mark.complete("python -c ") def test_3(self, completion): - assert not completion.list + assert not completion - @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("python shared/default/") def test_4(self, completion): - assert completion.list == ["bar bar.d/", "foo.d/"] + assert completion == ["bar bar.d/", "foo.d/"] - @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("python -c foo shared/default/") def test_5(self, completion): - assert completion.list == ["bar", "bar bar.d/", "foo", "foo.d/"] + assert completion == ["bar", "bar bar.d/", "foo", "foo.d/"] @pytest.mark.complete("python -c foo -") def test_6(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("python -m foo -") def test_7(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("python -m sy") def test_8(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_python3.py b/test/t/test_python3.py index 0534b0759d8..ef0c546bc66 100644 --- a/test/t/test_python3.py +++ b/test/t/test_python3.py @@ -5,34 +5,32 @@ class TestPython3: @pytest.mark.complete("python3 ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("python3 -") def test_2(self, completion): - assert len(completion.list) > 1 + assert len(completion) > 1 @pytest.mark.complete("python3 -c ") def test_3(self, completion): - assert not completion.list + assert not completion - @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("python3 shared/default/") def test_4(self, completion): - assert completion.list == ["bar bar.d/", "foo.d/"] + assert completion == ["bar bar.d/", "foo.d/"] - @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("python3 -c foo shared/default/") def test_5(self, completion): - assert completion.list == ["bar", "bar bar.d/", "foo", "foo.d/"] + assert completion == ["bar", "bar bar.d/", "foo", "foo.d/"] @pytest.mark.complete("python3 -c foo -") def test_6(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("python3 -m foo -") def test_7(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("python3 -m sy") def test_8(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_pyvenv.py b/test/t/test_pyvenv.py index aa51418974a..9661e396795 100644 --- a/test/t/test_pyvenv.py +++ b/test/t/test_pyvenv.py @@ -5,4 +5,4 @@ class TestPyvenv: @pytest.mark.complete("pyvenv ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_qemu.py b/test/t/test_qemu.py index f51c23396a6..ca6b16fac6b 100644 --- a/test/t/test_qemu.py +++ b/test/t/test_qemu.py @@ -5,4 +5,4 @@ class TestQemu: @pytest.mark.complete("qemu ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_qrunner.py b/test/t/test_qrunner.py index 6353617ae50..b3b7bca358d 100644 --- a/test/t/test_qrunner.py +++ b/test/t/test_qrunner.py @@ -5,4 +5,4 @@ class TestQrunner: @pytest.mark.complete("qrunner -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_querybts.py b/test/t/test_querybts.py index f210698679f..267a4e5bc47 100644 --- a/test/t/test_querybts.py +++ b/test/t/test_querybts.py @@ -5,4 +5,4 @@ class TestQuerybts: @pytest.mark.complete("querybts --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_quota.py b/test/t/test_quota.py index 8dd5212ec76..538c7a8ac79 100644 --- a/test/t/test_quota.py +++ b/test/t/test_quota.py @@ -5,4 +5,4 @@ class TestQuota: @pytest.mark.complete("quota ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_quotacheck.py b/test/t/test_quotacheck.py index 30663d11450..fb60653f644 100644 --- a/test/t/test_quotacheck.py +++ b/test/t/test_quotacheck.py @@ -5,4 +5,4 @@ class TestQuotacheck: @pytest.mark.complete("quotacheck -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_quotaon.py b/test/t/test_quotaon.py index 236866d56f1..3cb6ca0181a 100644 --- a/test/t/test_quotaon.py +++ b/test/t/test_quotaon.py @@ -5,4 +5,4 @@ class TestQuotaon: @pytest.mark.complete("quotaon -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_radvdump.py b/test/t/test_radvdump.py index a7325427a74..11b52a4f669 100644 --- a/test/t/test_radvdump.py +++ b/test/t/test_radvdump.py @@ -5,4 +5,4 @@ class TestRadvdump: @pytest.mark.complete("radvdump ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_rcs.py b/test/t/test_rcs.py index 74faf85cf04..e15abf21fa6 100644 --- a/test/t/test_rcs.py +++ b/test/t/test_rcs.py @@ -5,4 +5,4 @@ class TestRcs: @pytest.mark.complete("rcs ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_rcsdiff.py b/test/t/test_rcsdiff.py index cff02406498..d569f0a6830 100644 --- a/test/t/test_rcsdiff.py +++ b/test/t/test_rcsdiff.py @@ -5,4 +5,4 @@ class TestRcsdiff: @pytest.mark.complete("rcsdiff ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_rdesktop.py b/test/t/test_rdesktop.py index 30b210b9be1..2bc76c07261 100644 --- a/test/t/test_rdesktop.py +++ b/test/t/test_rdesktop.py @@ -5,4 +5,4 @@ class TestRdesktop: @pytest.mark.complete("rdesktop -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_rdict.py b/test/t/test_rdict.py index 519ab2f39df..3c7a76b94ee 100644 --- a/test/t/test_rdict.py +++ b/test/t/test_rdict.py @@ -5,4 +5,4 @@ class TestRdict: @pytest.mark.complete("rdict --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_readelf.py b/test/t/test_readelf.py index 971b2cbd663..9cfca05bb9f 100644 --- a/test/t/test_readelf.py +++ b/test/t/test_readelf.py @@ -5,4 +5,4 @@ class TestReadelf: @pytest.mark.complete("readelf --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_readonly.py b/test/t/test_readonly.py index 2729433e9f3..32a5b9db7c9 100644 --- a/test/t/test_readonly.py +++ b/test/t/test_readonly.py @@ -5,4 +5,4 @@ class TestReadonly: @pytest.mark.complete("readonly BASH_ARG") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_remove_members.py b/test/t/test_remove_members.py index 3d5f1132665..0521def1a1c 100644 --- a/test/t/test_remove_members.py +++ b/test/t/test_remove_members.py @@ -5,4 +5,4 @@ class TestRemoveMembers: @pytest.mark.complete("remove_members --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_removepkg.py b/test/t/test_removepkg.py index 16b0b75f569..e706a8e2b36 100644 --- a/test/t/test_removepkg.py +++ b/test/t/test_removepkg.py @@ -8,9 +8,9 @@ class TestRemovepkg: @pytest.mark.complete("removepkg -") def test_1(self, completion): - assert completion.list == "-copy -keep -preserve -warn".split() + assert completion == "-copy -keep -preserve -warn".split() @pytest.mark.complete("removepkg ", env=dict(ROOT="./slackware")) def test_2(self, completion): files = sorted(x for x in os.listdir("slackware/var/log/packages")) - assert completion.list == files + assert completion == files diff --git a/test/t/test_renice.py b/test/t/test_renice.py index 1921bbe37df..723124f0951 100644 --- a/test/t/test_renice.py +++ b/test/t/test_renice.py @@ -5,8 +5,8 @@ class TestRenice: @pytest.mark.complete("renice 1") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("renice -g ") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_repomanage.py b/test/t/test_repomanage.py index 6906108d6ff..f50025f71de 100644 --- a/test/t/test_repomanage.py +++ b/test/t/test_repomanage.py @@ -5,4 +5,4 @@ class TestRepomanage: @pytest.mark.complete("repomanage ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_reportbug.py b/test/t/test_reportbug.py index aa9e18202cc..79e7a729662 100644 --- a/test/t/test_reportbug.py +++ b/test/t/test_reportbug.py @@ -5,4 +5,4 @@ class TestReportbug: @pytest.mark.complete("reportbug --m") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_reptyr.py b/test/t/test_reptyr.py index ea09b68ea2c..c737f1b24a1 100644 --- a/test/t/test_reptyr.py +++ b/test/t/test_reptyr.py @@ -5,8 +5,8 @@ class TestReptyr: @pytest.mark.complete("reptyr ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("reptyr -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_resolvconf.py b/test/t/test_resolvconf.py index dbc06340e8c..45ea053279e 100644 --- a/test/t/test_resolvconf.py +++ b/test/t/test_resolvconf.py @@ -5,4 +5,4 @@ class TestResolvconf: @pytest.mark.complete("resolvconf -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_rfcomm.py b/test/t/test_rfcomm.py index 15ecdab4382..4c3ab1526df 100644 --- a/test/t/test_rfcomm.py +++ b/test/t/test_rfcomm.py @@ -5,4 +5,4 @@ class TestRfcomm: @pytest.mark.complete("rfcomm ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_rfkill.py b/test/t/test_rfkill.py index 6b3da656b90..06b7e4bfcf0 100644 --- a/test/t/test_rfkill.py +++ b/test/t/test_rfkill.py @@ -5,8 +5,8 @@ class TestRfkill: @pytest.mark.complete("rfkill ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("rfkill -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ri.py b/test/t/test_ri.py index 57d9f5ed0b2..dbc3ead27ef 100644 --- a/test/t/test_ri.py +++ b/test/t/test_ri.py @@ -10,13 +10,13 @@ class TestRi: @pytest.mark.complete("ri -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.xfail # TODO: completion split issues (single space) @pytest.mark.complete("ri --dump=ri/") def test_2(self, completion): - assert completion.list == "BashCompletion/ cache.ri".split() + assert completion == "BashCompletion/ cache.ri".split() @pytest.mark.complete("ri BashCompletio") def test_3(self, completion): - assert completion.list == ["BashCompletion"] + assert completion == "BashCompletion" diff --git a/test/t/test_rlog.py b/test/t/test_rlog.py index bf4fa575b38..6ee3343624b 100644 --- a/test/t/test_rlog.py +++ b/test/t/test_rlog.py @@ -5,4 +5,4 @@ class TestRlog: @pytest.mark.complete("rlog ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_rm.py b/test/t/test_rm.py index 6b861e4c167..410e52a6809 100644 --- a/test/t/test_rm.py +++ b/test/t/test_rm.py @@ -5,4 +5,4 @@ class TestRm: @pytest.mark.complete("rm ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_rmdir.py b/test/t/test_rmdir.py index 74dd7618f36..ff26a65a20d 100644 --- a/test/t/test_rmdir.py +++ b/test/t/test_rmdir.py @@ -5,9 +5,8 @@ class TestRmdir: @pytest.mark.complete("rmdir ") def test_1(self, completion): - assert completion.list + assert completion - @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("rmdir shared/default/") def test_2(self, completion): - assert completion.list == ["bar bar.d/", "foo.d/"] + assert completion == ["bar bar.d/", "foo.d/"] diff --git a/test/t/test_rmlist.py b/test/t/test_rmlist.py index 83ac2bd932b..58db7f7fe2e 100644 --- a/test/t/test_rmlist.py +++ b/test/t/test_rmlist.py @@ -5,4 +5,4 @@ class TestRmlist: @pytest.mark.complete("rmlist -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_rmmod.py b/test/t/test_rmmod.py index 9fabcb1132e..cda9e404fc0 100644 --- a/test/t/test_rmmod.py +++ b/test/t/test_rmmod.py @@ -5,4 +5,4 @@ class TestRmmod: @pytest.mark.complete("rmmod -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_route.py b/test/t/test_route.py index 4513b93250d..a981271ab78 100644 --- a/test/t/test_route.py +++ b/test/t/test_route.py @@ -5,4 +5,4 @@ class TestRoute: @pytest.mark.complete("route ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_rpcdebug.py b/test/t/test_rpcdebug.py index 17e298b56ca..aefed3af4b4 100644 --- a/test/t/test_rpcdebug.py +++ b/test/t/test_rpcdebug.py @@ -5,4 +5,4 @@ class TestRpcdebug: @pytest.mark.complete("rpcdebug -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_rpm.py b/test/t/test_rpm.py index 2b663d7a27c..7d06f4d51e9 100644 --- a/test/t/test_rpm.py +++ b/test/t/test_rpm.py @@ -5,9 +5,9 @@ class TestRpm: @pytest.mark.complete("rpm ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("rpm -q ", skipif='test -z "$(rpm -qa 2>/dev/null)"') def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_rpm2tgz.py b/test/t/test_rpm2tgz.py index da90cf8cb07..3a07cb166ce 100644 --- a/test/t/test_rpm2tgz.py +++ b/test/t/test_rpm2tgz.py @@ -7,7 +7,7 @@ class TestRpm2tgz: @pytest.mark.complete("rpm2tgz -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("rpm2tgz ", cwd="slackware/home") def test_2(self, completion): @@ -18,4 +18,4 @@ def test_2(self, completion): x for x in os.listdir("slackware/home") if os.path.isfile("slackware/home/%s" % x) and x.endswith(".rpm") ]) - assert completion.list == expected + assert completion == expected diff --git a/test/t/test_rpmbuild.py b/test/t/test_rpmbuild.py index 8b55bafaa27..c47286524f9 100644 --- a/test/t/test_rpmbuild.py +++ b/test/t/test_rpmbuild.py @@ -5,4 +5,4 @@ class TestRpmbuild: @pytest.mark.complete("rpmbuild -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_rrdtool.py b/test/t/test_rrdtool.py index 81eccfd87c5..c62400a9781 100644 --- a/test/t/test_rrdtool.py +++ b/test/t/test_rrdtool.py @@ -5,4 +5,4 @@ class TestRrdtool: @pytest.mark.complete("rrdtool ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_rsync.py b/test/t/test_rsync.py index 63320bfbac8..ff7be00d2a9 100644 --- a/test/t/test_rsync.py +++ b/test/t/test_rsync.py @@ -8,12 +8,12 @@ class TestRsync: @pytest.mark.complete("rsync ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("rsync --rsh ") def test_2(self, completion): - assert completion.list == "rsh ssh".split() + assert completion == "rsh ssh".split() @pytest.mark.complete("rsync --rsh=") def test_3(self, completion): - assert completion.list == "rsh ssh".split() + assert completion == "rsh ssh".split() diff --git a/test/t/test_rtcwake.py b/test/t/test_rtcwake.py index baa9f2c2c28..a8dfee8204d 100644 --- a/test/t/test_rtcwake.py +++ b/test/t/test_rtcwake.py @@ -5,4 +5,4 @@ class TestRtcwake: @pytest.mark.complete("rtcwake ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_runuser.py b/test/t/test_runuser.py index ec085122cc4..b873c62ca78 100644 --- a/test/t/test_runuser.py +++ b/test/t/test_runuser.py @@ -5,4 +5,4 @@ class TestRunuser: @pytest.mark.complete("runuser ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_sbcl.py b/test/t/test_sbcl.py index b35f2cd545d..2dbcf823f66 100644 --- a/test/t/test_sbcl.py +++ b/test/t/test_sbcl.py @@ -6,4 +6,4 @@ class TestSbcl: @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("sbcl shared/default/") def test_1(self, completion): - assert completion.list == ["bar", "bar bar.d/", "foo", "foo foo.d/"] + assert completion == ["bar", "bar bar.d/", "foo", "foo foo.d/"] diff --git a/test/t/test_sbcl_mt.py b/test/t/test_sbcl_mt.py index da1b618eed5..01759a38e9a 100644 --- a/test/t/test_sbcl_mt.py +++ b/test/t/test_sbcl_mt.py @@ -6,7 +6,6 @@ ) class TestSbclMt: - @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("sbcl-mt shared/default/") def test_1(self, completion): - assert completion.list == ["bar", "bar bar.d/", "foo", "foo foo.d/"] + assert completion == ["bar", "bar bar.d/", "foo", "foo foo.d/"] diff --git a/test/t/test_sbopkg.py b/test/t/test_sbopkg.py index 57af7fefb30..a1a2e094c60 100644 --- a/test/t/test_sbopkg.py +++ b/test/t/test_sbopkg.py @@ -5,4 +5,4 @@ class TestSbopkg: @pytest.mark.complete("sbopkg -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_screen.py b/test/t/test_screen.py index 168d77a67ad..e1b44621692 100644 --- a/test/t/test_screen.py +++ b/test/t/test_screen.py @@ -5,22 +5,21 @@ class TestScreen: @pytest.mark.complete("screen -") def test_1(self, completion): - assert completion.list + assert completion - @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("screen -c shared/default/") def test_2(self, completion): - assert completion.list == ["bar", "bar bar.d/", "foo", "foo.d/"] + assert completion == ["bar", "bar bar.d/", "foo", "foo.d/"] @pytest.mark.complete("screen cat ") def test_3(self, completion): - assert completion.list + assert completion # Assume at least vt100 and friends are there @pytest.mark.complete("screen -T vt") def test_4(self, completion): - assert completion.list + assert completion @pytest.mark.complete("screen -T foo cat") def test_5(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_scrub.py b/test/t/test_scrub.py index b1dbd393549..a762477725f 100644 --- a/test/t/test_scrub.py +++ b/test/t/test_scrub.py @@ -5,15 +5,15 @@ class TestScrub: @pytest.mark.complete("scrub ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("scrub -") def test_2(self, completion): - assert completion.list + assert completion # Not all scrub versions list available patterns in --help output @pytest.mark.complete("scrub -p ", skipif="! (scrub --help 2>&1 || :) | " "command grep -q ^Available") def test_3(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_sdptool.py b/test/t/test_sdptool.py index 15623702f1c..906cc7e964e 100644 --- a/test/t/test_sdptool.py +++ b/test/t/test_sdptool.py @@ -5,4 +5,4 @@ class TestSdptool: @pytest.mark.complete("sdptool ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_sed.py b/test/t/test_sed.py index f5e71ca645d..6b6c21fa176 100644 --- a/test/t/test_sed.py +++ b/test/t/test_sed.py @@ -6,4 +6,4 @@ class TestSed: @pytest.mark.complete("sed --", skipif="! sed --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_seq.py b/test/t/test_seq.py index 864244f10f4..f27b41dbef7 100644 --- a/test/t/test_seq.py +++ b/test/t/test_seq.py @@ -5,4 +5,4 @@ class TestSeq: @pytest.mark.complete("seq --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_service.py b/test/t/test_service.py index 8adfc19f4fb..afc7c2baef7 100644 --- a/test/t/test_service.py +++ b/test/t/test_service.py @@ -5,4 +5,4 @@ class TestService: @pytest.mark.complete("service ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_set.py b/test/t/test_set.py index 2860e8917c9..751760fcdd2 100644 --- a/test/t/test_set.py +++ b/test/t/test_set.py @@ -5,4 +5,4 @@ class TestSet: @pytest.mark.complete("set no") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_setquota.py b/test/t/test_setquota.py index 93a049411ff..54b35dee0d0 100644 --- a/test/t/test_setquota.py +++ b/test/t/test_setquota.py @@ -5,4 +5,4 @@ class TestSetquota: @pytest.mark.complete("setquota ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_sftp.py b/test/t/test_sftp.py index a8ce23b235a..f5a815c4538 100644 --- a/test/t/test_sftp.py +++ b/test/t/test_sftp.py @@ -5,4 +5,4 @@ class TestSftp: @pytest.mark.complete("sftp -Fsp", cwd="sftp") def test_1(self, completion): - assert completion.list == ["-Fspaced conf"] + assert completion == "-Fspaced conf" diff --git a/test/t/test_sh.py b/test/t/test_sh.py index 0ff1e0ae921..47d809f8d11 100644 --- a/test/t/test_sh.py +++ b/test/t/test_sh.py @@ -5,16 +5,16 @@ class TestSh: @pytest.mark.complete("sh -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("sh +") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("sh -o ") def test_3(self, completion): - assert completion.list + assert completion @pytest.mark.complete("sh -c ") def test_4(self, completion): - assert not completion.list + assert not completion diff --git a/test/t/test_sha1sum.py b/test/t/test_sha1sum.py index c2bbf40aacf..b398476fcb6 100644 --- a/test/t/test_sha1sum.py +++ b/test/t/test_sha1sum.py @@ -5,4 +5,4 @@ class TestSha1sum: @pytest.mark.complete("sha1sum --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_shar.py b/test/t/test_shar.py index 0b019124772..51358affd94 100644 --- a/test/t/test_shar.py +++ b/test/t/test_shar.py @@ -5,4 +5,4 @@ class TestShar: @pytest.mark.complete("shar --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_sitecopy.py b/test/t/test_sitecopy.py index 8d63ecbb5e3..071f73a676b 100644 --- a/test/t/test_sitecopy.py +++ b/test/t/test_sitecopy.py @@ -5,4 +5,4 @@ class TestSitecopy: @pytest.mark.complete("sitecopy --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_slackpkg.py b/test/t/test_slackpkg.py index 1ad4b8fdfa4..e99116ed18d 100644 --- a/test/t/test_slackpkg.py +++ b/test/t/test_slackpkg.py @@ -5,4 +5,4 @@ class TestSlackpkg: @pytest.mark.complete("slackpkg -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_slapt_get.py b/test/t/test_slapt_get.py index d49373767e2..8790b665af5 100644 --- a/test/t/test_slapt_get.py +++ b/test/t/test_slapt_get.py @@ -8,12 +8,12 @@ class TestSlaptGet: @pytest.mark.complete("slapt-get -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("slapt-get --up") def test_2(self, completion): - assert completion.list == "--update --upgrade".split() + assert completion == "--update --upgrade".split() @pytest.mark.complete("slapt-get -c non-existent-file --install ") def test_3(self, completion): - assert not completion.list + assert not completion diff --git a/test/t/test_slapt_src.py b/test/t/test_slapt_src.py index 4d4a72aade2..7edbd11ba99 100644 --- a/test/t/test_slapt_src.py +++ b/test/t/test_slapt_src.py @@ -8,12 +8,12 @@ class TestSlaptSrc: @pytest.mark.complete("slapt-src -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("slapt-src --bu") def test_2(self, completion): - assert completion.list == ["--build"] + assert completion == "--build" @pytest.mark.complete("slapt-src --ins") def test_3(self, completion): - assert completion.list == ["--install"] + assert completion == "--install" diff --git a/test/t/test_smartctl.py b/test/t/test_smartctl.py index a09f0520b1c..afa8c6e2ae3 100644 --- a/test/t/test_smartctl.py +++ b/test/t/test_smartctl.py @@ -5,4 +5,4 @@ class TestSmartctl: @pytest.mark.complete("smartctl --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_smbcacls.py b/test/t/test_smbcacls.py index 5d93d23451d..41863c134d2 100644 --- a/test/t/test_smbcacls.py +++ b/test/t/test_smbcacls.py @@ -5,4 +5,4 @@ class TestSmbcacls: @pytest.mark.complete("smbcacls -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_smbclient.py b/test/t/test_smbclient.py index e9437804aad..ccca25ec5ec 100644 --- a/test/t/test_smbclient.py +++ b/test/t/test_smbclient.py @@ -5,4 +5,4 @@ class TestSmbclient: @pytest.mark.complete("smbclient -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_smbcquotas.py b/test/t/test_smbcquotas.py index e957506f164..c540c438b0d 100644 --- a/test/t/test_smbcquotas.py +++ b/test/t/test_smbcquotas.py @@ -5,4 +5,4 @@ class TestSmbcquotas: @pytest.mark.complete("smbcquotas -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_smbget.py b/test/t/test_smbget.py index 92e9c68a2ac..7a5b89a9800 100644 --- a/test/t/test_smbget.py +++ b/test/t/test_smbget.py @@ -5,4 +5,4 @@ class TestSmbget: @pytest.mark.complete("smbget -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_smbpasswd.py b/test/t/test_smbpasswd.py index 8b23dbe803f..e205133acb4 100644 --- a/test/t/test_smbpasswd.py +++ b/test/t/test_smbpasswd.py @@ -5,4 +5,4 @@ class TestSmbpasswd: @pytest.mark.complete("smbpasswd -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_smbtar.py b/test/t/test_smbtar.py index 246c2f73601..f9278af7917 100644 --- a/test/t/test_smbtar.py +++ b/test/t/test_smbtar.py @@ -5,4 +5,4 @@ class TestSmbtar: @pytest.mark.complete("smbtar -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_smbtree.py b/test/t/test_smbtree.py index b6c8c6f1d68..959ded84ee5 100644 --- a/test/t/test_smbtree.py +++ b/test/t/test_smbtree.py @@ -5,4 +5,4 @@ class TestSmbtree: @pytest.mark.complete("smbtree -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_snownews.py b/test/t/test_snownews.py index d0e1b5b41b3..df78d403fdf 100644 --- a/test/t/test_snownews.py +++ b/test/t/test_snownews.py @@ -5,4 +5,4 @@ class TestSnownews: @pytest.mark.complete("snownews --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_sort.py b/test/t/test_sort.py index 4057e19f0b5..818178814f3 100644 --- a/test/t/test_sort.py +++ b/test/t/test_sort.py @@ -5,4 +5,4 @@ class TestSort: @pytest.mark.complete("sort --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_split.py b/test/t/test_split.py index 9de088f0503..d625b3a506d 100644 --- a/test/t/test_split.py +++ b/test/t/test_split.py @@ -6,4 +6,4 @@ class TestSplit: @pytest.mark.complete("split --", skipif="! split --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_spovray.py b/test/t/test_spovray.py index 2c22937ccb6..b39b0e30e3f 100644 --- a/test/t/test_spovray.py +++ b/test/t/test_spovray.py @@ -5,4 +5,4 @@ class TestSpovray: @pytest.mark.complete("spovray ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_sqlite3.py b/test/t/test_sqlite3.py index 4dff5ae3b52..8d3e264d612 100644 --- a/test/t/test_sqlite3.py +++ b/test/t/test_sqlite3.py @@ -5,12 +5,12 @@ class TestSqlite3: @pytest.mark.complete("sqlite3 ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("sqlite3 -") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("sqlite3 -scratch foo ") def test_3(self, completion): - assert not completion.list + assert not completion diff --git a/test/t/test_ss.py b/test/t/test_ss.py index 4f81662197c..5fa6f2c752c 100644 --- a/test/t/test_ss.py +++ b/test/t/test_ss.py @@ -5,12 +5,12 @@ class TestSs: @pytest.mark.complete("ss -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("ss -A ") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("ss -A foo,") def test_3(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ssh.py b/test/t/test_ssh.py index f7e2e12b2f1..472d6d1e072 100644 --- a/test/t/test_ssh.py +++ b/test/t/test_ssh.py @@ -5,4 +5,4 @@ class TestSsh: @pytest.mark.complete("ssh -Fsp", cwd="ssh") def test_1(self, completion): - assert completion.list == ["-Fspaced conf"] + assert completion == "-Fspaced conf" diff --git a/test/t/test_ssh_add.py b/test/t/test_ssh_add.py index 23cb6765b26..a84ffd7320f 100644 --- a/test/t/test_ssh_add.py +++ b/test/t/test_ssh_add.py @@ -8,4 +8,4 @@ class TestSshAdd: @pytest.mark.complete("ssh-add ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ssh_copy_id.py b/test/t/test_ssh_copy_id.py index 08e356b91d1..ae488e84425 100644 --- a/test/t/test_ssh_copy_id.py +++ b/test/t/test_ssh_copy_id.py @@ -14,4 +14,4 @@ class TestSshCopyId: @pytest.mark.complete("ssh-copy-id -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ssh_keygen.py b/test/t/test_ssh_keygen.py index e8caf05c943..63e46dc4f29 100644 --- a/test/t/test_ssh_keygen.py +++ b/test/t/test_ssh_keygen.py @@ -8,4 +8,4 @@ class TestSshKeygen: @pytest.mark.complete("ssh-keygen -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_sshfs.py b/test/t/test_sshfs.py index 57984d9af39..1805ef59b86 100644 --- a/test/t/test_sshfs.py +++ b/test/t/test_sshfs.py @@ -8,4 +8,4 @@ class TestSshfs: @pytest.mark.complete("sshfs ./") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_sshmitm.py b/test/t/test_sshmitm.py index 084a1ac81c4..208de77269b 100644 --- a/test/t/test_sshmitm.py +++ b/test/t/test_sshmitm.py @@ -5,4 +5,4 @@ class TestSshmitm: @pytest.mark.complete("sshmitm -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_sshow.py b/test/t/test_sshow.py index d4c01c30194..0519e2f4f0e 100644 --- a/test/t/test_sshow.py +++ b/test/t/test_sshow.py @@ -5,4 +5,4 @@ class TestSshow: @pytest.mark.complete("sshow -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_strace.py b/test/t/test_strace.py index 073a69c57f1..059b9018a22 100644 --- a/test/t/test_strace.py +++ b/test/t/test_strace.py @@ -5,4 +5,4 @@ class TestStrace: @pytest.mark.complete("strace -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_stream.py b/test/t/test_stream.py index fc99d8dff36..879ee700e09 100644 --- a/test/t/test_stream.py +++ b/test/t/test_stream.py @@ -5,4 +5,4 @@ class TestStream: @pytest.mark.complete("stream ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_strings.py b/test/t/test_strings.py index c5cfce16c5b..e905f92db4a 100644 --- a/test/t/test_strings.py +++ b/test/t/test_strings.py @@ -5,4 +5,4 @@ class TestStrings: @pytest.mark.complete("strings ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_strip.py b/test/t/test_strip.py index 04c13fc9ea7..ce3cd846851 100644 --- a/test/t/test_strip.py +++ b/test/t/test_strip.py @@ -5,4 +5,4 @@ class TestStrip: @pytest.mark.complete("strip --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_su.py b/test/t/test_su.py index e4558b6c68c..373dcd51442 100644 --- a/test/t/test_su.py +++ b/test/t/test_su.py @@ -5,4 +5,4 @@ class TestSu: @pytest.mark.complete("su ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_sudo.py b/test/t/test_sudo.py index cfd63f66014..001b23e1d63 100644 --- a/test/t/test_sudo.py +++ b/test/t/test_sudo.py @@ -7,46 +7,46 @@ class TestSudo: @pytest.mark.complete("sudo -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("sudo cd fo", cwd="shared/default") def test_2(self, completion): - assert completion.list == ["foo.d/"] - assert not completion.output.endswith(" ") + assert completion == "foo.d/" + assert not completion.endswith(" ") @pytest.mark.complete("sudo sh share") def test_3(self, completion): - assert completion.list == ["shared/"] - assert not completion.output.endswith(" ") + assert completion == "shared/" + assert not completion.endswith(" ") @pytest.mark.complete("sudo mount /dev/sda1 def", cwd="shared") def test_4(self, completion): - assert completion.list == ["default/"] - assert not completion.output.endswith(" ") + assert completion == "default/" + assert not completion.endswith(" ") @pytest.mark.complete("sudo -e -u root bar foo", cwd="shared/default") def test_5(self, completion): - assert completion.list == ["foo", "foo.d/"] + assert completion == ["foo", "foo.d/"] def test_6(self, bash, part_full_user): part, full = part_full_user completion = assert_complete(bash, "sudo chown %s" % part) - assert completion.list == [full] - assert completion.output.endswith(" ") + assert completion == full + assert completion.endswith(" ") def test_7(self, bash, part_full_user, part_full_group): _, user = part_full_user partgroup, fullgroup = part_full_group completion = assert_complete( bash, "sudo chown %s:%s" % (user, partgroup)) - assert completion.list == ["%s:%s" % (user, fullgroup)] - assert completion.output.endswith(" ") + assert completion == "%s:%s" % (user, fullgroup) + assert completion.endswith(" ") def test_8(self, bash, part_full_group): part, full = part_full_group completion = assert_complete(bash, "sudo chown dot.user:%s" % part) - assert completion.list == ["dot.user:%s" % full] - assert completion.output.endswith(" ") + assert completion == "dot.user:%s" % full + assert completion.endswith(" ") @pytest.mark.xfail # TODO check escaping, whitespace def test_9(self, bash, part_full_group): @@ -57,8 +57,8 @@ def test_9(self, bash, part_full_group): r"foo\_b\ a\.r\ :"): completion = assert_complete( bash, "sudo chown %s%s" % (prefix, part)) - assert completion.list == ["%s%s" % (prefix, full)] - assert completion.output.endswith(" ") + assert completion == "%s%s" % (prefix, full) + assert completion.endswith(" ") def test_10(self, bash, part_full_user, part_full_group): """Test giving up on degenerate cases instead of spewing junk.""" @@ -67,10 +67,10 @@ def test_10(self, bash, part_full_user, part_full_group): for x in range(2, 5): completion = assert_complete( bash, "sudo chown %s%s:%s" % (user, x * "\\", partgroup)) - assert not completion.list + assert not completion def test_11(self, bash, part_full_group): """Test graceful fail on colon in user/group name.""" part, _ = part_full_group completion = assert_complete(bash, "sudo chown foo:bar:%s" % part) - assert not completion.list + assert not completion diff --git a/test/t/test_svcadm.py b/test/t/test_svcadm.py index e652a28291a..5851595ff77 100644 --- a/test/t/test_svcadm.py +++ b/test/t/test_svcadm.py @@ -5,4 +5,4 @@ class TestSvcadm: @pytest.mark.complete("svcadm ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_svk.py b/test/t/test_svk.py index 5ff0ab3585c..f7f824913b6 100644 --- a/test/t/test_svk.py +++ b/test/t/test_svk.py @@ -5,4 +5,4 @@ class TestSvk: @pytest.mark.complete("svk ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_svn.py b/test/t/test_svn.py index 22536ac5067..5f83530fd67 100644 --- a/test/t/test_svn.py +++ b/test/t/test_svn.py @@ -5,4 +5,4 @@ class TestSvn: @pytest.mark.complete("svn ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_svnadmin.py b/test/t/test_svnadmin.py index 65a3abf6b22..53438b83ae9 100644 --- a/test/t/test_svnadmin.py +++ b/test/t/test_svnadmin.py @@ -5,4 +5,4 @@ class TestSvnadmin: @pytest.mark.complete("svnadmin ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_svnlook.py b/test/t/test_svnlook.py index 7053066d0a4..932b5d0e62d 100644 --- a/test/t/test_svnlook.py +++ b/test/t/test_svnlook.py @@ -5,4 +5,4 @@ class TestSvnlook: @pytest.mark.complete("svnlook ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_sync_members.py b/test/t/test_sync_members.py index 4aebbbf48b9..4bf96ebb9e5 100644 --- a/test/t/test_sync_members.py +++ b/test/t/test_sync_members.py @@ -5,4 +5,4 @@ class TestSyncMembers: @pytest.mark.complete("sync_members --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_synclient.py b/test/t/test_synclient.py index 9850acf4704..23138294be1 100644 --- a/test/t/test_synclient.py +++ b/test/t/test_synclient.py @@ -7,8 +7,8 @@ class TestSynclient: # "Couldn't find synaptics properties. No synaptics driver loaded?" @pytest.mark.complete("synclient ", skipif="! synclient -l &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("synclient -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_sysbench.py b/test/t/test_sysbench.py index c76474c63ff..a1af17e3da7 100644 --- a/test/t/test_sysbench.py +++ b/test/t/test_sysbench.py @@ -5,4 +5,4 @@ class TestSysbench: @pytest.mark.complete("sysbench ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_sysctl.py b/test/t/test_sysctl.py index 07d896ca677..66be6b58c1e 100644 --- a/test/t/test_sysctl.py +++ b/test/t/test_sysctl.py @@ -5,10 +5,10 @@ class TestSysctl: @pytest.mark.complete("sysctl -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("sysctl kern", skipif="! sysctl -N -a 2>/dev/null | " "command grep -q ^kern") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_tac.py b/test/t/test_tac.py index f7bb23a6fbc..86072f6059b 100644 --- a/test/t/test_tac.py +++ b/test/t/test_tac.py @@ -5,4 +5,4 @@ class TestTac: @pytest.mark.complete("tac --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_tail.py b/test/t/test_tail.py index e323b70607e..cd03e9d3705 100644 --- a/test/t/test_tail.py +++ b/test/t/test_tail.py @@ -6,4 +6,4 @@ class TestTail: @pytest.mark.complete("tail --", skipif="! tail --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_tar.py b/test/t/test_tar.py index 6f8f81bdf44..9c5d2e474ac 100644 --- a/test/t/test_tar.py +++ b/test/t/test_tar.py @@ -16,92 +16,92 @@ def gnu_tar(self, bash): @pytest.mark.complete("tar ") def test_1(self, completion): - assert completion.list + assert completion # Test "f" when mode is not as first option @pytest.mark.complete("tar zfc ", cwd="tar") def test_2(self, completion): - assert completion.list == "dir/ dir2/".split() + assert completion == "dir/ dir2/".split() @pytest.mark.complete("tar cf ", cwd="tar") def test_3(self, completion): - assert completion.list == "dir/ dir2/".split() + assert completion == "dir/ dir2/".split() @pytest.mark.complete("tar tf archive.tar.xz dir/file", cwd="tar") def test_4(self, completion): - assert completion.list == "dir/fileA dir/fileB dir/fileC".split() + assert completion == "dir/fileA dir/fileB dir/fileC".split() @pytest.mark.complete("tar cTfvv NOT_EXISTS DONT_CREATE.tar ", cwd="tar") def test_5(self, completion): - assert completion.list == \ + assert completion == \ "archive.tar.xz dir/ dir2/ escape.tar".split() @pytest.mark.complete("tar xvf ", cwd="tar") def test_6(self, completion): - assert completion.list == \ + assert completion == \ "archive.tar.xz dir/ dir2/ escape.tar".split() @pytest.mark.complete("tar -c") def test_7(self, completion, gnu_tar): """Test short options.""" - assert completion.list + assert completion @pytest.mark.complete("tar -zcf ", cwd="tar") def test_8(self, completion, gnu_tar): """Test mode not as first option.""" - assert completion.list == "dir/ dir2/".split() + assert completion == "dir/ dir2/".split() @pytest.mark.complete("tar -cf ", cwd="tar") def test_9(self, completion, gnu_tar): """Test that we don't suggest rewriting existing archive.""" - assert completion.list == "dir/ dir2/".split() + assert completion == "dir/ dir2/".split() @pytest.mark.complete("tar -c --file ", cwd="tar") def test_10(self, completion, gnu_tar): - assert completion.list == "dir/ dir2/".split() + assert completion == "dir/ dir2/".split() @pytest.mark.complete("tar -cvv --file ", cwd="tar") def test_11(self, completion, gnu_tar): - assert completion.list == "dir/ dir2/".split() + assert completion == "dir/ dir2/".split() @pytest.mark.complete("tar -tf archive.tar.xz dir/file", cwd="tar") def test_12(self, completion, gnu_tar): """Test archive listing.""" - assert completion.list == "dir/fileA dir/fileB dir/fileC".split() + assert completion == "dir/fileA dir/fileB dir/fileC".split() @pytest.mark.complete("tar -t --file archive.tar.xz dir/file", cwd="tar") def test_13(self, completion, gnu_tar): """Test archive listing with --file.""" - assert completion.list == "dir/fileA dir/fileB dir/fileC".split() + assert completion == "dir/fileA dir/fileB dir/fileC".split() @pytest.mark.complete("tar --block") def test_14(self, completion, gnu_tar): - assert completion.list == "--block-number --blocking-factor=".split() + assert completion == "--block-number --blocking-factor=".split() @pytest.mark.complete("tar --add-fil") def test_15(self, completion, gnu_tar): - assert completion.list == ["--add-file="] - assert not completion.output.endswith(" ") + assert completion == "--add-file=" + assert not completion.endswith(" ") @pytest.mark.complete("tar -cf /dev/null --posi") def test_16(self, completion, gnu_tar): - assert completion.list == ["--posix"] - assert completion.output.endswith(" ") + assert completion == "--posix" + assert completion.endswith(" ") @pytest.mark.complete("tar --owner=") def test_17(self, bash, completion, gnu_tar): users = sorted(assert_bash_exec( bash, "compgen -A user", want_output=True).split()) - assert completion.list == users + assert completion == users @pytest.mark.complete("tar --group=") def test_18(self, bash, completion, gnu_tar): groups = sorted(assert_bash_exec( bash, "compgen -A group", want_output=True).split()) - assert completion.list == groups + assert completion == groups # Use -b for this as -b is still not handled by tar's completion @pytest.mark.complete("tar -cvvfb ") def test_19(self, bash, completion, gnu_tar): """Test short option -XXXb (arg required).""" - assert not completion.list + assert not completion diff --git a/test/t/test_tcpdump.py b/test/t/test_tcpdump.py index 1767485395d..8178df38414 100644 --- a/test/t/test_tcpdump.py +++ b/test/t/test_tcpdump.py @@ -5,4 +5,4 @@ class TestTcpdump: @pytest.mark.complete("tcpdump -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_tcpkill.py b/test/t/test_tcpkill.py index 98a96675d2a..ea1b58c56be 100644 --- a/test/t/test_tcpkill.py +++ b/test/t/test_tcpkill.py @@ -5,4 +5,4 @@ class TestTcpkill: @pytest.mark.complete("tcpkill -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_tcpnice.py b/test/t/test_tcpnice.py index af94c40c685..5e167d2e675 100644 --- a/test/t/test_tcpnice.py +++ b/test/t/test_tcpnice.py @@ -5,4 +5,4 @@ class TestTcpnice: @pytest.mark.complete("tcpnice -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_tee.py b/test/t/test_tee.py index 130d069fe16..69f70ff7d1c 100644 --- a/test/t/test_tee.py +++ b/test/t/test_tee.py @@ -5,4 +5,4 @@ class TestTee: @pytest.mark.complete("tee ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_texindex.py b/test/t/test_texindex.py index 681c2b819d5..671e0f32cb7 100644 --- a/test/t/test_texindex.py +++ b/test/t/test_texindex.py @@ -5,4 +5,4 @@ class TestTexindex: @pytest.mark.complete("texindex --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_tightvncviewer.py b/test/t/test_tightvncviewer.py index 4ef169754f9..a9504bddf02 100644 --- a/test/t/test_tightvncviewer.py +++ b/test/t/test_tightvncviewer.py @@ -5,4 +5,4 @@ class TestTightvncviewer: @pytest.mark.complete("tightvncviewer ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_time.py b/test/t/test_time.py index 84764b479d8..6ca8ab2b9b4 100644 --- a/test/t/test_time.py +++ b/test/t/test_time.py @@ -7,11 +7,11 @@ class TestTime: @pytest.mark.complete("time set") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("time -p find -typ") def test_2(self, completion): - assert completion.list # find's options + assert completion # find's options @pytest.mark.complete("time shared/bin/") def test_3(self, completion): @@ -19,4 +19,4 @@ def test_3(self, completion): x for x in os.listdir("shared/bin") if os.path.isfile("shared/bin/%s" % x) and os.access("shared/bin/%s" % x, os.X_OK)) - assert completion.list == execs + assert completion == execs diff --git a/test/t/test_timeout.py b/test/t/test_timeout.py index 778a625bfc7..0159d1276fa 100644 --- a/test/t/test_timeout.py +++ b/test/t/test_timeout.py @@ -5,8 +5,8 @@ class TestTimeout: @pytest.mark.complete("timeout ") def test_1(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("timeout -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_tipc.py b/test/t/test_tipc.py index 4e2878f2544..d975665f521 100644 --- a/test/t/test_tipc.py +++ b/test/t/test_tipc.py @@ -5,4 +5,4 @@ class TestTipc: @pytest.mark.complete("tipc ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_touch.py b/test/t/test_touch.py index e98971887ed..b96d6e1adc2 100644 --- a/test/t/test_touch.py +++ b/test/t/test_touch.py @@ -6,4 +6,4 @@ class TestTouch: @pytest.mark.complete("touch --", skipif="! touch --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_tox.py b/test/t/test_tox.py index 3f17623e4a6..231304cf42b 100644 --- a/test/t/test_tox.py +++ b/test/t/test_tox.py @@ -5,12 +5,12 @@ class TestTox: @pytest.mark.complete("tox -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("tox -e ") def test_2(self, completion): - assert completion.list == ["ALL"] + assert completion == "ALL" @pytest.mark.complete("tox -e foo,") def test_3(self, completion): - assert completion.list == ["foo,ALL"] + assert completion == "foo,ALL" diff --git a/test/t/test_tr.py b/test/t/test_tr.py index 221c80267b7..86fe2b887b8 100644 --- a/test/t/test_tr.py +++ b/test/t/test_tr.py @@ -6,4 +6,4 @@ class TestTr: @pytest.mark.complete("tr --", skipif="! tr --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_tracepath.py b/test/t/test_tracepath.py index 8cf59a048d2..f83127845d3 100644 --- a/test/t/test_tracepath.py +++ b/test/t/test_tracepath.py @@ -5,8 +5,8 @@ class TestTracepath: @pytest.mark.complete("tracepath ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("tracepath -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_tshark.py b/test/t/test_tshark.py index 61da7f964df..9d3ab8bc90c 100644 --- a/test/t/test_tshark.py +++ b/test/t/test_tshark.py @@ -6,20 +6,20 @@ class TestTshark: @pytest.mark.complete("tshark -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("tshark -G ") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("tshark -O foo,htt") def test_3(self, completion): - assert completion.list + assert completion @pytest.mark.complete("tshark -o tcp") def test_4(self, completion): - assert "tcp.desegment_tcp_streams:" in completion.list + assert "tcp.desegment_tcp_streams:" in completion @pytest.mark.complete("tshark -otcp") def test_5(self, completion): - assert "-otcp.desegment_tcp_streams:" in completion.list + assert "-otcp.desegment_tcp_streams:" in completion diff --git a/test/t/test_tune2fs.py b/test/t/test_tune2fs.py index 502504ecaf4..6a0b578e80c 100644 --- a/test/t/test_tune2fs.py +++ b/test/t/test_tune2fs.py @@ -5,4 +5,4 @@ class TestTune2fs: @pytest.mark.complete("tune2fs ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_udevadm.py b/test/t/test_udevadm.py index a27b1a1029e..b89a5277184 100644 --- a/test/t/test_udevadm.py +++ b/test/t/test_udevadm.py @@ -5,4 +5,4 @@ class TestUdevadm: @pytest.mark.complete("udevadm ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_umount.py b/test/t/test_umount.py index 3c6521e3477..709d20bcfb9 100644 --- a/test/t/test_umount.py +++ b/test/t/test_umount.py @@ -5,4 +5,4 @@ class TestUmount: @pytest.mark.complete("umount ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_unace.py b/test/t/test_unace.py index 5ad911f0b16..481a1405d63 100644 --- a/test/t/test_unace.py +++ b/test/t/test_unace.py @@ -5,4 +5,4 @@ class TestUnace: @pytest.mark.complete("unace -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_uname.py b/test/t/test_uname.py index b8e6dd2b706..25f08090670 100644 --- a/test/t/test_uname.py +++ b/test/t/test_uname.py @@ -6,4 +6,4 @@ class TestUname: @pytest.mark.complete("uname --", skipif="! uname --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_unexpand.py b/test/t/test_unexpand.py index 12e0cc0f95d..034d9a4e4bc 100644 --- a/test/t/test_unexpand.py +++ b/test/t/test_unexpand.py @@ -6,4 +6,4 @@ class TestUnexpand: @pytest.mark.complete("unexpand --", skipif="! unexpand --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_uniq.py b/test/t/test_uniq.py index 580c81c7e53..853aa70f7ee 100644 --- a/test/t/test_uniq.py +++ b/test/t/test_uniq.py @@ -6,4 +6,4 @@ class TestUniq: @pytest.mark.complete("uniq --", skipif="! uniq --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_units.py b/test/t/test_units.py index 04f54b7ed81..22d4136f294 100644 --- a/test/t/test_units.py +++ b/test/t/test_units.py @@ -6,4 +6,4 @@ class TestUnits: @pytest.mark.complete("units --", skipif="! units --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_unpack200.py b/test/t/test_unpack200.py index 52410b695f9..6014b3eab8d 100644 --- a/test/t/test_unpack200.py +++ b/test/t/test_unpack200.py @@ -5,4 +5,4 @@ class TestUnpack200: @pytest.mark.complete("unpack200 ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_unrar.py b/test/t/test_unrar.py index 4d667e7dcbe..76b382de79c 100644 --- a/test/t/test_unrar.py +++ b/test/t/test_unrar.py @@ -5,4 +5,4 @@ class TestUnrar: @pytest.mark.complete("unrar -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_unset.py b/test/t/test_unset.py index be0d331d52d..69710e0f5e3 100644 --- a/test/t/test_unset.py +++ b/test/t/test_unset.py @@ -5,4 +5,4 @@ class TestUnset: @pytest.mark.complete("unset BASH_ARG") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_unshunt.py b/test/t/test_unshunt.py index 2311de26813..615fb9e9451 100644 --- a/test/t/test_unshunt.py +++ b/test/t/test_unshunt.py @@ -5,4 +5,4 @@ class TestUnshunt: @pytest.mark.complete("unshunt --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_update_alternatives.py b/test/t/test_update_alternatives.py index fba83f649d9..21d5a73971d 100644 --- a/test/t/test_update_alternatives.py +++ b/test/t/test_update_alternatives.py @@ -8,4 +8,4 @@ class TestUpdateAlternatives: @pytest.mark.complete("update-alternatives --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_update_rc_d.py b/test/t/test_update_rc_d.py index 82bd3e0ca0a..f166ee5803e 100644 --- a/test/t/test_update_rc_d.py +++ b/test/t/test_update_rc_d.py @@ -8,4 +8,4 @@ class TestUpdateRcD: @pytest.mark.complete("update-rc.d -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_upgradepkg.py b/test/t/test_upgradepkg.py index ed28c31a075..439c6383c82 100644 --- a/test/t/test_upgradepkg.py +++ b/test/t/test_upgradepkg.py @@ -8,11 +8,11 @@ class TestUpgradepkg: @pytest.mark.complete("upgradepkg -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("upgradepkg --") def test_2(self, completion): - assert completion.list == "--dry-run --install-new --reinstall " \ + assert completion == "--dry-run --install-new --reinstall " \ "--verbose".split() @pytest.mark.complete("upgradepkg ", cwd="slackware/home") @@ -24,4 +24,4 @@ def test_4(self, completion): x for x in os.listdir("slackware/home") if os.path.isfile("./%s" % x) and fnmatch.fnmatch(x, "*.t[bglx]z") ]) - assert completion.list == expected + assert completion == expected diff --git a/test/t/test_urlsnarf.py b/test/t/test_urlsnarf.py index 6375c3cdc65..e6b528ffa79 100644 --- a/test/t/test_urlsnarf.py +++ b/test/t/test_urlsnarf.py @@ -5,4 +5,4 @@ class TestUrlsnarf: @pytest.mark.complete("urlsnarf -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_uscan.py b/test/t/test_uscan.py index 93a1d25f379..b328a55056c 100644 --- a/test/t/test_uscan.py +++ b/test/t/test_uscan.py @@ -5,4 +5,4 @@ class TestUscan: @pytest.mark.complete("uscan -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_useradd.py b/test/t/test_useradd.py index 067e1f5b121..46b80c9b412 100644 --- a/test/t/test_useradd.py +++ b/test/t/test_useradd.py @@ -5,8 +5,8 @@ class TestUseradd: @pytest.mark.complete("useradd ") def test_1(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("useradd -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_userdel.py b/test/t/test_userdel.py index 010619a2fb9..776601bc0a5 100644 --- a/test/t/test_userdel.py +++ b/test/t/test_userdel.py @@ -5,8 +5,8 @@ class TestUserdel: @pytest.mark.complete("userdel -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("userdel root") def test_2(self, completion): - assert "root" in completion.list + assert "root" in completion diff --git a/test/t/test_usermod.py b/test/t/test_usermod.py index 632b72806d5..1cc4d6d1b5e 100644 --- a/test/t/test_usermod.py +++ b/test/t/test_usermod.py @@ -5,8 +5,8 @@ class TestUsermod: @pytest.mark.complete("usermod ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("usermod -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_valgrind.py b/test/t/test_valgrind.py index 3a39e3cd91f..06bbf7e1358 100644 --- a/test/t/test_valgrind.py +++ b/test/t/test_valgrind.py @@ -8,20 +8,20 @@ class TestValgrind: # b: Assume we have at least bash that starts with b in PATH @pytest.mark.complete("valgrind b") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("valgrind -") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("valgrind --tool=memche") def test_3(self, completion): - assert "--tool=memcheck" in completion.list + assert "--tool=memcheck" in completion @pytest.mark.complete("valgrind --tool=helgrind --history-l") def test_4(self, completion): - assert "--history-level=" in completion.list - assert not completion.output.endswith(" ") + assert "--history-level=" in completion + assert not completion.endswith(" ") @pytest.mark.complete(r"valgrind --log-file=v\ 0.log ./bin/", cwd="shared") def test_5(self, completion): @@ -32,4 +32,4 @@ def test_5(self, completion): x for x in os.listdir("shared/bin") if os.path.isfile("shared/bin/%s" % x) ]) - assert completion.list == expected + assert completion == expected diff --git a/test/t/test_vdir.py b/test/t/test_vdir.py index e40d242c3e2..75a7d53956a 100644 --- a/test/t/test_vdir.py +++ b/test/t/test_vdir.py @@ -5,4 +5,4 @@ class TestVdir: @pytest.mark.complete("vdir ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vgcfgbackup.py b/test/t/test_vgcfgbackup.py index dc633bfe046..6cab73bc3e9 100644 --- a/test/t/test_vgcfgbackup.py +++ b/test/t/test_vgcfgbackup.py @@ -6,4 +6,4 @@ class TestVgcfgbackup: @pytest.mark.complete("vgcfgbackup -", skipif="! vgcfgbackup --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vgcfgrestore.py b/test/t/test_vgcfgrestore.py index 2d148f522d2..e27f00cf139 100644 --- a/test/t/test_vgcfgrestore.py +++ b/test/t/test_vgcfgrestore.py @@ -6,4 +6,4 @@ class TestVgcfgrestore: @pytest.mark.complete("vgcfgrestore -", skipif="! vgcfgrestore --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vgchange.py b/test/t/test_vgchange.py index 1330d81ed25..4c8ff29c382 100644 --- a/test/t/test_vgchange.py +++ b/test/t/test_vgchange.py @@ -5,4 +5,4 @@ class TestVgchange: @pytest.mark.complete("vgchange -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vgck.py b/test/t/test_vgck.py index 686e05fd234..9f85b70aa50 100644 --- a/test/t/test_vgck.py +++ b/test/t/test_vgck.py @@ -6,4 +6,4 @@ class TestVgck: @pytest.mark.complete("vgck -", skipif="! vgck --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vgconvert.py b/test/t/test_vgconvert.py index e5e53d23b1c..a56a6263764 100644 --- a/test/t/test_vgconvert.py +++ b/test/t/test_vgconvert.py @@ -6,4 +6,4 @@ class TestVgconvert: @pytest.mark.complete("vgconvert -", skipif="! vgconvert --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vgcreate.py b/test/t/test_vgcreate.py index b79de7538a1..c17468e6b8f 100644 --- a/test/t/test_vgcreate.py +++ b/test/t/test_vgcreate.py @@ -5,8 +5,8 @@ class TestVgcreate: @pytest.mark.complete("vgcreate -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("vgcreate __does_not_exist__") def test_2(self, completion): - assert not completion.list + assert not completion diff --git a/test/t/test_vgdisplay.py b/test/t/test_vgdisplay.py index 0aaf467bfbe..404387682fe 100644 --- a/test/t/test_vgdisplay.py +++ b/test/t/test_vgdisplay.py @@ -6,4 +6,4 @@ class TestVgdisplay: @pytest.mark.complete("vgdisplay -", skipif="! vgdisplay --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vgexport.py b/test/t/test_vgexport.py index 70fd5e742ca..eae3ef2aa22 100644 --- a/test/t/test_vgexport.py +++ b/test/t/test_vgexport.py @@ -6,4 +6,4 @@ class TestVgexport: @pytest.mark.complete("vgexport -", skipif="! vgexport --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vgextend.py b/test/t/test_vgextend.py index a9906d07ae4..d28d069592e 100644 --- a/test/t/test_vgextend.py +++ b/test/t/test_vgextend.py @@ -6,4 +6,4 @@ class TestVgextend: @pytest.mark.complete("vgextend -", skipif="! vgextend --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vgimport.py b/test/t/test_vgimport.py index 85d593383d5..5d3d9bc04b4 100644 --- a/test/t/test_vgimport.py +++ b/test/t/test_vgimport.py @@ -6,4 +6,4 @@ class TestVgimport: @pytest.mark.complete("vgimport -", skipif="! vgimport --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vgmerge.py b/test/t/test_vgmerge.py index 2456c9f18fd..a9a5f1aab94 100644 --- a/test/t/test_vgmerge.py +++ b/test/t/test_vgmerge.py @@ -6,4 +6,4 @@ class TestVgmerge: @pytest.mark.complete("vgmerge -", skipif="! vgmerge --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vgmknodes.py b/test/t/test_vgmknodes.py index 3afb8e05a51..d5b74bc9d2c 100644 --- a/test/t/test_vgmknodes.py +++ b/test/t/test_vgmknodes.py @@ -6,4 +6,4 @@ class TestVgmknodes: @pytest.mark.complete("vgmknodes -", skipif="! vgmknodes --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vgreduce.py b/test/t/test_vgreduce.py index f6d00e10dd8..b9e81bb8f2b 100644 --- a/test/t/test_vgreduce.py +++ b/test/t/test_vgreduce.py @@ -6,4 +6,4 @@ class TestVgreduce: @pytest.mark.complete("vgreduce -", skipif="! vgreduce --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vgremove.py b/test/t/test_vgremove.py index 31ca095addc..afa4baa4b30 100644 --- a/test/t/test_vgremove.py +++ b/test/t/test_vgremove.py @@ -6,4 +6,4 @@ class TestVgremove: @pytest.mark.complete("vgremove -", skipif="! vgremove --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vgrename.py b/test/t/test_vgrename.py index 7434a575fad..a335c479b12 100644 --- a/test/t/test_vgrename.py +++ b/test/t/test_vgrename.py @@ -6,4 +6,4 @@ class TestVgrename: @pytest.mark.complete("vgrename -", skipif="! vgrename --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vgs.py b/test/t/test_vgs.py index 34d9379a205..c8fe2a82bde 100644 --- a/test/t/test_vgs.py +++ b/test/t/test_vgs.py @@ -6,4 +6,4 @@ class TestVgs: @pytest.mark.complete("vgs -", skipif="! vgs --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vgscan.py b/test/t/test_vgscan.py index c9425d0e4fa..b71488e650d 100644 --- a/test/t/test_vgscan.py +++ b/test/t/test_vgscan.py @@ -6,4 +6,4 @@ class TestVgscan: @pytest.mark.complete("vgscan -", skipif="! vgscan --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vgsplit.py b/test/t/test_vgsplit.py index 19233dab97a..9a3e1f25434 100644 --- a/test/t/test_vgsplit.py +++ b/test/t/test_vgsplit.py @@ -5,4 +5,4 @@ class TestVgsplit: @pytest.mark.complete("vgsplit -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vi.py b/test/t/test_vi.py index e28b88bfe06..3034a485300 100644 --- a/test/t/test_vi.py +++ b/test/t/test_vi.py @@ -5,8 +5,8 @@ class TestVi: @pytest.mark.complete("vi ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("vi shared/ld.so.conf.d/") def test_2(self, completion): - assert completion.list == "foo.txt libfoo.conf".split() + assert completion == "foo.txt libfoo.conf".split() diff --git a/test/t/test_vipw.py b/test/t/test_vipw.py index 473c6950990..43b0a1b06ad 100644 --- a/test/t/test_vipw.py +++ b/test/t/test_vipw.py @@ -5,4 +5,4 @@ class TestVipw: @pytest.mark.complete("vipw -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vmstat.py b/test/t/test_vmstat.py index 6d8f28ac037..769f246e988 100644 --- a/test/t/test_vmstat.py +++ b/test/t/test_vmstat.py @@ -5,4 +5,4 @@ class TestVmstat: @pytest.mark.complete("vmstat -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vncviewer.py b/test/t/test_vncviewer.py index 57405383dd1..96b8878bf52 100644 --- a/test/t/test_vncviewer.py +++ b/test/t/test_vncviewer.py @@ -6,4 +6,4 @@ class TestVncviewer: @pytest.mark.complete("vncviewer ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_vpnc.py b/test/t/test_vpnc.py index 6edcb275271..f23a8b98833 100644 --- a/test/t/test_vpnc.py +++ b/test/t/test_vpnc.py @@ -13,4 +13,4 @@ class TestVpnc: @pytest.mark.complete("vpnc -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_watch.py b/test/t/test_watch.py index aa1e7b35e1d..4f8e3e2d34e 100644 --- a/test/t/test_watch.py +++ b/test/t/test_watch.py @@ -5,4 +5,4 @@ class TestWatch: @pytest.mark.complete("watch -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_wc.py b/test/t/test_wc.py index 490530333b6..929faad7ac7 100644 --- a/test/t/test_wc.py +++ b/test/t/test_wc.py @@ -6,4 +6,4 @@ class TestWc: @pytest.mark.complete("wc --", skipif="! wc --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_webmitm.py b/test/t/test_webmitm.py index bfaeec365df..50658e8a13f 100644 --- a/test/t/test_webmitm.py +++ b/test/t/test_webmitm.py @@ -5,4 +5,4 @@ class TestWebmitm: @pytest.mark.complete("webmitm -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_wget.py b/test/t/test_wget.py index a1cfdb5f9d9..61b84356439 100644 --- a/test/t/test_wget.py +++ b/test/t/test_wget.py @@ -5,8 +5,8 @@ class TestWget: @pytest.mark.complete("wget ") def test_1(self, completion): - assert not completion.list + assert not completion @pytest.mark.complete("wget --h") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_who.py b/test/t/test_who.py index adc491567fc..6554e4e96b7 100644 --- a/test/t/test_who.py +++ b/test/t/test_who.py @@ -6,4 +6,4 @@ class TestWho: @pytest.mark.complete("who --", skipif="! who --help &>/dev/null") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_wine.py b/test/t/test_wine.py index 106b35c1170..8ba133ced84 100644 --- a/test/t/test_wine.py +++ b/test/t/test_wine.py @@ -3,12 +3,10 @@ class TestWine: - @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("wine ", cwd="shared/default") def test_1(self, completion): - assert completion.list == ["bar bar.d/", "foo.d/"] + assert completion == ["bar bar.d/", "foo.d/"] - @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("wine notepad ", cwd="shared/default") def test_2(self, completion): - assert completion.list == ["bar", "bar bar.d/", "foo", "foo.d/"] + assert completion == ["bar", "bar bar.d/", "foo", "foo.d/"] diff --git a/test/t/test_withlist.py b/test/t/test_withlist.py index 86a01ad230a..bfa951ff8ed 100644 --- a/test/t/test_withlist.py +++ b/test/t/test_withlist.py @@ -5,4 +5,4 @@ class TestWithlist: @pytest.mark.complete("withlist --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_wodim.py b/test/t/test_wodim.py index 46f729fd628..7e2b6dfb7ac 100644 --- a/test/t/test_wodim.py +++ b/test/t/test_wodim.py @@ -5,4 +5,4 @@ class TestWodim: @pytest.mark.complete("wodim ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_wol.py b/test/t/test_wol.py index a787171620e..d1287839286 100644 --- a/test/t/test_wol.py +++ b/test/t/test_wol.py @@ -10,9 +10,9 @@ class TestWol: @pytest.mark.complete("wol ") def test_1(self, completion): - assert completion.list == "00:00:00:00:00:00 11:11:11:11:11:11 " \ + assert completion == "00:00:00:00:00:00 11:11:11:11:11:11 " \ "22:22:22:22:22:22 33:33:33:33:33:33".split() @pytest.mark.complete("wol 00:") def test_2(self, completion): - assert completion.list == ["00:00:00:00:00:00"] + assert completion == "00:00:00:00:00:00" diff --git a/test/t/test_write.py b/test/t/test_write.py index fa7547a1d9e..12646cd2543 100644 --- a/test/t/test_write.py +++ b/test/t/test_write.py @@ -5,4 +5,4 @@ class TestWrite: @pytest.mark.complete("write root") def test_1(self, completion): - assert "root" in completion.list + assert "root" in completion diff --git a/test/t/test_wsimport.py b/test/t/test_wsimport.py index cc4ee6de66f..c6ccd6c5a5d 100644 --- a/test/t/test_wsimport.py +++ b/test/t/test_wsimport.py @@ -5,4 +5,4 @@ class TestWsimport: @pytest.mark.complete("wsimport ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_wtf.py b/test/t/test_wtf.py index ed4fdeee703..cb3abc76dbd 100644 --- a/test/t/test_wtf.py +++ b/test/t/test_wtf.py @@ -5,4 +5,4 @@ class TestWtf: @pytest.mark.complete("wtf A") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_wvdial.py b/test/t/test_wvdial.py index 8e4140dd449..1e0b1b2a29b 100644 --- a/test/t/test_wvdial.py +++ b/test/t/test_wvdial.py @@ -5,4 +5,4 @@ class TestWvdial: @pytest.mark.complete("wvdial -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_xdg_mime.py b/test/t/test_xdg_mime.py index 20916f3f070..89da5768bfb 100644 --- a/test/t/test_xdg_mime.py +++ b/test/t/test_xdg_mime.py @@ -8,24 +8,24 @@ class TestXdgMime: @pytest.mark.complete("xdg-mime ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("xdg-mime -") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("xdg-mime query ") def test_3(self, completion): - assert completion.list + assert completion @pytest.mark.complete("xdg-mime query filetype ") def test_4(self, completion): - assert completion.list + assert completion @pytest.mark.complete("xdg-mime default foo.desktop ") def test_5(self, completion): - assert completion.list + assert completion @pytest.mark.complete("xdg-mime install --mode ") def test_6(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_xdg_settings.py b/test/t/test_xdg_settings.py index 36ee2a1e2d6..d3d231fcda2 100644 --- a/test/t/test_xdg_settings.py +++ b/test/t/test_xdg_settings.py @@ -8,12 +8,12 @@ class TestXdgSettings: @pytest.mark.complete("xdg-settings ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("xdg-settings --") def test_2(self, completion): - assert completion.list + assert completion @pytest.mark.complete("xdg-settings get ") def test_3(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_xfreerdp.py b/test/t/test_xfreerdp.py index 136bc7f3405..51aca707340 100644 --- a/test/t/test_xfreerdp.py +++ b/test/t/test_xfreerdp.py @@ -6,4 +6,4 @@ class TestXfreerdp: @pytest.mark.complete("xfreerdp ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_xgamma.py b/test/t/test_xgamma.py index c1c47a016df..49a474ecbcc 100644 --- a/test/t/test_xgamma.py +++ b/test/t/test_xgamma.py @@ -5,9 +5,9 @@ class TestXgamma: @pytest.mark.complete("xgamma -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("xgamma -gam") def test_2(self, completion): - assert completion.list == ["-gamma"] - assert completion.output.endswith(" ") + assert completion == "-gamma" + assert completion.endswith(" ") diff --git a/test/t/test_xm.py b/test/t/test_xm.py index 89efba83611..180191d07af 100644 --- a/test/t/test_xm.py +++ b/test/t/test_xm.py @@ -5,4 +5,4 @@ class TestXm: @pytest.mark.complete("xm ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_xmllint.py b/test/t/test_xmllint.py index f59fbef313a..c666ccdd707 100644 --- a/test/t/test_xmllint.py +++ b/test/t/test_xmllint.py @@ -5,8 +5,8 @@ class TestXmllint: @pytest.mark.complete("xmllint ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("xmllint -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_xmlwf.py b/test/t/test_xmlwf.py index 13be4ee86e7..558b12e6ce9 100644 --- a/test/t/test_xmlwf.py +++ b/test/t/test_xmlwf.py @@ -5,4 +5,4 @@ class TestXmlwf: @pytest.mark.complete("xmlwf ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_xmms.py b/test/t/test_xmms.py index 539ae76a3f0..1f7b74e329a 100644 --- a/test/t/test_xmms.py +++ b/test/t/test_xmms.py @@ -5,4 +5,4 @@ class TestXmms: @pytest.mark.complete("xmms --") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_xmodmap.py b/test/t/test_xmodmap.py index 6ea374c221f..fabe1904940 100644 --- a/test/t/test_xmodmap.py +++ b/test/t/test_xmodmap.py @@ -5,8 +5,8 @@ class TestXmodmap: @pytest.mark.complete("xmodmap ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("xmodmap -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_xpovray.py b/test/t/test_xpovray.py index d79fb5900e3..3603d96e656 100644 --- a/test/t/test_xpovray.py +++ b/test/t/test_xpovray.py @@ -5,4 +5,4 @@ class TestXpovray: @pytest.mark.complete("xpovray ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_xrandr.py b/test/t/test_xrandr.py index b90aaec92fa..9712ddc3ada 100644 --- a/test/t/test_xrandr.py +++ b/test/t/test_xrandr.py @@ -5,8 +5,8 @@ class TestXrandr: @pytest.mark.complete("xrandr ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("xrandr --mode ") def test_2(self, completion): - assert not completion.list + assert not completion diff --git a/test/t/test_xrdb.py b/test/t/test_xrdb.py index 0c7835000c6..72445f5567e 100644 --- a/test/t/test_xrdb.py +++ b/test/t/test_xrdb.py @@ -5,4 +5,4 @@ class TestXrdb: @pytest.mark.complete("xrdb ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_xsltproc.py b/test/t/test_xsltproc.py index b9b76d0a27f..5284141ac86 100644 --- a/test/t/test_xsltproc.py +++ b/test/t/test_xsltproc.py @@ -5,8 +5,8 @@ class TestXsltproc: @pytest.mark.complete("xsltproc ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("xsltproc -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_xvnc4viewer.py b/test/t/test_xvnc4viewer.py index bdd926d96d3..88635bd843d 100644 --- a/test/t/test_xvnc4viewer.py +++ b/test/t/test_xvnc4viewer.py @@ -5,12 +5,12 @@ class TestXvnc4viewer: @pytest.mark.complete("xvnc4viewer -") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("xvnc4viewer -PreferredEncoding ") def test_2(self, completion): - assert completion.list == "hextile raw zrle".split() + assert completion == "hextile raw zrle".split() @pytest.mark.complete("xvnc4viewer --preferredencoding ") def test_3(self, completion): - assert completion.list == "hextile raw zrle".split() + assert completion == "hextile raw zrle".split() diff --git a/test/t/test_xxd.py b/test/t/test_xxd.py index a8f901eae68..57b0123fd7c 100644 --- a/test/t/test_xxd.py +++ b/test/t/test_xxd.py @@ -5,8 +5,8 @@ class TestXxd: @pytest.mark.complete("xxd ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("xxd -") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_xz.py b/test/t/test_xz.py index d73594892a5..03a51041ae3 100644 --- a/test/t/test_xz.py +++ b/test/t/test_xz.py @@ -5,17 +5,17 @@ class TestXz: @pytest.mark.complete("xz ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("xz -d xz/") def test_2(self, completion): - assert completion.list == "a/ bashcomp.lzma bashcomp.tar.xz " \ + assert completion == "a/ bashcomp.lzma bashcomp.tar.xz " \ "bashcomp.tlz bashcomp.xz".split() @pytest.mark.complete("xz xz/") def test_3(self, completion): - assert completion.list == "a/ bashcomp.tar".split() + assert completion == "a/ bashcomp.tar".split() @pytest.mark.complete("xz ~") def test_4(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_xzdec.py b/test/t/test_xzdec.py index 15b909ed996..8e2fa5970c2 100644 --- a/test/t/test_xzdec.py +++ b/test/t/test_xzdec.py @@ -5,4 +5,4 @@ class TestXzdec: @pytest.mark.complete("xzdec ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ypcat.py b/test/t/test_ypcat.py index 67502a634e9..14b7bf1c205 100644 --- a/test/t/test_ypcat.py +++ b/test/t/test_ypcat.py @@ -5,4 +5,4 @@ class TestYpcat: @pytest.mark.complete("ypcat ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_ypmatch.py b/test/t/test_ypmatch.py index c3594779e70..dfbf2d1467b 100644 --- a/test/t/test_ypmatch.py +++ b/test/t/test_ypmatch.py @@ -5,4 +5,4 @@ class TestYpmatch: @pytest.mark.complete("ypmatch foo ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_yum.py b/test/t/test_yum.py index 6852a8537b0..869784988ce 100644 --- a/test/t/test_yum.py +++ b/test/t/test_yum.py @@ -5,4 +5,4 @@ class TestYum: @pytest.mark.complete("yum -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_yum_arch.py b/test/t/test_yum_arch.py index 2941096fe45..f8f15e9dbd8 100644 --- a/test/t/test_yum_arch.py +++ b/test/t/test_yum_arch.py @@ -8,4 +8,4 @@ class TestYumArch: @pytest.mark.complete("yum-arch -") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_zopfli.py b/test/t/test_zopfli.py index 15faa0766ff..b035f81f386 100644 --- a/test/t/test_zopfli.py +++ b/test/t/test_zopfli.py @@ -5,8 +5,8 @@ class TestZopfli: @pytest.mark.complete("zopfli ") def test_1(self, completion): - assert completion.list + assert completion @pytest.mark.complete("zopfli ~") def test_2(self, completion): - assert completion.list + assert completion diff --git a/test/t/test_zopflipng.py b/test/t/test_zopflipng.py index 2aa23f11890..a72efa6af21 100644 --- a/test/t/test_zopflipng.py +++ b/test/t/test_zopflipng.py @@ -5,4 +5,4 @@ class TestZopflipng: @pytest.mark.complete("zopflipng ") def test_1(self, completion): - assert completion.list + assert completion diff --git a/test/t/unit/test_unit_ip_addresses.py b/test/t/unit/test_unit_ip_addresses.py index 14688ea0048..a821a51e474 100644 --- a/test/t/unit/test_unit_ip_addresses.py +++ b/test/t/unit/test_unit_ip_addresses.py @@ -27,18 +27,18 @@ def test_1(self, bash): @pytest.mark.complete("iaa ") def test_2(self, functions, completion): """_ip_addresses -a should complete ip addresses.""" - assert completion.list - assert all("." in x or ":" in x for x in completion.list) + assert completion + assert all("." in x or ":" in x for x in completion) @pytest.mark.complete("ia ") def test_3(self, functions, completion): """_ip_addresses should complete ipv4 addresses.""" - assert completion.list - assert all("." in x for x in completion.list) + assert completion + assert all("." in x for x in completion) @pytest.mark.xfail(in_docker(), reason="Probably fails in docker") @pytest.mark.complete("ia6 ") def test_4(self, functions, completion): """_ip_addresses -6 should complete ipv6 addresses.""" - assert completion.list - assert all(":" in x for x in completion.list) + assert completion + assert all(":" in x for x in completion) From 5ecb9d7e1372961f4f983b1fd0adaa273ac06bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 14 Jan 2019 20:59:22 +0200 Subject: [PATCH 0029/1094] __parse_options: Avoid non-zero exit status This may propagate as _parse_help/usage exit status and cause problems with unit tests. I don't think the intent ever was to return anything but zero from them. --- bash_completion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_completion b/bash_completion index 035fa1a7ea1..e01e33a1f88 100644 --- a/bash_completion +++ b/bash_completion @@ -768,7 +768,7 @@ __parse_options() *) break ;; esac done - [[ $option ]] || return + [[ $option ]] || return 0 IFS=$' \t\n' # affects parsing of the regexps below... From a2c9da2355e984eea8c9296e707bc77187d12b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 14 Jan 2019 21:00:28 +0200 Subject: [PATCH 0030/1094] test: Convert remaining _parse_help unit test to pytest+pexpect --- test/t/unit/test_unit_parse_help.py | 7 +++++++ test/unit/_parse_help.exp | 21 --------------------- 2 files changed, 7 insertions(+), 21 deletions(-) delete mode 100644 test/unit/_parse_help.exp diff --git a/test/t/unit/test_unit_parse_help.py b/test/t/unit/test_unit_parse_help.py index 747c7369025..537e8fc1ba6 100644 --- a/test/t/unit/test_unit_parse_help.py +++ b/test/t/unit/test_unit_parse_help.py @@ -155,3 +155,10 @@ def test_29(self, bash): output = assert_bash_exec( bash, "echo '-f or --foo' | _parse_help -", want_output=True) assert output.split() == "--foo".split() + + def test_30(self, bash): + """More than two dashes should not be treated as options.""" + assert_bash_exec(bash, + r"fn() { printf '%s\n' $'----\n---foo\n----- bar'; }") + output = assert_bash_exec(bash, "_parse_help fn") + assert not output diff --git a/test/unit/_parse_help.exp b/test/unit/_parse_help.exp deleted file mode 100644 index fadde068d24..00000000000 --- a/test/unit/_parse_help.exp +++ /dev/null @@ -1,21 +0,0 @@ -# By Stephen Gildea, October 2010. - -proc setup {} { - save_env -} - -proc teardown {} { - assert_env_unmodified { - /declare -f fn/d - } -} - -setup - - -set cmd {fn() { printf '%s\n' "----\n---foo\n----- bar"; }; _parse_help fn} -assert_bash_list "" $cmd "more than two dashes" -sync_after_int - - -teardown From 50251dcaa79308c3926e331db944734d9aafa76e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 7 Feb 2019 15:33:15 +0200 Subject: [PATCH 0031/1094] ifstat: New completion --- completions/Makefile.am | 1 + completions/ifstat | 35 +++++++++++++++++++++++++++++++++++ test/t/Makefile.am | 1 + test/t/test_ifstat.py | 16 ++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 completions/ifstat create mode 100644 test/t/test_ifstat.py diff --git a/completions/Makefile.am b/completions/Makefile.am index be9b1a7ec25..a043c4b6820 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -156,6 +156,7 @@ bashcomp_DATA = 2to3 \ iconv \ id \ idn \ + ifstat \ iftop \ ifup \ info \ diff --git a/completions/ifstat b/completions/ifstat new file mode 100644 index 00000000000..d8f3dbe46a1 --- /dev/null +++ b/completions/ifstat @@ -0,0 +1,35 @@ +# bash completion for ifstat(1) -*- shell-script -*- + +_ifstat() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -*[hv]) + return + ;; + -*i) + # TODO comma separated + _available_interfaces -a + return + ;; + -*d) + COMPREPLY=( $( compgen -W '$( "$1" -v | + sed -e "s/[,.]//g" -ne "s/^.*drivers://p" )' -- "$cur" ) ) + return + ;; + -*s) + _known_hosts_real -- "$cur" + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + return + fi +} && +complete -F _ifstat ifstat + +# ex: filetype=sh diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 8a67797f127..6c5f00ca34e 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -227,6 +227,7 @@ EXTRA_DIST = \ test_idn.py \ test_id.py \ test_ifdown.py \ + test_ifstat.py \ test_iftop.py \ test_ifup.py \ test_import.py \ diff --git a/test/t/test_ifstat.py b/test/t/test_ifstat.py new file mode 100644 index 00000000000..d3f0dbb79b3 --- /dev/null +++ b/test/t/test_ifstat.py @@ -0,0 +1,16 @@ +import pytest + + +class TestIfstat: + + @pytest.mark.complete("ifstat -") + def test_1(self, completion): + assert completion + + @pytest.mark.complete("ifstat -i ") + def test_2(self, completion): + assert completion + + @pytest.mark.complete("ifstat -d ") + def test_3(self, completion): + assert completion From 39ab16a9be35c8942b2fa5371ea98ac1acb2a6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 7 Feb 2019 18:22:57 +0200 Subject: [PATCH 0032/1094] test: Fix test generation wrt results checking improvements --- test/generate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/generate b/test/generate index b32813321b8..8e3e93291a2 100755 --- a/test/generate +++ b/test/generate @@ -30,7 +30,7 @@ class Test$name: @pytest.mark.complete("$1 $arg") def test_1(self, completion): - assert completion.list + assert completion EOF tmpfile=$(mktemp) From cd2b18a53145f9f4dcca05ee583cc9b221d86f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 9 Feb 2019 21:39:57 +0200 Subject: [PATCH 0033/1094] iperf, iperf3: Add some option arg (non-)completions --- completions/iperf | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/completions/iperf b/completions/iperf index b66cdb8db56..eead7ed6b0d 100644 --- a/completions/iperf +++ b/completions/iperf @@ -7,8 +7,9 @@ _iperf() case $prev in --help|--version|--interval|--len|--port|--window|--mss|--bandwidth|\ - --num|--time|--listenport|--parallel|--ttl|--linux-congestion|\ - -!(-*)[hvilpwMbntLPTZ]) + --num|--time|--listenport|--parallel|--ttl|--linux-congestion|--omit|\ + --congestion|--bytes|--blockcount|--cport|--set-mss|--flowlabel|\ + --title|--tos|--affinity|-!(-*)[hvilpwMbntLPTZCkOSA]) return ;; --format|-!(-*)f) @@ -37,6 +38,10 @@ _iperf() COMPREPLY=( $( compgen -W 'C' -- "$cur" ) ) return ;; + --logfile) + _filedir log + return + ;; esac $split && return From c10ece5f7646bbc7ffeb85943da1b45de85b8772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 9 Feb 2019 22:11:20 +0200 Subject: [PATCH 0034/1094] test: Convert remaining man test case to pytest+pexpect --- test/lib/completions/man.exp | 32 -------------------------------- test/t/test_man.py | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 32 deletions(-) delete mode 100644 test/lib/completions/man.exp diff --git a/test/lib/completions/man.exp b/test/lib/completions/man.exp deleted file mode 100644 index 7ba0737baca..00000000000 --- a/test/lib/completions/man.exp +++ /dev/null @@ -1,32 +0,0 @@ -proc setup {} { - assert_bash_exec "export MANPATH=$::srcdirabs/fixtures/man:$::srcdirabs/tmp/man" - save_env - - if {! [is_cygwin]} { # Colon not allowed in filenames - assert_bash_exec {(cd $TESTDIR/tmp && mkdir -p man/man3 && touch man/man3/Bash::Completion.3pm.gz || true)} - } -} - - -proc teardown {} { - assert_env_unmodified { - /OLDPWD/d - /OLDMANPATH/d - } - - if {! [is_cygwin]} { - assert_bash_exec {(cd $TESTDIR/tmp && rm -r man || true)} - } -} - - -setup - - -if {! [is_cygwin]} { - assert_complete "Bash::Completion" "man Bash::C" - sync_after_int -} - - -teardown diff --git a/test/t/test_man.py b/test/t/test_man.py index 1be6f4c585b..8265c755ed3 100644 --- a/test/t/test_man.py +++ b/test/t/test_man.py @@ -11,6 +11,19 @@ class TestMan: manpath = "$PWD/man" assumed_present = "man" + @pytest.fixture + def colonpath(self, request, bash): + try: + assert_bash_exec(bash, "uname -s 2>&1 | grep -qiF cygwin") + except AssertionError: + pass + else: + pytest.skip("Cygwin doesn't like paths with colons") + return + assert_bash_exec(bash, "mkdir -p $TESTDIR/../tmp/man/man3") + assert_bash_exec( + bash, "touch $TESTDIR/../tmp/man/man3/Bash::Completion.3pm.gz") + @pytest.mark.complete("man bash-completion-testcas", env=dict(MANPATH=manpath)) def test_1(self, completion): @@ -69,3 +82,8 @@ def test_8(self, completion): def test_9(self, bash, completion): assert self.assumed_present in completion assert_bash_exec(bash, "shopt -u failglob") + + @pytest.mark.complete("man Bash::C", + env=dict(MANPATH="%s:../tmp/man" % manpath)) + def test_10(self, bash, colonpath, completion): + assert completion == "Bash::Completion" From 0b4467343aeaab4d8760943bf26955505814b908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 10 Feb 2019 09:49:11 +0200 Subject: [PATCH 0035/1094] ifstat: Make work with iproute2 version --- completions/ifstat | 48 ++++++++++++++++++++++++++++++++++--------- test/t/test_ifstat.py | 6 ++++-- 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/completions/ifstat b/completions/ifstat index d8f3dbe46a1..f4803730fb9 100644 --- a/completions/ifstat +++ b/completions/ifstat @@ -2,31 +2,59 @@ _ifstat() { - local cur prev words cword - _init_completion || return + local cur prev words cword split + _init_completion -s || return case $prev in - -*[hv]) + --help|--version|--scan|--interval|-!(-*)[hvV]) return ;; - -*i) + -!(-*)i) # TODO comma separated _available_interfaces -a return ;; - -*d) - COMPREPLY=( $( compgen -W '$( "$1" -v | - sed -e "s/[,.]//g" -ne "s/^.*drivers://p" )' -- "$cur" ) ) + -!(-*)d) + # iproute2: no completion (scan delay) + # traditional: parse driver + if ! { "$1" --help 2>&1 || :; } | \ + command grep -q -- '-d.*--scan'; then + COMPREPLY=( $( compgen -W '$( "$1" -v | + sed -e "s/[,.]//g" -ne "s/^.*drivers://p" )' -- "$cur" ) ) + fi return ;; - -*s) - _known_hosts_real -- "$cur" + --noupdate|-!(-*)s) + # iproute2: pass through (skip history update) + # traditional: hostnames (snmp) + if ! { "$1" --help 2>&1 || :; } | \ + command grep -q -- '-s.*--noupdate'; then + _known_hosts_real -- "$cur" + return + fi + ;; + -!(-*)t) + # iproute2: no completion (interval) + # traditional: pass through (add timestamp) + ! { "$1" --help 2>&1 || :; } | \ + command grep -q -- '-t.*--interval' || return + ;; + --extended|-!(-*)x) + # iproute2: parse xstat types + COMPREPLY=( $( compgen -W '$( "$1" -x nonexistent-xstat 2>&1 | + awk "found { print \$1 } /supported xstats:/ { found=1 }" )' \ + -- "$cur" ) ) return ;; esac + $split && return + if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + local opts=$( _parse_help "$1" ) + [[ $opts ]] || opts=$( _parse_usage "$1" ) + COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace return fi } && diff --git a/test/t/test_ifstat.py b/test/t/test_ifstat.py index d3f0dbb79b3..ff790baaeb4 100644 --- a/test/t/test_ifstat.py +++ b/test/t/test_ifstat.py @@ -7,10 +7,12 @@ class TestIfstat: def test_1(self, completion): assert completion - @pytest.mark.complete("ifstat -i ") + @pytest.mark.complete("ifstat -i ", + skipif="ifstat -v | command grep -qF iproute2") def test_2(self, completion): assert completion - @pytest.mark.complete("ifstat -d ") + @pytest.mark.complete("ifstat -d ", + skipif="ifstat -v | command grep -qF iproute2") def test_3(self, completion): assert completion From cfd66c236a19ec40dba7bfbf31cafff9cb537da9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 10 Feb 2019 11:27:11 +0200 Subject: [PATCH 0036/1094] test: Remove unnecessary autouse=True from fixtures --- test/t/conftest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/t/conftest.py b/test/t/conftest.py index 5e247752f2f..03ef20c3d1e 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -53,7 +53,7 @@ def find_unique_completion_pair( return result -@pytest.fixture(autouse=True, scope="class") +@pytest.fixture(scope="class") def part_full_user(bash: pexpect.spawn) -> Optional[Tuple[str, str]]: res = assert_bash_exec( bash, "compgen -u", want_output=True, @@ -64,7 +64,7 @@ def part_full_user(bash: pexpect.spawn) -> Optional[Tuple[str, str]]: return pair -@pytest.fixture(autouse=True, scope="class") +@pytest.fixture(scope="class") def part_full_group(bash: pexpect.spawn) -> Optional[Tuple[str, str]]: res = assert_bash_exec( bash, "compgen -g", want_output=True, @@ -75,7 +75,7 @@ def part_full_group(bash: pexpect.spawn) -> Optional[Tuple[str, str]]: return pair -@pytest.fixture(autouse=True, scope="class") +@pytest.fixture(scope="class") def bash(request) -> pexpect.spawn: logfile = None @@ -392,7 +392,7 @@ def assert_complete( return result -@pytest.fixture(autouse=True) +@pytest.fixture def completion(request, bash: pexpect.spawn) -> CompletionResult: marker = request.node.get_closest_marker("complete") if not marker: From 2527706c0dbc65f125529101690087ad128d33ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 10 Feb 2019 11:27:35 +0200 Subject: [PATCH 0037/1094] .gitignore: Add .python-version (for pyenv) --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d6041b1989f..31d577702a6 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,5 @@ bash-completion-config.cmake bash-completion-config-version.cmake __pycache__/ .pytest_cache/ +.python-version pytestdebug.log From e13640eac170580211fed402473effc7f410670d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 10 Feb 2019 11:29:02 +0200 Subject: [PATCH 0038/1094] test: Clean up man tmp dir --- test/t/test_man.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/t/test_man.py b/test/t/test_man.py index 8265c755ed3..07d25567473 100644 --- a/test/t/test_man.py +++ b/test/t/test_man.py @@ -23,6 +23,8 @@ def colonpath(self, request, bash): assert_bash_exec(bash, "mkdir -p $TESTDIR/../tmp/man/man3") assert_bash_exec( bash, "touch $TESTDIR/../tmp/man/man3/Bash::Completion.3pm.gz") + request.addfinalizer( + lambda: assert_bash_exec(bash, "rm -r $TESTDIR/../tmp/man")) @pytest.mark.complete("man bash-completion-testcas", env=dict(MANPATH=manpath)) From a4dd187c52e6270ae3dcc09c48a9f613b234f886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 10 Feb 2019 11:58:16 +0200 Subject: [PATCH 0039/1094] test: Remove unnecessary ri xfail --- test/t/test_ri.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/t/test_ri.py b/test/t/test_ri.py index dbc3ead27ef..70b1a8f163c 100644 --- a/test/t/test_ri.py +++ b/test/t/test_ri.py @@ -12,7 +12,6 @@ class TestRi: def test_1(self, completion): assert completion - @pytest.mark.xfail # TODO: completion split issues (single space) @pytest.mark.complete("ri --dump=ri/") def test_2(self, completion): assert completion == "BashCompletion/ cache.ri".split() From 15fe6395eb447a7e66a7aec07be2963c5f6c2131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 13 Feb 2019 20:34:30 +0200 Subject: [PATCH 0040/1094] jsonschema: New completion --- completions/Makefile.am | 1 + completions/jsonschema | 29 +++++++++++++++++++++++++++++ test/t/Makefile.am | 1 + test/t/test_jsonschema.py | 12 ++++++++++++ 4 files changed, 43 insertions(+) create mode 100644 completions/jsonschema create mode 100644 test/t/test_jsonschema.py diff --git a/completions/Makefile.am b/completions/Makefile.am index a043c4b6820..fce168656df 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -189,6 +189,7 @@ bashcomp_DATA = 2to3 \ jps \ jshint \ json_xs \ + jsonschema \ k3b \ kcov \ kill \ diff --git a/completions/jsonschema b/completions/jsonschema new file mode 100644 index 00000000000..ec52586818f --- /dev/null +++ b/completions/jsonschema @@ -0,0 +1,29 @@ +# bash completion for jsonschema -*- shell-script -*- + +_jsonschema() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --help|--error-format|--validator|-[hFV]) + return + ;; + --instance|-i) + _filedir json + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + return + fi + + local args; _count_args "" "-*" + [[ $args -eq 1 ]] || return + _filedir '@(json|schema)' +} && +complete -F _jsonschema jsonschema + +# ex: filetype=sh diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 6c5f00ca34e..ad2bdc8c49b 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -264,6 +264,7 @@ EXTRA_DIST = \ test_jps.py \ test_jq.py \ test_jshint.py \ + test_jsonschema.py \ test_json_xs.py \ test_k3b.py \ test_kcov.py \ diff --git a/test/t/test_jsonschema.py b/test/t/test_jsonschema.py new file mode 100644 index 00000000000..25e49088476 --- /dev/null +++ b/test/t/test_jsonschema.py @@ -0,0 +1,12 @@ +import pytest + + +class TestJsonschema: + + @pytest.mark.complete("jsonschema ") + def test_1(self, completion): + assert completion + + @pytest.mark.complete("jsonschema -") + def test_2(self, completion): + assert completion From 7499fefbd487196f78300e58f65138901862c128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 13 Feb 2019 20:52:06 +0200 Subject: [PATCH 0041/1094] xfreerdp: Update for more modern xfreerdp --- completions/xfreerdp | 34 ++++++++++++++++--------------- test/lib/completions/xfreerdp.exp | 28 ------------------------- test/t/test_xfreerdp.py | 19 +++++++++++++++-- 3 files changed, 35 insertions(+), 46 deletions(-) delete mode 100644 test/lib/completions/xfreerdp.exp diff --git a/completions/xfreerdp b/completions/xfreerdp index 9ca7ac818d1..cc4f55e62e0 100644 --- a/completions/xfreerdp +++ b/completions/xfreerdp @@ -3,31 +3,33 @@ _xfreerdp() { local cur prev words cword - _init_completion || return + _init_completion -n : || return - case $prev in - -k) - COMPREPLY=( $( compgen -W "$($1 --kbd-list | \ - awk '/^0x/ {print $1}')" -- "$cur" ) ) + case $cur in + /kbd:*) + COMPREPLY=( $( compgen -W '$( "$1" /kbd-list | + awk "/^0x/ { print \$1 }" )' -- "${cur#/kbd:}" ) ) return ;; - -a) - COMPREPLY=( $( compgen -W '8 15 16 24 32' -- "$cur" ) ) + /bpp:*) + COMPREPLY=( $( compgen -W '8 15 16 24 32' -- "${cur#/bpp:}" ) ) return ;; - -x) - COMPREPLY=( $( compgen -W 'b broadband m modem l lan' -- "$cur" ) ) - return - ;; - --plugin) - COMPREPLY=( $( compgen -W 'cliprdr rdpsnd rdpdr' -- "$cur" ) ) + /*:*|/help|/version) return ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-u -d -s -c -p -n -t -g -a -z -f -x -O -o -k - --kbd-list -h --plugin --data' -- "$cur" ) ) + if [[ "$cur" == /* ]]; then + COMPREPLY=( $( compgen -W '$( "$1" --help | + awk "\$1 ~ /^\\// && \$1 !~ /^.(flag\$|option:)/ { sub(\":.*\",\":\",\$1); print \$1 }" )' \ + -- "$cur" ) ) + [[ $COMPREPLY == *: ]] && compopt -o nospace + elif [[ "$cur" == [+-]* ]]; then + local char=${cur:0:1} + COMPREPLY=( $( compgen -W '$( "$1" --help | + awk "\$1 ~ /^[+-]/ && \$1 !~ /^.toggle\$/ { sub(\"^.\",\"$char\",\$1); print \$1 }" )' \ + -- "$cur" ) ) else COMPREPLY=( $( compgen -W "$(awk '{print $1}' ~/.freerdp/known_hosts \ 2>/dev/null)" -- "$cur" ) ) diff --git a/test/lib/completions/xfreerdp.exp b/test/lib/completions/xfreerdp.exp deleted file mode 100644 index f61cfcaddce..00000000000 --- a/test/lib/completions/xfreerdp.exp +++ /dev/null @@ -1,28 +0,0 @@ -proc setup {} { - save_env -} - - -proc teardown {} { - assert_env_unmodified -} - - -setup - - -set test "Tab should complete options" -set cmd "xfreerdp --" -send "$cmd\t" -set expected "^$cmd\r\n--data.*--kbd-list.*--plugin\r\n/@$cmd$" -expect { - -re $expected { pass "$test" } - -re /@ { unresolved "$test at prompt" } - default { unresolved "$test" } -} - - -sync_after_int - - -teardown diff --git a/test/t/test_xfreerdp.py b/test/t/test_xfreerdp.py index 51aca707340..06165155cb7 100644 --- a/test/t/test_xfreerdp.py +++ b/test/t/test_xfreerdp.py @@ -1,9 +1,24 @@ import pytest -@pytest.mark.xfail # TODO: completion doesn't seem to be for ~2018 xfreerdp class TestXfreerdp: - @pytest.mark.complete("xfreerdp ") + @pytest.mark.complete("xfreerdp /") def test_1(self, completion): assert completion + + @pytest.mark.complete("xfreerdp -") + def test_2(self, completion): + assert completion + + @pytest.mark.complete("xfreerdp +") + def test_3(self, completion): + assert completion + + @pytest.mark.complete("xfreerdp /kbd:") + def test_4(self, completion): + assert completion + + @pytest.mark.complete("xfreerdp /help ") + def test_5(self, completion): + assert not completion From 479cc270c594c3c1655519eba8745933b50d120c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 23 Feb 2019 07:27:12 +0200 Subject: [PATCH 0042/1094] adb: Deprecate in favor of one shipped with the Android SDK Closes https://github.com/scop/bash-completion/issues/27 Closes https://github.com/scop/bash-completion/pull/283 --- completions/Makefile.am | 2 +- completions/{adb => _adb} | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) rename completions/{adb => _adb} (93%) diff --git a/completions/Makefile.am b/completions/Makefile.am index fce168656df..f54145f974e 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -5,7 +5,7 @@ bashcomp_DATA = 2to3 \ abook \ aclocal \ acpi \ - adb \ + _adb \ add_members \ alias \ ant \ diff --git a/completions/adb b/completions/_adb similarity index 93% rename from completions/adb rename to completions/_adb index d069b425c00..8db1b9d6fe1 100644 --- a/completions/adb +++ b/completions/_adb @@ -1,5 +1,8 @@ # adb completion -*- shell-script -*- +# Use of this file is deprecated. Upstream completion is available in +# the Android SDK, use that instead. + _adb_command_usage() { COMPREPLY=( $( compgen -W \ From 509878dcbc86b3528aac7b15e83203a3f7bfec38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 24 Feb 2019 08:57:31 +0200 Subject: [PATCH 0043/1094] test: Convert remaining tar test cases to pytest+pexpect --- test/lib/completions/tar.exp | 30 ------------------------------ test/t/test_tar.py | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 30 deletions(-) delete mode 100644 test/lib/completions/tar.exp diff --git a/test/lib/completions/tar.exp b/test/lib/completions/tar.exp deleted file mode 100644 index 174e5a6c3f3..00000000000 --- a/test/lib/completions/tar.exp +++ /dev/null @@ -1,30 +0,0 @@ -proc setup {} { - save_env -} - -proc teardown {} { - assert_env_unmodified { - /OLDPWD=/d - /declare -f _tar/d - } -} - -setup - -set test "old option: list escaped chars" -assert_complete_dir "a/b\\'c/" "tar tf escape.tar a/b\\\'" $::srcdir/fixtures/tar $test -sync_after_int - -# TODO: "tar tf escape.tar a/b" - -# Use bsdtar as the it completes to only 'zc zt zx' ('tar' can be GNU tar and it -# can would have more options) -set test "old option: mode is not on first place" -assert_complete {zc zt zx} "bsdtar z" $test -sync_after_int - -set test "old option: check _second_ option in \"old\" argument" -assert_complete_dir "dir/ dir2/" "bsdtar cbfvv NOT_EXISTS " $::srcdir/fixtures/tar -sync_after_int - -teardown diff --git a/test/t/test_tar.py b/test/t/test_tar.py index 9c5d2e474ac..91118ac3e92 100644 --- a/test/t/test_tar.py +++ b/test/t/test_tar.py @@ -105,3 +105,21 @@ def test_18(self, bash, completion, gnu_tar): def test_19(self, bash, completion, gnu_tar): """Test short option -XXXb (arg required).""" assert not completion + + # Use bsdtar here as it completes to only 'zc zt zx' + # -- 'tar' can be GNU tar and have more options + @pytest.mark.complete("bsdtar z") + def test_20(self, bash, completion): + assert completion == "zc zt zx".split() + + @pytest.mark.complete("bsdtar cbfvv NON_EXISTENT ", cwd="tar") + def test_21(self, bash, completion): + """Test _second_ option in "old" argument.""" + assert completion == "dir/ dir2/".split() + + @pytest.mark.complete(r"tar tf escape.tar a/b\'", cwd="tar") + def test_22(self, bash, completion): + """Test listing escaped chars in old option.""" + assert completion == "a/b'c/" + + # TODO: "tar tf escape.tar a/b" From 89a0ed758de066dec353687b6506b512f2901cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 24 Feb 2019 21:01:49 +0200 Subject: [PATCH 0044/1094] test: Fix declare test case with bash 5.0 --- test/t/test_declare.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/t/test_declare.py b/test/t/test_declare.py index 6e3ddb09bdf..f09b51b241a 100644 --- a/test/t/test_declare.py +++ b/test/t/test_declare.py @@ -13,7 +13,8 @@ def test_2(self, completion): @pytest.mark.complete("declare -p BASH_ARG") def test_3(self, completion): - assert completion == "BASH_ARGC BASH_ARGV".split() + # bash 5.0 has BASH_ARGV0 too + assert all(x in completion for x in "BASH_ARGC BASH_ARGV".split()) @pytest.mark.complete("declare -f _parse_") def test_4(self, completion): From 78bb3c040f40bd903f7898812b3d2e95c4e7f47e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 24 Feb 2019 22:04:27 +0200 Subject: [PATCH 0045/1094] test: Expect failure for chown all users test as non-root --- test/t/test_chown.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/t/test_chown.py b/test/t/test_chown.py index 41437635515..bdfef3ff507 100644 --- a/test/t/test_chown.py +++ b/test/t/test_chown.py @@ -1,3 +1,5 @@ +import getpass + import pytest from conftest import assert_bash_exec, assert_complete @@ -11,6 +13,8 @@ ) class TestChown: + @pytest.mark.xfail(getpass.getuser() != "root", + reason="Only root can chown to all users") @pytest.mark.complete("chown ") def test_1(self, bash, completion): users = sorted(assert_bash_exec( From c306a418288d2e6cc94dac0f3f1443385405f3d1 Mon Sep 17 00:00:00 2001 From: "Gabriel F. T. Gomes" Date: Wed, 27 Feb 2019 15:33:11 -0300 Subject: [PATCH 0046/1094] xm: Deprecate completion for obsolete command (#284) The xm command has been removed since Xen 4.5 [1], released Jan 2015. The last version to have this command, Xen 4.4, was only supported until March 2017. Completion for the replacement command, xl, is available upstream [2]. [1] https://wiki.xen.org/wiki/Choice_of_Toolstacks [2] https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=tools/xl/bash-completion;hb=5258ab0fcc67587d802e33bcc5bf89048d184a73 --- completions/Makefile.am | 2 +- completions/{xm => _xm} | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) rename completions/{xm => _xm} (97%) diff --git a/completions/Makefile.am b/completions/Makefile.am index f54145f974e..05b154dd123 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -439,7 +439,7 @@ bashcomp_DATA = 2to3 \ xfreerdp \ xgamma \ xhost \ - xm \ + _xm \ xmllint \ xmlwf \ xmms \ diff --git a/completions/xm b/completions/_xm similarity index 97% rename from completions/xm rename to completions/_xm index c720fae1c62..99a6ad287b9 100644 --- a/completions/xm +++ b/completions/_xm @@ -1,5 +1,9 @@ # bash completion for xm -*- shell-script -*- +# Use of this file is deprecated. The 'xm' command itself is no longer +# provided by upstream. It has been replaced with the 'xl' command, for +# which upstream provides completion, use that instead. + _xen_domain_names() { COMPREPLY=( $( compgen -W "$( xm list 2>/dev/null | \ From 8b2f90e2174f8babb139097228d7923ef2ca4e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 8 Mar 2019 18:51:57 +0200 Subject: [PATCH 0047/1094] ssh: support RemoteCommand and SyslogFacility options --- completions/ssh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/completions/ssh b/completions/ssh index 1335f302c48..3806d103d9e 100644 --- a/completions/ssh +++ b/completions/ssh @@ -51,12 +51,13 @@ _ssh_options() NoHostAuthenticationForLocalhost NumberOfPasswordPrompts PasswordAuthentication PermitLocalCommand PKCS11Provider Port PreferredAuthentications Protocol ProxyCommand ProxyJump ProxyUseFdpass - PubkeyAcceptedKeyTypes PubkeyAuthentication RekeyLimit RemoteForward - RequestTTY RevokedHostKeys RhostsRSAAuthentication RSAAuthentication - SendEnv ServerAliveCountMax ServerAliveInterval SmartcardDevice - StreamLocalBindMask StreamLocalBindUnlink StrictHostKeyChecking - TCPKeepAlive Tunnel TunnelDevice UpdateHostKeys UsePrivilegedPort User - UserKnownHostsFile VerifyHostKeyDNS VisualHostKey XAuthLocation' \ + PubkeyAcceptedKeyTypes PubkeyAuthentication RekeyLimit RemoteCommand + RemoteForward RequestTTY RevokedHostKeys RhostsRSAAuthentication + RSAAuthentication SendEnv ServerAliveCountMax ServerAliveInterval + SmartcardDevice StreamLocalBindMask StreamLocalBindUnlink + StrictHostKeyChecking SyslogFacility TCPKeepAlive Tunnel TunnelDevice + UpdateHostKeys UsePrivilegedPort User UserKnownHostsFile + VerifyHostKeyDNS VisualHostKey XAuthLocation' \ -- "$cur" ) ) } @@ -141,6 +142,10 @@ _ssh_suboption() RequestTTY) COMPREPLY=( $( compgen -W 'no yes force auto' -- "$cur" ) ) ;; + SyslogFacility) + COMPREPLY=( $( compgen -W 'DAEMON USER AUTH LOCAL{0..7}' \ + -- "$cur" ) ) + ;; Tunnel) COMPREPLY=( $( compgen -W 'yes no point-to-point ethernet' \ -- "$cur" ) ) From 17984a2baa943b2166bc7217212dfa6d57a852d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 8 Mar 2019 20:10:38 +0200 Subject: [PATCH 0048/1094] test: sort t/Makefile.am EXTRA_DIST in C locale --- test/t/Makefile.am | 118 ++++++++++++++++++++++----------------------- 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/test/t/Makefile.am b/test/t/Makefile.am index ad2bdc8c49b..467b8df49ec 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -23,8 +23,8 @@ EXTRA_DIST = \ test_apt_get.py \ test_aptitude.py \ test_arch.py \ - test_arping.py \ test_arp.py \ + test_arping.py \ test_arpspoof.py \ test_asciidoc.py \ test_aspell.py \ @@ -54,8 +54,8 @@ EXTRA_DIST = \ test_cancel.py \ test_cardctl.py \ test_cat.py \ - test_ccache.py \ test_cc.py \ + test_ccache.py \ test_ccze.py \ test_cd.py \ test_cdrecord.py \ @@ -77,14 +77,15 @@ EXTRA_DIST = \ test_chroot.py \ test_chrpath.py \ test_chsh.py \ - test_ciptool.py \ test_ci.py \ + test_ciptool.py \ test_civclient.py \ test_civserver.py \ test_cksfv.py \ test_cleanarch.py \ test_clisp.py \ test_clone_member.py \ + test_co.py \ test_compare.py \ test_complete.py \ test_composite.py \ @@ -92,13 +93,12 @@ EXTRA_DIST = \ test_configure.py \ test_conjure.py \ test_convert.py \ - test_co.py \ test_cowsay.py \ + test_cp.py \ test_cpan2dist.py \ test_cpio.py \ - test_cppcheck.py \ - test_cp.py \ test_cplusplus.py \ + test_cppcheck.py \ test_createdb.py \ test_createuser.py \ test_crontab.py \ @@ -106,8 +106,8 @@ EXTRA_DIST = \ test_csplit.py \ test_curl.py \ test_cut.py \ - test_cvsps.py \ test_cvs.py \ + test_cvsps.py \ test_date.py \ test_dcop.py \ test_dd.py \ @@ -124,17 +124,17 @@ EXTRA_DIST = \ test_dmesg.py \ test_dnsspoof.py \ test_dot.py \ - test_dpkg_deb.py \ test_dpkg.py \ + test_dpkg_deb.py \ test_dpkg_reconfigure.py \ test_dpkg_source.py \ test_dropdb.py \ test_dropuser.py \ test_dselect.py \ test_dsniff.py \ + test_du.py \ test_dumpdb.py \ test_dumpe2fs.py \ - test_du.py \ test_e2freefrag.py \ test_e2label.py \ test_ebtables.py \ @@ -153,12 +153,12 @@ EXTRA_DIST = \ test_fbgs.py \ test_fbi.py \ test_feh.py \ - test_filefrag.py \ test_file.py \ test_file_roller.py \ + test_filefrag.py \ test_filesnarf.py \ - test_find_member.py \ test_find.py \ + test_find_member.py \ test_finger.py \ test_fio.py \ test_firefox.py \ @@ -183,8 +183,8 @@ EXTRA_DIST = \ test_getconf.py \ test_getent.py \ test_gkrellm.py \ - test_gmplayer.py \ test_gm.py \ + test_gmplayer.py \ test_gnatmake.py \ test_gnokii.py \ test_gnome_mplayer.py \ @@ -192,12 +192,12 @@ EXTRA_DIST = \ test_gpasswd.py \ test_gpc.py \ test_gperf.py \ - test_gpg2.py \ test_gpg.py \ + test_gpg2.py \ test_gpgv.py \ test_gphoto2.py \ - test_gprof.py \ test_gplusplus.py \ + test_gprof.py \ test_grep.py \ test_groupadd.py \ test_groupdel.py \ @@ -214,8 +214,8 @@ EXTRA_DIST = \ test_head.py \ test_hexdump.py \ test_hid2hci.py \ - test_hostname.py \ test_host.py \ + test_hostname.py \ test_hping2.py \ test_hping3.py \ test_htop.py \ @@ -223,9 +223,9 @@ EXTRA_DIST = \ test_hunspell.py \ test_hwclock.py \ test_iconv.py \ + test_id.py \ test_identify.py \ test_idn.py \ - test_id.py \ test_ifdown.py \ test_ifstat.py \ test_iftop.py \ @@ -240,9 +240,9 @@ EXTRA_DIST = \ test_interdiff.py \ test_invoke_rc_d.py \ test_ionice.py \ + test_ip.py \ test_iperf.py \ test_ipmitool.py \ - test_ip.py \ test_ipsec.py \ test_iptables.py \ test_ipv6calc.py \ @@ -256,21 +256,21 @@ EXTRA_DIST = \ test_iwspy.py \ test_jar.py \ test_jarsigner.py \ + test_java.py \ test_javac.py \ test_javadoc.py \ - test_java.py \ test_javaws.py \ test_jpegoptim.py \ test_jps.py \ test_jq.py \ test_jshint.py \ - test_jsonschema.py \ test_json_xs.py \ + test_jsonschema.py \ test_k3b.py \ test_kcov.py \ test_kdvi.py \ - test_killall.py \ test_kill.py \ + test_killall.py \ test_kldload.py \ test_kldunload.py \ test_koji.py \ @@ -280,6 +280,7 @@ EXTRA_DIST = \ test_l2ping.py \ test_larch.py \ test_lastlog.py \ + test_ld.py \ test_ldapadd.py \ test_ldapcompare.py \ test_ldapdelete.py \ @@ -289,14 +290,13 @@ EXTRA_DIST = \ test_ldapvi.py \ test_ldapwhoami.py \ test_ldd.py \ - test_ld.py \ test_less.py \ - test_lftpget.py \ test_lftp.py \ + test_lftpget.py \ test_lilo.py \ test_links.py \ - test_lintian_info.py \ test_lintian.py \ + test_lintian_info.py \ test_lisp.py \ test_list_admins.py \ test_list_lists.py \ @@ -308,13 +308,13 @@ EXTRA_DIST = \ test_lpq.py \ test_lpr.py \ test_lrzip.py \ + test_ls.py \ test_lsof.py \ test_lspci.py \ - test_ls.py \ test_lsscsi.py \ test_lsusb.py \ - test_luac.py \ test_lua.py \ + test_luac.py \ test_luseradd.py \ test_luserdel.py \ test_lusermod.py \ @@ -322,14 +322,14 @@ EXTRA_DIST = \ test_lvcreate.py \ test_lvdisplay.py \ test_lvextend.py \ - test_lvmdiskscan.py \ test_lvm.py \ + test_lvmdiskscan.py \ test_lvreduce.py \ test_lvremove.py \ test_lvrename.py \ test_lvresize.py \ - test_lvscan.py \ test_lvs.py \ + test_lvscan.py \ test_lz4.py \ test_lzip.py \ test_lzma.py \ @@ -338,8 +338,8 @@ EXTRA_DIST = \ test_macof.py \ test_mailmanctl.py \ test_mailsnarf.py \ - test_makepkg.py \ test_make.py \ + test_makepkg.py \ test_man.py \ test_mc.py \ test_mcrypt.py \ @@ -372,18 +372,18 @@ EXTRA_DIST = \ test_msgsnarf.py \ test_msynctool.py \ test_mtx.py \ - test_munindoc.py \ test_munin_node_configure.py \ test_munin_run.py \ + test_munindoc.py \ test_mussh.py \ - test_muttng.py \ test_mutt.py \ + test_muttng.py \ test_mv.py \ test_mypy.py \ - test_mysqladmin.py \ test_mysql.py \ - test_ncftp.py \ + test_mysqladmin.py \ test_nc.py \ + test_ncftp.py \ test_nethogs.py \ test_netstat.py \ test_newgrp.py \ @@ -391,9 +391,9 @@ EXTRA_DIST = \ test_newusers.py \ test_ngrep.py \ test_nl.py \ + test_nm.py \ test_nmap.py \ test_nmcli.py \ - test_nm.py \ test_nproc.py \ test_nslookup.py \ test_ntpdate.py \ @@ -411,9 +411,9 @@ EXTRA_DIST = \ test_paste.py \ test_patch.py \ test_pdftotext.py \ + test_perl.py \ test_perlcritic.py \ test_perldoc.py \ - test_perl.py \ test_perltidy.py \ test_pgrep.py \ test_phing.py \ @@ -421,12 +421,12 @@ EXTRA_DIST = \ test_pine.py \ test_pinfo.py \ test_ping.py \ - test_pkgadd.py \ test_pkg_config.py \ test_pkg_deinstall.py \ test_pkg_delete.py \ test_pkg_get.py \ test_pkg_info.py \ + test_pkgadd.py \ test_pkgrm.py \ test_pkgtool.py \ test_pkgutil.py \ @@ -445,21 +445,21 @@ EXTRA_DIST = \ test_postmap.py \ test_postsuper.py \ test_povray.py \ + test_pr.py \ test_prelink.py \ test_protoc.py \ - test_pr.py \ test_psql.py \ test_ptx.py \ test_puppet.py \ test_pushd.py \ + test_pv.py \ test_pvchange.py \ test_pvcreate.py \ test_pvdisplay.py \ test_pvmove.py \ - test_pv.py \ test_pvremove.py \ - test_pvscan.py \ test_pvs.py \ + test_pvscan.py \ test_pwck.py \ test_pwd.py \ test_pwdx.py \ @@ -468,8 +468,8 @@ EXTRA_DIST = \ test_pydoc.py \ test_pydocstyle.py \ test_pyflakes.py \ - test_pylint_3.py \ test_pylint.py \ + test_pylint_3.py \ test_pytest.py \ test_python.py \ test_python3.py \ @@ -477,12 +477,12 @@ EXTRA_DIST = \ test_qemu.py \ test_qrunner.py \ test_querybts.py \ + test_quota.py \ test_quotacheck.py \ test_quotaon.py \ - test_quota.py \ test_radvdump.py \ - test_rcsdiff.py \ test_rcs.py \ + test_rcsdiff.py \ test_rdesktop.py \ test_rdict.py \ test_readelf.py \ @@ -498,15 +498,15 @@ EXTRA_DIST = \ test_rfkill.py \ test_ri.py \ test_rlog.py \ + test_rm.py \ test_rmdir.py \ test_rmlist.py \ test_rmmod.py \ - test_rm.py \ test_route.py \ test_rpcdebug.py \ + test_rpm.py \ test_rpm2tgz.py \ test_rpmbuild.py \ - test_rpm.py \ test_rrdtool.py \ test_rsync.py \ test_rtcwake.py \ @@ -523,9 +523,9 @@ EXTRA_DIST = \ test_set.py \ test_setquota.py \ test_sftp.py \ + test_sh.py \ test_sha1sum.py \ test_shar.py \ - test_sh.py \ test_sitecopy.py \ test_slackpkg.py \ test_slapt_get.py \ @@ -543,27 +543,27 @@ EXTRA_DIST = \ test_split.py \ test_spovray.py \ test_sqlite3.py \ + test_ss.py \ + test_ssh.py \ test_ssh_add.py \ test_ssh_copy_id.py \ - test_sshfs.py \ test_ssh_keygen.py \ + test_sshfs.py \ test_sshmitm.py \ test_sshow.py \ - test_ssh.py \ - test_ss.py \ test_strace.py \ test_stream.py \ test_strings.py \ test_strip.py \ - test_sudo.py \ test_su.py \ + test_sudo.py \ test_svcadm.py \ test_svk.py \ + test_svn.py \ test_svnadmin.py \ test_svnlook.py \ - test_svn.py \ - test_synclient.py \ test_sync_members.py \ + test_synclient.py \ test_sysbench.py \ test_sysctl.py \ test_tac.py \ @@ -575,13 +575,13 @@ EXTRA_DIST = \ test_tee.py \ test_texindex.py \ test_tightvncviewer.py \ - test_timeout.py \ test_time.py \ + test_timeout.py \ test_tipc.py \ test_touch.py \ test_tox.py \ - test_tracepath.py \ test_tr.py \ + test_tracepath.py \ test_tshark.py \ test_tune2fs.py \ test_udevadm.py \ @@ -620,11 +620,11 @@ EXTRA_DIST = \ test_vgreduce.py \ test_vgremove.py \ test_vgrename.py \ + test_vgs.py \ test_vgscan.py \ test_vgsplit.py \ - test_vgs.py \ - test_vipw.py \ test_vi.py \ + test_vipw.py \ test_vmstat.py \ test_vncviewer.py \ test_vpnc.py \ @@ -645,25 +645,25 @@ EXTRA_DIST = \ test_xdg_settings.py \ test_xfreerdp.py \ test_xgamma.py \ + test_xm.py \ test_xmllint.py \ test_xmlwf.py \ test_xmms.py \ test_xmodmap.py \ - test_xm.py \ test_xpovray.py \ test_xrandr.py \ test_xrdb.py \ test_xsltproc.py \ test_xvnc4viewer.py \ test_xxd.py \ - test_xzdec.py \ test_xz.py \ + test_xzdec.py \ test_ypcat.py \ test_ypmatch.py \ - test_yum_arch.py \ test_yum.py \ - test_zopflipng.py \ - test_zopfli.py + test_yum_arch.py \ + test_zopfli.py \ + test_zopflipng.py all: From 7a9913ffa8c1508823ba05f832895d20b6a178a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 8 Mar 2019 20:17:26 +0200 Subject: [PATCH 0049/1094] test: rewrite "generate" in Python, fix trailing backslash in EXTRA_DIST --- test/docker/docker-script.sh | 2 +- test/generate | 104 +++++++++++++++++------------------ 2 files changed, 52 insertions(+), 54 deletions(-) diff --git a/test/docker/docker-script.sh b/test/docker/docker-script.sh index ff541ea18b9..9736a47dc83 100755 --- a/test/docker/docker-script.sh +++ b/test/docker/docker-script.sh @@ -2,7 +2,7 @@ if [ $DIST = tools ]; then perlcritic helpers/perl - flake8 helpers/python test + flake8 helpers/python test test/generate exit 0 fi diff --git a/test/generate b/test/generate index 8e3e93291a2..2bf0ccc6edb 100755 --- a/test/generate +++ b/test/generate @@ -1,63 +1,61 @@ -#!/bin/bash -eu +#!/usr/bin/env python3 -# Generate skeleton files for completion of specified command. +# Generate skeleton files for completion of specified command -shopt -s extglob +import fileinput +import re +import sys -if [[ $# -lt 1 ]]; then - echo "Usage: $0 command [args...]" >&2 - exit 1 -fi -cmd=$1 -file=$1 -arg=${2-} -marker= +def main(): + if len(sys.argv) < 2: + print("Usage: %s command [args...]" % sys.argv[0], file=sys.stderr) + sys.exit(1) -if [[ $cmd == *[.+-]* ]]; then - file=${cmd//[.-]/_} - file=${file//+/plus} - marker=$'\n'"@pytest.mark.bashcomp("$'\n'" cmd=\"$cmd\","$'\n'")" -fi + cmd = testfile = sys.argv[1] + args = " ".join(sys.argv[2:]) if len(sys.argv) > 2 else "" + marker = "" + if re.search("[.+-]", cmd): + testfile = re.sub("[.-]", "_", cmd).replace("+", "plus") + marker = '\n@pytest.mark.bashcomp(\n cmd="%s",\n)' % cmd + testfile = "test_%s.py" % testfile + name = re.sub("(^|[_-]+)(.)", lambda m: m.group(2).upper(), cmd) + name = name.replace("+", "Plus") -name=$(python -c "import re,sys;print(re.sub('(^|[_-]+)(.)',lambda m:m.group(2).upper(),sys.argv[1]).replace('+','Plus'))" $file) - -cat <t/test_$file.py + with open("t/%s" % testfile, "w") as f: + print( + """\ import pytest -$marker -class Test$name: +%s +class Test%s: - @pytest.mark.complete("$1 $arg") + @pytest.mark.complete("%s %s") def test_1(self, completion): - assert completion -EOF - -tmpfile=$(mktemp) -trap "{ rm -f $tmpfile; }" EXIT -in_extra_dist= -added= -IFS=$'\n' -while read -r line; do - if [[ $in_extra_dist ]]; then - if [[ $line != $'\t'* ]]; then - if [[ ! $added ]]; then - echo -e "\ttest_$file.py" - added=true - fi - in_extra_dist= - else - [[ $line == *\\ ]] || line="$line \\" - if [[ ! $added && $line > $'\t'test_$file.py ]]; then - echo -e "\ttest_$file.py \\" - added=true - fi - fi - echo "$line" - else - if [[ $line == EXTRA_DIST\ * ]]; then - in_extra_dist=true - fi - echo "$line" - fi -done < t/Makefile.am > $tmpfile && mv -f $tmpfile t/Makefile.am + assert completion""" + % (marker, name, cmd, args), + file=f, + ) + + in_extra_dist = False + extra_dist_lines = set() + with fileinput.input(files=("t/Makefile.am"), inplace=True) as f: + for line in f: + if line.startswith("EXTRA_DIST "): + in_extra_dist = True + elif in_extra_dist: + if line.startswith("\t"): + line = line.strip() + if not line.endswith("\\"): + line += " \\" + extra_dist_lines.add(line) + continue + extra_dist_lines.add("%s \\" % testfile) + sys.stdout.write("\t") + print("\n\t".join(sorted(extra_dist_lines))[:-2]) + in_extra_dist = False + sys.stdout.write(line) + + +if __name__ == "__main__": + main() From 5f4f529ed3755a682e999d93f87dc5ac518ab51f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 8 Mar 2019 22:16:46 +0200 Subject: [PATCH 0050/1094] xfreerdp: reinstate support for old versions with dash option syntax --- completions/xfreerdp | 36 +++++++++++++++++++++++++++++++----- test/t/test_xfreerdp.py | 29 ++++++++++++++++++++++++++--- 2 files changed, 57 insertions(+), 8 deletions(-) diff --git a/completions/xfreerdp b/completions/xfreerdp index cc4f55e62e0..df0cebf3fab 100644 --- a/completions/xfreerdp +++ b/completions/xfreerdp @@ -5,7 +5,27 @@ _xfreerdp() local cur prev words cword _init_completion -n : || return - case $cur in + case $prev in # old/dash syntax + -k) + COMPREPLY=( $( compgen -W '$( "$1" --kbd-list | + awk "/^0x/ { print \$1 }" )' -- "$cur" ) ) + return + ;; + -a) + COMPREPLY=( $( compgen -W '8 15 16 24 32' -- "$cur" ) ) + return + ;; + -x) + COMPREPLY=( $( compgen -W 'broadband modem lan' -- "$cur" ) ) + return + ;; + --plugin) + COMPREPLY=( $( compgen -W 'cliprdr rdpsnd rdpdr' -- "$cur" ) ) + return + ;; + esac + + case $cur in # new/slash syntax /kbd:*) COMPREPLY=( $( compgen -W '$( "$1" /kbd-list | awk "/^0x/ { print \$1 }" )' -- "${cur#/kbd:}" ) ) @@ -15,7 +35,7 @@ _xfreerdp() COMPREPLY=( $( compgen -W '8 15 16 24 32' -- "${cur#/bpp:}" ) ) return ;; - /*:*|/help|/version) + /*:*|/help|/version|-h|--help|--version) return ;; esac @@ -27,9 +47,15 @@ _xfreerdp() [[ $COMPREPLY == *: ]] && compopt -o nospace elif [[ "$cur" == [+-]* ]]; then local char=${cur:0:1} - COMPREPLY=( $( compgen -W '$( "$1" --help | - awk "\$1 ~ /^[+-]/ && \$1 !~ /^.toggle\$/ { sub(\"^.\",\"$char\",\$1); print \$1 }" )' \ - -- "$cur" ) ) + local help="$( $1 --help )" + if [[ "$help" == */help* ]]; then # new/slash syntax + COMPREPLY=( $( compgen -W '$( awk " + \$1 ~ /^[+-]/ && \$1 !~ /^.toggle\$/ { sub(\"^.\",\"$char\",\$1); print \$1 } + " <<<"$help" )' -- "$cur" ) ) + else # old/dash syntax + COMPREPLY=( $( _parse_help - <<<"$help" ) ) + COMPREPLY=( $( compgen -W '${COMPREPLY[@]%:}' -- "$cur" ) ) + fi else COMPREPLY=( $( compgen -W "$(awk '{print $1}' ~/.freerdp/known_hosts \ 2>/dev/null)" -- "$cur" ) ) diff --git a/test/t/test_xfreerdp.py b/test/t/test_xfreerdp.py index 06165155cb7..6bb85491c93 100644 --- a/test/t/test_xfreerdp.py +++ b/test/t/test_xfreerdp.py @@ -1,10 +1,25 @@ import pytest +from conftest import assert_bash_exec + class TestXfreerdp: + def _help(self, bash): + return assert_bash_exec(bash, "xfreerdp --help || :", want_output=True) + + @pytest.fixture(scope="class") + def slash_syntax(self, bash): + if "/help" not in self._help(bash): + pytest.skip("Not slash syntax") + + @pytest.fixture(scope="class") + def dash_syntax(self, bash): + if "/help" in self._help(bash): + pytest.skip("Not dash syntax") + @pytest.mark.complete("xfreerdp /") - def test_1(self, completion): + def test_1(self, bash, completion, slash_syntax): assert completion @pytest.mark.complete("xfreerdp -") @@ -12,13 +27,21 @@ def test_2(self, completion): assert completion @pytest.mark.complete("xfreerdp +") - def test_3(self, completion): + def test_3(self, bash, completion, slash_syntax): assert completion @pytest.mark.complete("xfreerdp /kbd:") - def test_4(self, completion): + def test_4(self, bash, completion, slash_syntax): assert completion @pytest.mark.complete("xfreerdp /help ") def test_5(self, completion): assert not completion + + @pytest.mark.complete("xfreerdp -k ") + def test_6(self, bash, completion, dash_syntax): + assert completion + + @pytest.mark.complete("xfreerdp --help ") + def test_7(self, completion): + assert not completion From 2515f726bd7195d8c80fdc8442fbd48bffe7398a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 8 Mar 2019 22:20:31 +0200 Subject: [PATCH 0051/1094] test: remove no longer needed completion/*.exp --- test/completion/man.exp | 1 - test/completion/tar.exp | 1 - test/completion/xfreerdp.exp | 1 - 3 files changed, 3 deletions(-) delete mode 100644 test/completion/man.exp delete mode 100644 test/completion/tar.exp delete mode 100644 test/completion/xfreerdp.exp diff --git a/test/completion/man.exp b/test/completion/man.exp deleted file mode 100644 index 7bae8c030b6..00000000000 --- a/test/completion/man.exp +++ /dev/null @@ -1 +0,0 @@ -assert_source_completions man diff --git a/test/completion/tar.exp b/test/completion/tar.exp deleted file mode 100644 index 4a309863865..00000000000 --- a/test/completion/tar.exp +++ /dev/null @@ -1 +0,0 @@ -assert_source_completions tar diff --git a/test/completion/xfreerdp.exp b/test/completion/xfreerdp.exp deleted file mode 100644 index 5ca649a2868..00000000000 --- a/test/completion/xfreerdp.exp +++ /dev/null @@ -1 +0,0 @@ -assert_source_completions xfreerdp From 1ea87c99707fdc40c956560220e5a49d9e376383 Mon Sep 17 00:00:00 2001 From: Kevin Locke Date: Thu, 7 Mar 2019 10:13:44 -0700 Subject: [PATCH 0052/1094] test: avoid interrupting magic mark output The same race condition as 85275cf5 exists for multiple completions (case 0). If the magic mark is not included in `expect()`, it may or may not have been written by bash at the point `bash.sendintr()` is called. If the interrupt is delivered before magic mark has finished printing, it can corrupt the prompt and cause `bash.expect_exact(PS1)` to timeout. Include `MAGIC_MARK` in the case 0 regex to avoid this issue. Signed-off-by: Kevin Locke --- test/t/conftest.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/t/conftest.py b/test/t/conftest.py index 03ef20c3d1e..dd0e72c4d42 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -357,9 +357,12 @@ def assert_complete( bash.expect_exact(cmd) bash.send(MAGIC_MARK) got = bash.expect([ - r"\r\n" + re.escape(PS1 + cmd), # 0: multiple lines, result in .before - r"^" + MAGIC_MARK, # 1: no completion - r"^([^\r]+)%s$" % MAGIC_MARK, # 2: on same line, result in .match + # 0: multiple lines, result in .before + r"\r\n" + re.escape(PS1 + cmd) + ".*" + MAGIC_MARK, + # 1: no completion + r"^" + MAGIC_MARK, + # 2: on same line, result in .match + r"^([^\r]+)%s$" % MAGIC_MARK, pexpect.EOF, pexpect.TIMEOUT, ]) From b01cfe1a4fed490ef1705f5c52e3c93e5187da49 Mon Sep 17 00:00:00 2001 From: Kevin Locke Date: Thu, 7 Mar 2019 15:14:23 -0700 Subject: [PATCH 0053/1094] test: Increase expect pty to 160 columns Bash wraps lines based on the size of the pseudo-terminal used by expect. If a completed command + magic mark is longer than 80-${#PS1} characters it will insert "\r\n" (and usually several spaces and backspaces) at the wrap point which can corrupt the magic mark. Ideally, wrapping would either be avoided in all cases or handled robustly by expect in all cases, but since this is no easy task, increase the number of columns to reduce wrapping in common cases. Signed-off-by: Kevin Locke --- test/t/conftest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/t/conftest.py b/test/t/conftest.py index dd0e72c4d42..18c1badca5c 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -93,7 +93,6 @@ def bash(request) -> pexpect.spawn: BASH_COMPLETION_COMPAT_DIR="%s/fixtures/shared/empty_dir" % testdir, LC_COLLATE="C", # to match Python's default locale unaware sort )) - # TODO set stty_init "columns 150" --> dimensions? needed in first place? fixturesdir = os.path.join(testdir, "fixtures") os.chdir(fixturesdir) @@ -106,6 +105,10 @@ def bash(request) -> pexpect.spawn: cwd=fixturesdir, env=env, encoding="utf-8", # TODO? or native or...? + # FIXME: Tests shouldn't depend on dimensions, but it's difficult to + # expect robustly enough for Bash to wrap lines anywhere (e.g. inside + # MAGIC_MARK). Increase window width to reduce wrapping. + dimensions=(24, 160), # TODO? codec_errors="replace", ) bash.expect_exact(PS1) From 141e5e663789aa2243a0aa23c1bbe0b8c620e991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 9 Mar 2019 08:49:06 +0200 Subject: [PATCH 0054/1094] pytest: complete pytest-xdist --dist, --numprocesses, and --rsyncdir --- completions/pytest | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/completions/pytest b/completions/pytest index 76a1c1189bd..99fddd7e955 100644 --- a/completions/pytest +++ b/completions/pytest @@ -42,7 +42,7 @@ _pytest() _filedir return ;; - --confcutdir|--basetemp) + --confcutdir|--basetemp|--rsyncdir) _filedir -d return ;; @@ -54,6 +54,17 @@ _pytest() _filedir py return ;; + --numprocesses|-!(-*)n) + COMPREPLY=( $( compgen -W "{1..$(_ncpus)} auto" -- "$cur" ) ) + return + ;; + --dist) + local modes=$( "$1" --dist=nonexistent-distmode 2>&1 | \ + command sed -e 's/[^[:space:][:alnum:]-]\{1,\}//g' \ + -ne 's/.*choose from //p' ) + COMPREPLY=( $( compgen -W '$modes' -- "$cur" ) ) + return + ;; esac $split && return From 51aa5c3588fc22a3fef1313f5ed51cdce1c6a7f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 9 Mar 2019 09:39:26 +0200 Subject: [PATCH 0055/1094] post-commit: trigger on test/requirements.txt too --- extra/git-post-commit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extra/git-post-commit.sh b/extra/git-post-commit.sh index f2cf899a6cd..182385858ca 100755 --- a/extra/git-post-commit.sh +++ b/extra/git-post-commit.sh @@ -13,7 +13,7 @@ url=$(git config bash-completion.docker-hub-trigger-url) test "$(git symbolic-ref --short HEAD 2>/dev/null)" = master git diff-tree -r --name-only --no-commit-id HEAD | \ - grep -qxF completions/Makefile.am + grep -qxE 'completions/Makefile\.am|test/requirements\.txt' curl \ --silent --show-error \ From eabce5b598b98489a831d44ec3e94b29e57926a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 9 Mar 2019 09:44:26 +0200 Subject: [PATCH 0056/1094] test: add dependency on pytest-xdist --- test/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/test/requirements.txt b/test/requirements.txt index 7cf37310e11..dbe5bb1c86c 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -1,3 +1,4 @@ pexpect>=4 pytest>=3.5 +pytest-xdist typing;python_version<"3.5" From 7ab7a9bd418134b6c83d57f538dc5674b930e9a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 9 Mar 2019 11:13:35 +0200 Subject: [PATCH 0057/1094] extra: add git pre-push hook for triggering Docker Hub builds This isn't that good either as the resulting CI run will end up running before the new image builds are finished. But it's better than a post-commit hook which will almost certainly trigger a build without the desired new changes present in the repo. --- extra/git-pre-push.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 extra/git-pre-push.sh diff --git a/extra/git-pre-push.sh b/extra/git-pre-push.sh new file mode 100755 index 00000000000..27de6013e49 --- /dev/null +++ b/extra/git-pre-push.sh @@ -0,0 +1,41 @@ +#!/bin/sh -e + +# Pre-push hook for triggering bash-completion Docker Hub test image +# builds at https://hub.docker.com/r/vskytta/bash-completion/ +# +# To enable: ln -s ../../extra/git-pre-push.sh .git/hooks/pre-push +# +# The bash-completion.docker-hub-trigger-url config option must be set to +# the full Docker Hub build trigger URL to hit. + +url=$(git config bash-completion.docker-hub-trigger-url) || exit 0 + +branch=master +files="completions/Makefile\.am|test/requirements\.txt" + +trigger=false +z40=0000000000000000000000000000000000000000 + +while read local_ref local_sha remote_ref remote_sha; do + case $remote_ref in */$branch) ;; *) continue ;; esac + [ $local_sha != $z40 ] || continue # delete not handled (yet?) + if [ $remote_sha = $z40 ]; then + list_files="git ls-tree -r --name-only $local_sha" + else + list_files="git diff --name-only $remote_sha..$local_sha" + fi + ! $list_files | grep -qEx $files || { trigger=true; break; } +done + +if $trigger; then + cat <&1 \ + | logger -e --tag bash-completion-pre-push +EOF +fi From 0087574d5d130529c46d6c6a0b274439df652204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 9 Mar 2019 09:10:39 +0200 Subject: [PATCH 0058/1094] test: use pytest-xdist --- test/docker/docker-script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/docker/docker-script.sh b/test/docker/docker-script.sh index 9736a47dc83..35d89d63a64 100755 --- a/test/docker/docker-script.sh +++ b/test/docker/docker-script.sh @@ -30,7 +30,7 @@ case $DIST in esac cd test -xvfb-run $PYTEST t +xvfb-run $PYTEST --numprocesses=${PYTEST_NUMPROCESSES:-auto} --dist=loadfile t xvfb-run ./runCompletion --all --verbose ./runInstall --verbose --all --verbose ./runUnit --all --verbose From fb0bb6086864835d5bc71dfb1b43636767120267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 10 Mar 2019 12:02:28 +0200 Subject: [PATCH 0059/1094] python: make warning action list reusable --- completions/python | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/completions/python b/completions/python index c8939bf21f6..5307fbb2d68 100644 --- a/completions/python +++ b/completions/python @@ -7,6 +7,12 @@ _python_modules() 2>/dev/null )" -- "$cur" ) ) } +_python_warning_actions() +{ + COMPREPLY+=( $( compgen -W "ignore default all module once error" \ + ${prefix:+-P "$prefix"} -- "$cur" ) ) +} + _python() { local cur prev words cword prefix @@ -34,8 +40,7 @@ _python() return ;; -!(-*)W) - COMPREPLY=( $( compgen -W "ignore default all module once error" \ - -P "$prefix" -- "$cur" ) ) + _python_warning_actions return ;; --jit) From 6fad7d8f411e734004a4f9b893dd32c266ed156f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 10 Mar 2019 12:02:44 +0200 Subject: [PATCH 0060/1094] pytest: complete --pythonwarnings/-W arg --- completions/pytest | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/completions/pytest b/completions/pytest index 99fddd7e955..a53dad6054c 100644 --- a/completions/pytest +++ b/completions/pytest @@ -54,6 +54,10 @@ _pytest() _filedir py return ;; + --pythonwarnings|-!(-*)W) + _xfunc python _python_warning_actions + return + ;; --numprocesses|-!(-*)n) COMPREPLY=( $( compgen -W "{1..$(_ncpus)} auto" -- "$cur" ) ) return From 95ae4bbb17bb1ace29c4222fc7841ab69df23237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 11 Mar 2019 21:22:23 +0200 Subject: [PATCH 0061/1094] copyright: add 2019 --- bash_completion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_completion b/bash_completion index e01e33a1f88..a2f0a74d922 100644 --- a/bash_completion +++ b/bash_completion @@ -3,7 +3,7 @@ # bash_completion - programmable completion functions for bash 4.1+ # # Copyright © 2006-2008, Ian Macdonald -# © 2009-2018, Bash Completion Maintainers +# © 2009-2019, Bash Completion Maintainers # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by From dd80f35279afd4f056dc191767b9869c9649d476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 11 Mar 2019 21:26:24 +0200 Subject: [PATCH 0062/1094] _longopt: don't complete --no-* with file/dirname arg Closes https://github.com/scop/bash-completion/pull/291 Thanks-to: Gabriel F. T. Gomes --- bash_completion | 4 ++-- test/t/test_grep.py | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bash_completion b/bash_completion index a2f0a74d922..d35858ec8cf 100644 --- a/bash_completion +++ b/bash_completion @@ -1850,11 +1850,11 @@ _longopt() --help|--usage|--version) return ;; - --*dir*) + --!(no-*)dir*) _filedir -d return ;; - --*file*|--*path*) + --!(no-*)@(file|path)*) _filedir return ;; diff --git a/test/t/test_grep.py b/test/t/test_grep.py index 64d325569e3..2518de75f8c 100644 --- a/test/t/test_grep.py +++ b/test/t/test_grep.py @@ -6,3 +6,12 @@ class TestGrep: @pytest.mark.complete("grep --") def test_1(self, completion): assert completion + + @pytest.mark.complete("grep --no-complete-dir f", cwd="shared/default") + def test_2(self, completion): + """ + Test --no-*dir isn't restricted to dirs only. + + Not really a grep option, but tests _longopt. + """ + assert completion == "foo foo.d/".split() From 80ba367c4e62c63927b2ffe6884ed9756ace5195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 20 Mar 2019 06:53:59 +0200 Subject: [PATCH 0063/1094] nsupdate: new completion --- completions/Makefile.am | 1 + completions/nsupdate | 40 ++++++++++++++++++++++++++++++++++++++++ test/t/Makefile.am | 1 + test/t/test_nsupdate.py | 12 ++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 completions/nsupdate create mode 100644 test/t/test_nsupdate.py diff --git a/completions/Makefile.am b/completions/Makefile.am index 05b154dd123..08c92a04756 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -276,6 +276,7 @@ bashcomp_DATA = 2to3 \ _nmcli \ nproc \ nslookup \ + nsupdate \ ntpdate \ oggdec \ op \ diff --git a/completions/nsupdate b/completions/nsupdate new file mode 100644 index 00000000000..d021373d46a --- /dev/null +++ b/completions/nsupdate @@ -0,0 +1,40 @@ +# bash completion for nsupdate(1) -*- shell-script -*- + +_nsupdate() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -*[VLprtu]) + return + ;; + -*k) + _filedir key + return + ;; + -*R) + cur=${cur:=/dev/} + _filedir + return + ;; + -*y) + if [[ $cur == h* ]]; then + COMPREPLY=( $( compgen -W "hmac-{md5,sha{1,224,256,384,512}}" \ + -S : -- "$cur" ) ) + [[ $COMPREPLY == *: ]] && compopt -o nospace + fi + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + return + fi + + _filedir +} && +complete -F _nsupdate nsupdate + +# ex: filetype=sh diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 467b8df49ec..4689cce7611 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -396,6 +396,7 @@ EXTRA_DIST = \ test_nmcli.py \ test_nproc.py \ test_nslookup.py \ + test_nsupdate.py \ test_ntpdate.py \ test_objcopy.py \ test_objdump.py \ diff --git a/test/t/test_nsupdate.py b/test/t/test_nsupdate.py new file mode 100644 index 00000000000..0fe43608ad3 --- /dev/null +++ b/test/t/test_nsupdate.py @@ -0,0 +1,12 @@ +import pytest + + +class TestNsupdate: + + @pytest.mark.complete("nsupdate ") + def test_1(self, completion): + assert completion + + @pytest.mark.complete("nsupdate -") + def test_2(self, completion): + assert completion From 54abb2e3c495e6732af6546b0fe41e0a5cd6922f Mon Sep 17 00:00:00 2001 From: Tomasz N Date: Thu, 21 Mar 2019 20:26:43 +0100 Subject: [PATCH 0064/1094] _longopt: pick first long option on a line, not last Makes sense, and consistent with _parse_help. Closes #286 --- bash_completion | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bash_completion b/bash_completion index d35858ec8cf..5ac26c15001 100644 --- a/bash_completion +++ b/bash_completion @@ -1878,7 +1878,8 @@ _longopt() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W "$( LC_ALL=C $1 --help 2>&1 | \ - command sed -ne 's/.*\(--[-A-Za-z0-9]\{1,\}=\{0,1\}\).*/\1/p' | sort -u )" \ + while read -r line; do [[ "$line" =~ --[-A-Za-z0-9]{1,}={0,1} ]] && echo "${BASH_REMATCH[0]}"; done | \ + sort -u )" \ -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace elif [[ "$1" == @(rmdir|chroot) ]]; then From c1ec2e1b00913d9dc38e5dcf52bfbea4a2a9eff8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 21 Mar 2019 21:34:36 +0200 Subject: [PATCH 0065/1094] _longopt: simplify regex, use printf instead of echo, drop unnecessary sort --- bash_completion | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bash_completion b/bash_completion index 5ac26c15001..609abe87c81 100644 --- a/bash_completion +++ b/bash_completion @@ -1878,9 +1878,10 @@ _longopt() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W "$( LC_ALL=C $1 --help 2>&1 | \ - while read -r line; do [[ "$line" =~ --[-A-Za-z0-9]{1,}={0,1} ]] && echo "${BASH_REMATCH[0]}"; done | \ - sort -u )" \ - -- "$cur" ) ) + while read -r line; do \ + [[ $line =~ --[-A-Za-z0-9]+=? ]] && \ + printf '%s\n' ${BASH_REMATCH[0]} + done )" -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace elif [[ "$1" == @(rmdir|chroot) ]]; then _filedir -d From 6fdb0e2c3e47125ce29c2de0929d893452c2f595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 21 Mar 2019 21:37:10 +0200 Subject: [PATCH 0066/1094] test: add some _longopt unit tests --- test/fixtures/_longopt/grep--help.txt | 70 +++++++++++++++++++++++++++ test/t/unit/test_unit_longopt.py | 35 ++++++++++++++ 2 files changed, 105 insertions(+) create mode 100644 test/fixtures/_longopt/grep--help.txt create mode 100644 test/t/unit/test_unit_longopt.py diff --git a/test/fixtures/_longopt/grep--help.txt b/test/fixtures/_longopt/grep--help.txt new file mode 100644 index 00000000000..9266256321e --- /dev/null +++ b/test/fixtures/_longopt/grep--help.txt @@ -0,0 +1,70 @@ +Usage: grep [OPTION]... PATTERN [FILE]... +Search for PATTERN in each FILE. +Example: grep -i 'hello world' menu.h main.c + +Pattern selection and interpretation: + -E, --extended-regexp PATTERN is an extended regular expression + -F, --fixed-strings PATTERN is a set of newline-separated strings + -G, --basic-regexp PATTERN is a basic regular expression (default) + -P, --perl-regexp PATTERN is a Perl regular expression + -e, --regexp=PATTERN use PATTERN for matching + -f, --file=FILE obtain PATTERN from FILE + -i, --ignore-case ignore case distinctions + -w, --word-regexp force PATTERN to match only whole words + -x, --line-regexp force PATTERN to match only whole lines + -z, --null-data a data line ends in 0 byte, not newline + +Miscellaneous: + -s, --no-messages suppress error messages + -v, --invert-match select non-matching lines + -V, --version display version information and exit + --help display this help text and exit + +Output control: + -m, --max-count=NUM stop after NUM selected lines + -b, --byte-offset print the byte offset with output lines + -n, --line-number print line number with output lines + --line-buffered flush output on every line + -H, --with-filename print file name with output lines + -h, --no-filename suppress the file name prefix on output + --label=LABEL use LABEL as the standard input file name prefix + -o, --only-matching show only the part of a line matching PATTERN + -q, --quiet, --silent suppress all normal output + --binary-files=TYPE assume that binary files are TYPE; + TYPE is 'binary', 'text', or 'without-match' + -a, --text equivalent to --binary-files=text + -I equivalent to --binary-files=without-match + -d, --directories=ACTION how to handle directories; + ACTION is 'read', 'recurse', or 'skip' + -D, --devices=ACTION how to handle devices, FIFOs and sockets; + ACTION is 'read' or 'skip' + -r, --recursive like --directories=recurse + -R, --dereference-recursive likewise, but follow all symlinks + --include=FILE_PATTERN search only files that match FILE_PATTERN + --exclude=FILE_PATTERN skip files and directories matching FILE_PATTERN + --exclude-from=FILE skip files matching any file pattern from FILE + --exclude-dir=PATTERN directories that match PATTERN will be skipped. + -L, --files-without-match print only names of FILEs with no selected lines + -l, --files-with-matches print only names of FILEs with selected lines + -c, --count print only a count of selected lines per FILE + -T, --initial-tab make tabs line up (if needed) + -Z, --null print 0 byte after FILE name + +Context control: + -B, --before-context=NUM print NUM lines of leading context + -A, --after-context=NUM print NUM lines of trailing context + -C, --context=NUM print NUM lines of output context + -NUM same as --context=NUM + --color[=WHEN], + --colour[=WHEN] use markers to highlight the matching strings; + WHEN is 'always', 'never', or 'auto' + -U, --binary do not strip CR characters at EOL (MSDOS/Windows) + +When FILE is '-', read standard input. With no FILE, read '.' if +recursive, '-' otherwise. With fewer than two FILEs, assume -h. +Exit status is 0 if any line is selected, 1 otherwise; +if any error occurs and -q is not given, the exit status is 2. + +Report bugs to: bug-grep@gnu.org +GNU grep home page: +General help using GNU software: diff --git a/test/t/unit/test_unit_longopt.py b/test/t/unit/test_unit_longopt.py new file mode 100644 index 00000000000..94eb499d6d5 --- /dev/null +++ b/test/t/unit/test_unit_longopt.py @@ -0,0 +1,35 @@ +# Based on work by Stephen Gildea, October 2010. + +import pytest + +from conftest import assert_bash_exec + + +@pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+COMPREPLY=") +class TestUnitLongopt: + + @pytest.fixture(scope="class") + def functions(self, request, bash): + assert_bash_exec(bash, + "_grephelp() { cat _longopt/grep--help.txt; }") + assert_bash_exec(bash, "complete -F _longopt _grephelp") + + @pytest.mark.complete("_grephelp --") + def test_1(self, functions, completion): + """First long option should be included""" + assert completion + assert all(x in completion + for x in "--quiet --recursive --text".split()) + + @pytest.mark.complete("_grephelp -") + def test_2(self, functions, completion): + """Only long options should be included""" + assert completion + assert all(x.startswith("--") for x in completion) + + @pytest.mark.complete("_grephelp --") + def test_3(self, functions, completion): + """Should have both ones ending with a = and ones not""" + assert completion + assert any(x.endswith("=") for x in completion) + assert any(not x.endswith("=") for x in completion) From 4a73043f46be3f939c857f04673a659d8d10b0ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 21 Mar 2019 21:50:12 +0200 Subject: [PATCH 0067/1094] test: include test_unit_longopt.py in dist --- test/t/unit/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/test/t/unit/Makefile.am b/test/t/unit/Makefile.am index ca5dbcc4ad1..a0ab750231f 100644 --- a/test/t/unit/Makefile.am +++ b/test/t/unit/Makefile.am @@ -8,6 +8,7 @@ EXTRA_DIST = \ test_unit_get_cword.py \ test_unit_init_completion.py \ test_unit_ip_addresses.py \ + test_unit_longopt.py \ test_unit_parse_help.py \ test_unit_parse_usage.py \ test_unit_tilde.py From 12d589e705ccf8a44d4ce158c1c1c9885dce71ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 24 Mar 2019 14:54:24 +0200 Subject: [PATCH 0068/1094] modprobe: append = to module parameter completions --- completions/modprobe | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/completions/modprobe b/completions/modprobe index db23240cb18..6f188f1254b 100644 --- a/completions/modprobe +++ b/completions/modprobe @@ -83,9 +83,10 @@ _modprobe() _filedir '@(?(k)o?(.gz))' elif [[ -n "$module" ]]; then # do module parameter completion - COMPREPLY=( $( compgen -W "$( PATH="$PATH:/sbin" modinfo \ + COMPREPLY=( $( compgen -S = -W "$( PATH="$PATH:/sbin" modinfo \ -p "$module" 2>/dev/null | \ awk -F: '!/^[ \t]/ { print $1 }' )" -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace else _modules $version if [[ $COMPREPLY ]]; then From 6e008e200b700a303059a8c9658d3bcc79c11f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 9 Apr 2019 09:19:09 +0300 Subject: [PATCH 0069/1094] dnssec-keygen: new completion --- completions/Makefile.am | 1 + completions/dnssec-keygen | 48 ++++++++++++++ test/fixtures/dnssec-keygen/dnssec-keygen | 76 ++++++++++++++++++++++ test/t/Makefile.am | 1 + test/t/test_dnssec_keygen.py | 78 +++++++++++++++++++++++ 5 files changed, 204 insertions(+) create mode 100644 completions/dnssec-keygen create mode 100755 test/fixtures/dnssec-keygen/dnssec-keygen create mode 100644 test/t/test_dnssec_keygen.py diff --git a/completions/Makefile.am b/completions/Makefile.am index 08c92a04756..693155bfe45 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -79,6 +79,7 @@ bashcomp_DATA = 2to3 \ dhclient \ dict \ _dmesg \ + dnssec-keygen \ dnsspoof \ dot \ dpkg \ diff --git a/completions/dnssec-keygen b/completions/dnssec-keygen new file mode 100644 index 00000000000..ec7b411c539 --- /dev/null +++ b/completions/dnssec-keygen @@ -0,0 +1,48 @@ +# bash completion for dnssec-keygen(8) -*- shell-script -*- + +_dnssec_keygen_optarg() +{ + local args=$( "$1" -h 2>&1 | \ + command sed -e 's/|/ /g' -e 's/(.*//' \ + -ne '/^[[:space:]]*'$2'/,/^[[:space:]]*[(-]/p' | \ + command sed -e 's/^[[:space:]]*'$2'.*://' -e '/^[[:space:]]*-/d' ) + COMPREPLY+=( $( compgen -W '$args' -- "$cur" ) ) +} + +_dnssec_keygen() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -[hbEgLpsPARIDSi]) + return + ;; + -K) + _filedir -d + return + ;; + -[ancdfTtm]) + _dnssec_keygen_optarg "$1" $prev + return + ;; + -r) + cur=${cur:=/dev/} + _filedir + return + ;; + -v) + COMPREPLY=( $( compgen -W '{0..10}' -- "$cur" ) ) + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" | \ + command sed -e "s/:\$//" )' -- "$cur" ) ) + return + fi +} && +complete -F _dnssec_keygen dnssec-keygen + +# ex: filetype=sh diff --git a/test/fixtures/dnssec-keygen/dnssec-keygen b/test/fixtures/dnssec-keygen/dnssec-keygen new file mode 100755 index 00000000000..882cd97c975 --- /dev/null +++ b/test/fixtures/dnssec-keygen/dnssec-keygen @@ -0,0 +1,76 @@ +#!/bin/sh + +cat <<\EOF >&2 +Usage: + dnssec-keygen [options] name + +Version: 9.11.3-1ubuntu1.5-Ubuntu + name: owner of the key +Options: + -K : write keys into directory + -a : + RSA | RSAMD5 | DSA | RSASHA1 | NSEC3RSASHA1 | NSEC3DSA | + RSASHA256 | RSASHA512 | ECCGOST | + ECDSAP256SHA256 | ECDSAP384SHA384 | + ED25519 | ED448 | DH | + HMAC-MD5 | HMAC-SHA1 | HMAC-SHA224 | HMAC-SHA256 | + HMAC-SHA384 | HMAC-SHA512 + (default: RSASHA1, or NSEC3RSASHA1 if using -3) + -3: use NSEC3-capable algorithm + -b : + RSAMD5: [512..4096] + RSASHA1: [512..4096] + NSEC3RSASHA1: [512..4096] + RSASHA256: [512..4096] + RSASHA512: [1024..4096] + DH: [128..4096] + DSA: [512..1024] and divisible by 64 + NSEC3DSA: [512..1024] and divisible by 64 + ECCGOST: ignored + ECDSAP256SHA256: ignored + ECDSAP384SHA384: ignored + ED25519: ignored + ED448: ignored + HMAC-MD5: [1..512] + HMAC-SHA1: [1..160] + HMAC-SHA224: [1..224] + HMAC-SHA256: [1..256] + HMAC-SHA384: [1..384] + HMAC-SHA512: [1..512] + (if using the default algorithm, key size + defaults to 2048 for KSK, or 1024 for all others) + -n : ZONE | HOST | ENTITY | USER | OTHER + (DNSKEY generation defaults to ZONE) + -c : (default: IN) + -d (0 => max, default) + -E : + name of an OpenSSL engine to use + -f : KSK | REVOKE + -g : use specified generator (DH only) + -L : default key TTL + -p : (default: 3 [dnssec]) + -r : a file containing random data + -s : strength value this key signs DNS records with (default: 0) + -T : DNSKEY | KEY (default: DNSKEY; use KEY for SIG(0)) + -t : AUTHCONF | NOAUTHCONF | NOAUTH | NOCONF (default: AUTHCONF) + -h: print usage and exit + -m : + usage | trace | record | size | mctx + -v : set verbosity level (0 - 10) + -V: print version information +Timing options: + -P date/[+-]offset/none: set key publication date (default: now) + -P sync date/[+-]offset/none: set CDS and CDNSKEY publication date + -A date/[+-]offset/none: set key activation date (default: now) + -R date/[+-]offset/none: set key revocation date + -I date/[+-]offset/none: set key inactivation date + -D date/[+-]offset/none: set key deletion date + -D sync date/[+-]offset/none: set CDS and CDNSKEY deletion date + -G: generate key only; do not set -P or -A + -C: generate a backward-compatible key, omitting all dates + -S : generate a successor to an existing key + -i : prepublication interval for successor key (default: 30 days) +Output: + K++.key, K++.private +EOF +exit 255 diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 4689cce7611..d5598cdaa40 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -122,6 +122,7 @@ EXTRA_DIST = \ test_dir.py \ test_display.py \ test_dmesg.py \ + test_dnssec_keygen.py \ test_dnsspoof.py \ test_dot.py \ test_dpkg.py \ diff --git a/test/t/test_dnssec_keygen.py b/test/t/test_dnssec_keygen.py new file mode 100644 index 00000000000..c60a3a3a952 --- /dev/null +++ b/test/t/test_dnssec_keygen.py @@ -0,0 +1,78 @@ +import pytest + + +@pytest.mark.bashcomp( + cmd="dnssec-keygen", + pre_cmds=( + "PATH=$PATH:$PWD/dnssec-keygen", + ), +) +class TestDnssecKeygen: + + @pytest.mark.complete("dnssec-keygen -") + def test_1(self, completion): + assert completion + assert not any(x.endswith(":") for x in completion) + + @pytest.mark.complete("dnssec-keygen -a ") + def test_2(self, completion): + assert completion + assert "HMAC-MD5" in completion + assert "|" not in completion + assert not any(x.startswith("-") for x in completion) + + @pytest.mark.complete("dnssec-keygen -n ") + def test_3(self, completion): + assert completion + assert "HOST" in completion + assert "|" not in completion + assert not any(x.startswith("-") for x in completion) + + @pytest.mark.complete("dnssec-keygen -f ") + def test_4(self, completion): + assert completion + assert "|" not in completion + assert not any(x.startswith("-") for x in completion) + + @pytest.mark.complete("dnssec-keygen ") + def test_5(self, completion): + assert not completion + + @pytest.mark.complete("dnssec-keygen -a ", + env=dict(PATH="$PWD/dnssec-keygen:$PATH")) + def test_6(self, completion): + assert completion == sorted( + "RSA RSAMD5 DSA RSASHA1 NSEC3RSASHA1 NSEC3DSA " + "RSASHA256 RSASHA512 ECCGOST " + "ECDSAP256SHA256 ECDSAP384SHA384 " + "ED25519 ED448 DH " + "HMAC-MD5 HMAC-SHA1 HMAC-SHA224 HMAC-SHA256 " + "HMAC-SHA384 HMAC-SHA512" + .split()) + + @pytest.mark.complete("dnssec-keygen -n ", + env=dict(PATH="$PWD/dnssec-keygen:$PATH")) + def test_7(self, completion): + assert completion == sorted("ZONE HOST ENTITY USER OTHER".split()) + + @pytest.mark.complete("dnssec-keygen -f ", + env=dict(PATH="$PWD/dnssec-keygen:$PATH")) + def test_8(self, completion): + assert completion == sorted("KSK REVOKE".split()) + + @pytest.mark.complete("dnssec-keygen -T ", + env=dict(PATH="$PWD/dnssec-keygen:$PATH")) + def test_9(self, completion): + assert completion == sorted("DNSKEY KEY".split()) + + @pytest.mark.complete("dnssec-keygen -t ", + env=dict(PATH="$PWD/dnssec-keygen:$PATH")) + def test_10(self, completion): + assert completion == sorted( + "AUTHCONF NOAUTHCONF NOAUTH NOCONF".split()) + + @pytest.mark.complete("dnssec-keygen -m ", + env=dict(PATH="$PWD/dnssec-keygen:$PATH")) + def test_11(self, completion): + assert completion == sorted( + "usage trace record size mctx".split()) From fd37d6f506013a42d35841b88d19851f192cf4ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 14 Apr 2019 11:46:35 +0300 Subject: [PATCH 0070/1094] shellcheck: new completion --- completions/Makefile.am | 1 + completions/shellcheck | 51 +++++++++++++++++++++++++++++++++++++++ test/t/Makefile.am | 1 + test/t/test_shellcheck.py | 20 +++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 completions/shellcheck create mode 100644 test/t/test_shellcheck.py diff --git a/completions/Makefile.am b/completions/Makefile.am index 693155bfe45..a17830036a7 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -367,6 +367,7 @@ bashcomp_DATA = 2to3 \ screen \ scrub \ sh \ + shellcheck \ sitecopy \ slackpkg \ slapt-get \ diff --git a/completions/shellcheck b/completions/shellcheck new file mode 100644 index 00000000000..027c57681eb --- /dev/null +++ b/completions/shellcheck @@ -0,0 +1,51 @@ +# bash completion for shellcheck(1) -*- shell-script -*- + +_shellcheck_optarg() +{ + local args=$( "$1" --help 2>&1 | \ + command sed -e 's/,/ /g' -ne 's/^.*'$2'\>.*(\([^)]*\)).*/\1/p' ) + COMPREPLY+=( $( compgen -W '$args' -- "$cur" ) ) +} + +_shellcheck() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + --version|-!(-*)V*) + return + ;; + --exclude|-!(-*)e) + return + ;; + --format|-!(-*)f) + local args=$( "$1" --format=nonexistent-format /dev/null 2>&1 | \ + command sed -ne '/^Supported formats/,//p' | \ + command sed -ne '/^[[:space:]]/p' ) + COMPREPLY=( $( compgen -W '$args' -- "$cur" ) ) + return + ;; + --color|-!(-*)C) + _shellcheck_optarg "$1" --color + return + ;; + --shell|-!(-*)s) + _shellcheck_optarg "$1" --shell + return + ;; + esac + + $split && return + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi + + _filedir +} && +complete -F _shellcheck shellcheck + +# ex: filetype=sh diff --git a/test/t/Makefile.am b/test/t/Makefile.am index d5598cdaa40..3776d59e77d 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -528,6 +528,7 @@ EXTRA_DIST = \ test_sh.py \ test_sha1sum.py \ test_shar.py \ + test_shellcheck.py \ test_sitecopy.py \ test_slackpkg.py \ test_slapt_get.py \ diff --git a/test/t/test_shellcheck.py b/test/t/test_shellcheck.py new file mode 100644 index 00000000000..fd8599b5279 --- /dev/null +++ b/test/t/test_shellcheck.py @@ -0,0 +1,20 @@ +import pytest + + +class TestShellcheck: + + @pytest.mark.complete("shellcheck ") + def test_1(self, completion): + assert completion + + @pytest.mark.complete("shellcheck -") + def test_2(self, completion): + assert completion + + @pytest.mark.complete("shellcheck --format=") + def test_3(self, completion): + assert completion + + @pytest.mark.complete("shellcheck -s ") + def test_4(self, completion): + assert "bash" in completion From 2bf12d7efb2ab73f5948d3c7868ff4c0273a71de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 14 Apr 2019 11:50:41 +0300 Subject: [PATCH 0071/1094] ulimit: new completion --- completions/Makefile.am | 1 + completions/ulimit | 32 ++++++++++++++++++++++++++++++++ test/t/Makefile.am | 1 + test/t/test_ulimit.py | 31 +++++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 completions/ulimit create mode 100644 test/t/test_ulimit.py diff --git a/completions/Makefile.am b/completions/Makefile.am index a17830036a7..94cca466057 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -408,6 +408,7 @@ bashcomp_DATA = 2to3 \ tshark \ tune2fs \ _udevadm \ + ulimit \ _umount \ _umount.linux \ unace \ diff --git a/completions/ulimit b/completions/ulimit new file mode 100644 index 00000000000..e2757a3b302 --- /dev/null +++ b/completions/ulimit @@ -0,0 +1,32 @@ +# bash completion for ulimit -*- shell-script -*- + +_ulimit() +{ + local cur prev words cword + _init_completion || return + + local mode + case $prev in + -a) + return + ;; + -[SH]) + ;; + -*) + mode=$prev + ;; + esac + + if [[ -z "$mode" && "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + return + fi + + local args + _count_args + [[ $args -eq 1 ]] && \ + COMPREPLY=( $( compgen -W "soft hard unlimited" -- "$cur" ) ) +} && +complete -F _ulimit ulimit + +# ex: filetype=sh diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 3776d59e77d..3f6498aa787 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -588,6 +588,7 @@ EXTRA_DIST = \ test_tshark.py \ test_tune2fs.py \ test_udevadm.py \ + test_ulimit.py \ test_umount.py \ test_unace.py \ test_uname.py \ diff --git a/test/t/test_ulimit.py b/test/t/test_ulimit.py new file mode 100644 index 00000000000..aa417006266 --- /dev/null +++ b/test/t/test_ulimit.py @@ -0,0 +1,31 @@ +import pytest + + +class TestUlimit: + + @pytest.mark.complete("ulimit ") + def test_1(self, completion): + assert completion + + @pytest.mark.complete("ulimit -") + def test_2(self, completion): + assert completion + + @pytest.mark.complete("ulimit -S -") + def test_3(self, completion): + """Test modes are completed after -S (-S not treated as mode).""" + assert completion + + @pytest.mark.complete("ulimit -u -") + def test_4(self, completion): + """Test modes are NOT completed if one is specified.""" + assert not completion + + @pytest.mark.complete("ulimit -c ") + def test_5(self, completion): + assert completion + assert not any(x.startswith("-") for x in completion) + + @pytest.mark.complete("ulimit -a ") + def test_6(self, completion): + assert not completion From 6bc7bba0315d64b1285861ad16a3f708d5437926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 14 Apr 2019 12:04:20 +0300 Subject: [PATCH 0072/1094] ulimit: improvements when -a is specified --- completions/ulimit | 16 +++++++++++++--- test/t/test_ulimit.py | 5 +++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/completions/ulimit b/completions/ulimit index e2757a3b302..158cb365733 100644 --- a/completions/ulimit +++ b/completions/ulimit @@ -5,9 +5,12 @@ _ulimit() local cur prev words cword _init_completion || return + # TODO combined option support (-aH, -Sc etc) + local mode case $prev in -a) + COMPREPLY=( $( compgen -W "-S -H" -- "$cur" ) ) return ;; -[SH]) @@ -17,9 +20,16 @@ _ulimit() ;; esac - if [[ -z "$mode" && "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) - return + if [[ -z "$mode" ]]; then + local word + for word in "${words[@]}"; do + [[ $word == -*a* ]] && return + done + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + return + fi fi local args diff --git a/test/t/test_ulimit.py b/test/t/test_ulimit.py index aa417006266..1fb40e26916 100644 --- a/test/t/test_ulimit.py +++ b/test/t/test_ulimit.py @@ -28,4 +28,9 @@ def test_5(self, completion): @pytest.mark.complete("ulimit -a ") def test_6(self, completion): + assert completion == sorted("-S -H".split()) + + @pytest.mark.complete("ulimit -a -H -") + def test_7(self, completion): + """Test modes are NOT completed with -a given somewhere.""" assert not completion From 09fa92d75e7b542c5ae601ba1fbd9c0155dbb66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 14 Apr 2019 15:44:45 +0300 Subject: [PATCH 0073/1094] ping, tracepath: parse options primarily with _parse_help iputils usage outputs changed to _help compatible 2017-12-31. --- completions/ping | 3 ++- completions/tracepath | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/completions/ping b/completions/ping index 0b4b09a6acb..c8bfd9fd725 100644 --- a/completions/ping +++ b/completions/ping @@ -58,7 +58,8 @@ _ping() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + local opts=$( _parse_help "$1" ) + COMPREPLY=( $( compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur" ) ) return fi diff --git a/completions/tracepath b/completions/tracepath index 2bb86f1c920..11798f4bf2b 100644 --- a/completions/tracepath +++ b/completions/tracepath @@ -12,7 +12,8 @@ _tracepath() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + local opts=$( _parse_help "$1" ) + COMPREPLY=( $( compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur" ) ) return fi From 83b4b21d4075a88bd8e615b7e2da91520bd0a028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 14 Apr 2019 15:56:33 +0300 Subject: [PATCH 0074/1094] modprobe: module parameter boolean values --- completions/modprobe | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/completions/modprobe b/completions/modprobe index 6f188f1254b..7d6924222d9 100644 --- a/completions/modprobe +++ b/completions/modprobe @@ -83,10 +83,21 @@ _modprobe() _filedir '@(?(k)o?(.gz))' elif [[ -n "$module" ]]; then # do module parameter completion - COMPREPLY=( $( compgen -S = -W "$( PATH="$PATH:/sbin" modinfo \ - -p "$module" 2>/dev/null | \ - awk -F: '!/^[ \t]/ { print $1 }' )" -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace + if [[ $cur == *=* ]]; then + prev=${cur%%=*} + cur=${cur#*=} + if PATH="$PATH:/sbin" modinfo -p "$module" 2>/dev/null \ + | command grep -q "^$prev:.*(bool)"; then + local choices="on off" + [[ $cur ]] && choices="1 0 y Y n N on off" + COMPREPLY=( $( compgen -W "$choices" -- "$cur" ) ) + fi + else + COMPREPLY=( $( compgen -S = -W "$( PATH="$PATH:/sbin" \ + modinfo -p "$module" 2>/dev/null | \ + awk -F: '!/^[ \t]/ { print $1 }' )" -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + fi else _modules $version if [[ $COMPREPLY ]]; then From c3e54476693dabecc1c8d52150001739d1404412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 14 Apr 2019 16:00:31 +0300 Subject: [PATCH 0075/1094] bzip2: recognize *.tbz2 as bzipped --- completions/bzip2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/bzip2 b/completions/bzip2 index 940ddcf691c..4cdcf4b0ec8 100644 --- a/completions/bzip2 +++ b/completions/bzip2 @@ -22,7 +22,7 @@ _bzip2() return fi - local IFS=$'\n' xspec="*.bz2" + local IFS=$'\n' xspec="*.?(t)bz2" if [[ "$prev" == --* ]]; then [[ "$prev" == --@(decompress|list|test) ]] && xspec="!"$xspec From 90e380b935afefbe63e4b68e4448a1bbb701696a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 14 Apr 2019 19:07:30 +0300 Subject: [PATCH 0076/1094] *: remove spaces immediately within $() Colorizes nicer in Emacs, and probably feels more natural to most readers. --- CONTRIBUTING.md | 2 +- bash_completion | 247 +++++++++++++++--------------- completions/2to3 | 8 +- completions/7z | 40 ++--- completions/_adb | 20 +-- completions/_cal | 6 +- completions/_chsh | 2 +- completions/_dmesg | 12 +- completions/_eject | 4 +- completions/_hexdump | 6 +- completions/_hwclock | 2 +- completions/_ionice | 6 +- completions/_look | 2 +- completions/_mock | 12 +- completions/_modules | 12 +- completions/_mount | 18 +-- completions/_mount.linux | 26 ++-- completions/_nmcli | 76 ++++----- completions/_repomanage | 2 +- completions/_reptyr | 2 +- completions/_rfkill | 10 +- completions/_rtcwake | 8 +- completions/_su | 6 +- completions/_svn | 12 +- completions/_svnadmin | 10 +- completions/_svnlook | 8 +- completions/_udevadm | 22 ++- completions/_umount | 2 +- completions/_umount.linux | 18 +-- completions/_xm | 40 +++-- completions/_yum | 39 +++-- completions/a2x | 3 +- completions/abook | 12 +- completions/aclocal | 6 +- completions/acpi | 2 +- completions/add_members | 6 +- completions/alias | 6 +- completions/ant | 6 +- completions/apache2ctl | 2 +- completions/appdata-validate | 8 +- completions/apt-build | 12 +- completions/apt-cache | 14 +- completions/apt-get | 34 ++-- completions/aptitude | 16 +- completions/arch | 4 +- completions/arp | 12 +- completions/arping | 2 +- completions/arpspoof | 2 +- completions/asciidoc | 10 +- completions/aspell | 32 ++-- completions/autoconf | 6 +- completions/automake | 6 +- completions/autoreconf | 6 +- completions/autorpm | 4 +- completions/autoscan | 2 +- completions/avctrl | 4 +- completions/badblocks | 2 +- completions/bind | 10 +- completions/bk | 6 +- completions/brctl | 10 +- completions/btdownloadheadless.py | 4 +- completions/bts | 48 +++--- completions/bzip2 | 11 +- completions/cancel | 6 +- completions/cardctl | 4 +- completions/ccache | 6 +- completions/ccze | 12 +- completions/cfagent | 2 +- completions/cfrun | 8 +- completions/chage | 4 +- completions/change_pw | 4 +- completions/check_db | 2 +- completions/check_perms | 2 +- completions/checksec | 2 +- completions/chgrp | 4 +- completions/chkconfig | 10 +- completions/chmod | 6 +- completions/chown | 4 +- completions/chpasswd | 6 +- completions/chromium-browser | 4 +- completions/chronyc | 16 +- completions/chrpath | 2 +- completions/cksfv | 2 +- completions/cleanarch | 4 +- completions/clisp | 4 +- completions/clone_member | 4 +- completions/complete | 20 +-- completions/config_list | 4 +- completions/configure | 8 +- completions/convert | 136 ++++++++-------- completions/cowsay | 8 +- completions/cpan2dist | 10 +- completions/cpio | 22 +-- completions/cppcheck | 22 +-- completions/crontab | 2 +- completions/cryptsetup | 11 +- completions/curl | 16 +- completions/cvs | 70 ++++----- completions/cvsps | 20 +-- completions/dd | 16 +- completions/deja-dup | 3 +- completions/desktop-file-validate | 2 +- completions/dhclient | 4 +- completions/dict | 12 +- completions/dnssec-keygen | 12 +- completions/dnsspoof | 2 +- completions/dot | 18 +-- completions/dpkg | 16 +- completions/dpkg-source | 14 +- completions/dselect | 6 +- completions/dsniff | 2 +- completions/dumpdb | 4 +- completions/dumpe2fs | 2 +- completions/e2freefrag | 2 +- completions/ebtables | 22 +-- completions/ecryptfs-migrate-home | 4 +- completions/eog | 3 +- completions/ether-wake | 2 +- completions/evince | 3 +- completions/export | 7 +- completions/faillog | 4 +- completions/fbgs | 14 +- completions/fbi | 14 +- completions/feh | 34 ++-- completions/file | 6 +- completions/file-roller | 3 +- completions/filefrag | 2 +- completions/filesnarf | 2 +- completions/find | 18 +-- completions/find_member | 4 +- completions/fio | 18 +-- completions/firefox | 4 +- completions/flake8 | 6 +- completions/freeciv | 8 +- completions/freeciv-server | 2 +- completions/function | 12 +- completions/fusermount | 6 +- completions/gcc | 15 +- completions/gcl | 4 +- completions/gdb | 18 +-- completions/genaliases | 2 +- completions/genisoimage | 6 +- completions/geoiplookup | 2 +- completions/getconf | 12 +- completions/getent | 21 ++- completions/gkrellm | 2 +- completions/gm | 4 +- completions/gnatmake | 4 +- completions/gnokii | 68 ++++---- completions/gnome-mplayer | 7 +- completions/gnome-screenshot | 4 +- completions/gpasswd | 6 +- completions/gpg | 14 +- completions/gpg2 | 14 +- completions/gpgv | 4 +- completions/gphoto2 | 14 +- completions/gprof | 11 +- completions/groupadd | 2 +- completions/groupdel | 4 +- completions/groupmems | 6 +- completions/groupmod | 4 +- completions/growisofs | 4 +- completions/grpck | 6 +- completions/gzip | 9 +- completions/hcitool | 96 ++++++------ completions/hddtemp | 4 +- completions/hid2hci | 4 +- completions/hostname | 2 +- completions/hping2 | 4 +- completions/htop | 6 +- completions/htpasswd | 6 +- completions/hunspell | 4 +- completions/iconv | 6 +- completions/id | 6 +- completions/idn | 6 +- completions/ifstat | 16 +- completions/iftop | 2 +- completions/ifup | 2 +- completions/info | 6 +- completions/inject | 2 +- completions/inotifywait | 10 +- completions/insmod | 4 +- completions/installpkg | 6 +- completions/interdiff | 2 +- completions/invoke-rc.d | 12 +- completions/ip | 81 +++++----- completions/iperf | 10 +- completions/ipmitool | 70 ++++----- completions/ipsec | 37 +++-- completions/iptables | 22 +-- completions/ipv6calc | 10 +- completions/iscsiadm | 12 +- completions/isort | 10 +- completions/isql | 2 +- completions/iwconfig | 54 +++---- completions/iwlist | 6 +- completions/iwpriv | 8 +- completions/iwspy | 4 +- completions/jar | 2 +- completions/jarsigner | 8 +- completions/java | 56 +++---- completions/javaws | 2 +- completions/jpegoptim | 6 +- completions/jps | 2 +- completions/jq | 4 +- completions/jshint | 6 +- completions/json_xs | 10 +- completions/jsonschema | 2 +- completions/k3b | 4 +- completions/kcov | 10 +- completions/kill | 2 +- completions/killall | 2 +- completions/kldload | 2 +- completions/kldunload | 2 +- completions/koji | 30 ++-- completions/ktutil | 16 +- completions/larch | 4 +- completions/lastlog | 4 +- completions/ldapsearch | 23 ++- completions/ldapvi | 20 +-- completions/lftp | 6 +- completions/lftpget | 2 +- completions/lilo | 12 +- completions/links | 22 +-- completions/lintian | 30 ++-- completions/lisp | 4 +- completions/list_admins | 2 +- completions/list_lists | 6 +- completions/list_members | 10 +- completions/list_owners | 4 +- completions/locale-gen | 8 +- completions/lpq | 6 +- completions/lpr | 8 +- completions/lrzip | 11 +- completions/lsof | 10 +- completions/lspci | 6 +- completions/lsscsi | 2 +- completions/lsusb | 2 +- completions/lua | 2 +- completions/luac | 2 +- completions/luseradd | 4 +- completions/luserdel | 4 +- completions/lvm | 166 ++++++++++---------- completions/lz4 | 9 +- completions/lzip | 8 +- completions/lzma | 5 +- completions/lzop | 7 +- completions/macof | 2 +- completions/mailmanctl | 6 +- completions/make | 18 +-- completions/makepkg | 6 +- completions/man | 14 +- completions/mc | 3 +- completions/mcrypt | 20 +-- completions/mdadm | 48 +++--- completions/mdtool | 22 +-- completions/medusa | 6 +- completions/mii-diag | 6 +- completions/mii-tool | 10 +- completions/minicom | 14 +- completions/mkinitrd | 4 +- completions/mktemp | 4 +- completions/mmsitepass | 2 +- completions/modinfo | 10 +- completions/modprobe | 12 +- completions/monodevelop | 2 +- completions/mplayer | 95 ++++++------ completions/mr | 10 +- completions/msynctool | 20 +-- completions/mtx | 6 +- completions/munin-node-configure | 4 +- completions/munin-run | 6 +- completions/munin-update | 4 +- completions/munindoc | 4 +- completions/mussh | 10 +- completions/mutt | 28 ++-- completions/mypy | 6 +- completions/mysql | 16 +- completions/mysqladmin | 8 +- completions/nc | 8 +- completions/ncftp | 6 +- completions/nethogs | 4 +- completions/newlist | 2 +- completions/newusers | 5 +- completions/ngrep | 6 +- completions/nmap | 4 +- completions/nproc | 2 +- completions/nslookup | 14 +- completions/nsupdate | 6 +- completions/ntpdate | 6 +- completions/oggdec | 6 +- completions/op | 10 +- completions/openssl | 26 ++-- completions/opera | 8 +- completions/optipng | 14 +- completions/p4 | 12 +- completions/pack200 | 14 +- completions/passwd | 6 +- completions/patch | 14 +- completions/pdftotext | 10 +- completions/perl | 30 ++-- completions/perlcritic | 16 +- completions/perltidy | 10 +- completions/pgrep | 10 +- completions/pidof | 2 +- completions/pine | 8 +- completions/ping | 14 +- completions/pkg-config | 12 +- completions/pkg_delete | 2 +- completions/pkgtool | 6 +- completions/plague-client | 4 +- completions/pm-hibernate | 2 +- completions/pm-is-supported | 4 +- completions/pm-powersave | 2 +- completions/pngfix | 7 +- completions/portinstall | 8 +- completions/portupgrade | 2 +- completions/postcat | 6 +- completions/postconf | 4 +- completions/postfix | 8 +- completions/postmap | 8 +- completions/postsuper | 16 +- completions/povray | 4 +- completions/prelink | 2 +- completions/protoc | 6 +- completions/psql | 20 +-- completions/puppet | 58 +++---- completions/pv | 2 +- completions/pwck | 2 +- completions/pwd | 4 +- completions/pwdx | 4 +- completions/pwgen | 2 +- completions/pycodestyle | 4 +- completions/pydoc | 12 +- completions/pydocstyle | 4 +- completions/pyflakes | 2 +- completions/pylint | 18 +-- completions/pytest | 24 +-- completions/python | 18 +-- completions/qdbus | 4 +- completions/qemu | 57 ++++--- completions/qrunner | 4 +- completions/querybts | 14 +- completions/quota | 18 +-- completions/radvdump | 4 +- completions/rcs | 4 +- completions/rdesktop | 26 ++-- completions/remove_members | 4 +- completions/removepkg | 6 +- completions/reportbug | 32 ++-- completions/resolvconf | 2 +- completions/ri | 30 ++-- completions/rmlist | 2 +- completions/rmmod | 2 +- completions/route | 2 +- completions/rpcdebug | 9 +- completions/rpm | 79 +++++----- completions/rpm2tgz | 2 +- completions/rpmcheck | 4 +- completions/rrdtool | 4 +- completions/rsync | 8 +- completions/sbcl | 4 +- completions/sbopkg | 14 +- completions/screen | 12 +- completions/scrub | 8 +- completions/sh | 8 +- completions/shellcheck | 14 +- completions/sitecopy | 10 +- completions/slackpkg | 36 ++--- completions/slapt-get | 16 +- completions/slapt-src | 10 +- completions/smartctl | 44 +++--- completions/smbclient | 36 ++--- completions/snownews | 2 +- completions/sqlite3 | 4 +- completions/ss | 12 +- completions/ssh | 85 +++++----- completions/ssh-add | 2 +- completions/ssh-copy-id | 2 +- completions/ssh-keygen | 16 +- completions/sshmitm | 2 +- completions/sshow | 2 +- completions/strace | 17 +- completions/strings | 11 +- completions/sudo | 10 +- completions/svk | 30 ++-- completions/sync_members | 6 +- completions/synclient | 6 +- completions/sysbench | 58 ++++--- completions/sysctl | 10 +- completions/tar | 28 ++-- completions/tcpdump | 16 +- completions/tcpkill | 2 +- completions/tcpnice | 2 +- completions/timeout | 2 +- completions/tipc | 40 ++--- completions/tox | 4 +- completions/tracepath | 4 +- completions/tshark | 51 +++--- completions/tune2fs | 14 +- completions/ulimit | 6 +- completions/unace | 4 +- completions/unpack200 | 8 +- completions/unrar | 6 +- completions/unshunt | 2 +- completions/update-alternatives | 8 +- completions/update-rc.d | 14 +- completions/upgradepkg | 8 +- completions/urlsnarf | 2 +- completions/uscan | 4 +- completions/useradd | 8 +- completions/userdel | 4 +- completions/usermod | 10 +- completions/valgrind | 32 ++-- completions/vipw | 2 +- completions/vmstat | 6 +- completions/vncviewer | 16 +- completions/vpnc | 23 ++- completions/watch | 4 +- completions/webmitm | 2 +- completions/wget | 47 +++--- completions/wine | 2 +- completions/withlist | 4 +- completions/wodim | 25 ++- completions/wol | 6 +- completions/wsimport | 5 +- completions/wtf | 4 +- completions/wvdial | 4 +- completions/xdg-mime | 22 +-- completions/xdg-settings | 10 +- completions/xfreerdp | 36 ++--- completions/xgamma | 20 +-- completions/xmllint | 4 +- completions/xmlwf | 6 +- completions/xmms | 4 +- completions/xmodmap | 2 +- completions/xrandr | 29 ++-- completions/xrdb | 2 +- completions/xsltproc | 6 +- completions/xxd | 2 +- completions/xz | 13 +- completions/xzdec | 2 +- completions/ypmatch | 10 +- completions/yum-arch | 2 +- completions/zopfli | 7 +- completions/zopflipng | 6 +- 446 files changed, 2744 insertions(+), 2790 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index da865894abe..b7708907bd4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,7 +55,7 @@ guidelines in mind: As another example, ```shell - bar=$( echo $foo | sed -e 's/bar/baz/g' ) + bar=$(echo $foo | command sed -e 's/bar/baz/g') ``` can be replaced by: diff --git a/bash_completion b/bash_completion index 609abe87c81..d532a44fc19 100644 --- a/bash_completion +++ b/bash_completion @@ -85,7 +85,7 @@ complete -b builtin # @param $1 userland to check for _userland() { - local userland=$( uname -s ) + local userland=$(uname -s) [[ $userland == @(Linux|GNU/*) ]] && userland=GNU [[ $userland == $1 ]] } @@ -124,7 +124,7 @@ have() # _rl_enabled() { - [[ "$( bind -v )" == *$1+([[:space:]])on* ]] + [[ "$(bind -v)" == *$1+([[:space:]])on* ]] } # This function shell-quotes the argument @@ -556,7 +556,7 @@ _filedir() local x reset reset=$(shopt -po noglob); set -o noglob - toks=( $( compgen -d -- "$cur" ) ) + toks=( $(compgen -d -- "$cur") ) IFS=' '; $reset; IFS=$'\n' if [[ "$1" != -d ]]; then @@ -567,13 +567,13 @@ _filedir() # http://thread.gmane.org/gmane.comp.shells.bash.bugs/15294/focus=15306 local xspec=${1:+"!*.@($1|${1^^})"} reset=$(shopt -po noglob); set -o noglob - toks+=( $( compgen -f -X "$xspec" -- $quoted ) ) + toks+=( $(compgen -f -X "$xspec" -- $quoted) ) IFS=' '; $reset; IFS=$'\n' # Try without filter if it failed to produce anything and configured to [[ -n ${COMP_FILEDIR_FALLBACK:-} && -n "$1" && ${#toks[@]} -lt 1 ]] && { reset=$(shopt -po noglob); set -o noglob - toks+=( $( compgen -f -- $quoted ) ) + toks+=( $(compgen -f -- $quoted) ) IFS=' '; $reset; IFS=$'\n' } fi @@ -614,8 +614,8 @@ _variables() # Completing $var / ${var / ${!var / ${#var if [[ $cur == \${* ]]; then local arrs vars - vars=( $( compgen -A variable -P ${BASH_REMATCH[1]} -S '}' -- ${BASH_REMATCH[3]} ) ) && \ - arrs=( $( compgen -A arrayvar -P ${BASH_REMATCH[1]} -S '[' -- ${BASH_REMATCH[3]} ) ) + vars=( $(compgen -A variable -P ${BASH_REMATCH[1]} -S '}' -- ${BASH_REMATCH[3]}) ) && \ + arrs=( $(compgen -A arrayvar -P ${BASH_REMATCH[1]} -S '[' -- ${BASH_REMATCH[3]}) ) if [[ ${#vars[@]} -eq 1 && $arrs ]]; then # Complete ${arr with ${array[ if there is only one match, and that match is an array variable compopt -o nospace @@ -626,14 +626,14 @@ _variables() fi else # Complete $var with $variable - COMPREPLY+=( $( compgen -A variable -P '$' -- "${BASH_REMATCH[3]}" ) ) + COMPREPLY+=( $(compgen -A variable -P '$' -- "${BASH_REMATCH[3]}") ) fi return 0 elif [[ $cur =~ ^(\$\{[#!]?)([A-Za-z0-9_]*)\[([^]]*)$ ]]; then # Complete ${array[i with ${array[idx]} local IFS=$'\n' - COMPREPLY+=( $( compgen -W '$(printf %s\\n "${!'${BASH_REMATCH[2]}'[@]}")' \ - -P "${BASH_REMATCH[1]}${BASH_REMATCH[2]}[" -S ']}' -- "${BASH_REMATCH[3]}" ) ) + COMPREPLY+=( $(compgen -W '$(printf %s\\n "${!'${BASH_REMATCH[2]}'[@]}")' \ + -P "${BASH_REMATCH[1]}${BASH_REMATCH[2]}[" -S ']}' -- "${BASH_REMATCH[3]}") ) # Complete ${arr[@ and ${arr[* if [[ ${BASH_REMATCH[3]} == [@*] ]]; then COMPREPLY+=( "${BASH_REMATCH[1]}${BASH_REMATCH[2]}[${BASH_REMATCH[3]}]}" ) @@ -790,11 +790,11 @@ __parse_options() # _parse_help() { - eval local cmd=$( quote "$1" ) + eval local cmd=$(quote "$1") local line { case $cmd in -) cat ;; - *) LC_ALL=C "$( dequote "$cmd" )" ${2:---help} 2>&1 ;; + *) LC_ALL=C "$(dequote "$cmd")" ${2:---help} 2>&1 ;; esac } \ | while read -r line; do @@ -815,11 +815,11 @@ _parse_help() # _parse_usage() { - eval local cmd=$( quote "$1" ) + eval local cmd=$(quote "$1") local line match option i char { case $cmd in -) cat ;; - *) LC_ALL=C "$( dequote "$cmd" )" ${2:---usage} 2>&1 ;; + *) LC_ALL=C "$(dequote "$cmd")" ${2:---usage} 2>&1 ;; esac } \ | while read -r line; do @@ -848,7 +848,7 @@ _parse_usage() # @param $1 prefix _signals() { - local -a sigs=( $( compgen -P "$1" -A signal "SIG${cur#$1}" ) ) + local -a sigs=( $(compgen -P "$1" -A signal "SIG${cur#$1}") ) COMPREPLY+=( "${sigs[@]/#${1}SIG/${1}}" ) } @@ -863,7 +863,7 @@ _mac_addresses() # - ifconfig on Linux: HWaddr or ether # - ifconfig on FreeBSD: ether # - ip link: link/ether - COMPREPLY+=( $( \ + COMPREPLY+=( $(\ { LC_ALL=C ifconfig -a || ip link show; } 2>/dev/null | command sed -ne \ "s/.*[[:space:]]HWaddr[[:space:]]\{1,\}\($re\)[[:space:]].*/\1/p" -ne \ "s/.*[[:space:]]HWaddr[[:space:]]\{1,\}\($re\)[[:space:]]*$/\1/p" -ne \ @@ -872,15 +872,15 @@ _mac_addresses() ) ) # ARP cache - COMPREPLY+=( $( { arp -an || ip neigh show; } 2>/dev/null | command sed -ne \ + COMPREPLY+=( $({ arp -an || ip neigh show; } 2>/dev/null | command sed -ne \ "s/.*[[:space:]]\($re\)[[:space:]].*/\1/p" -ne \ - "s/.*[[:space:]]\($re\)[[:space:]]*$/\1/p" ) ) + "s/.*[[:space:]]\($re\)[[:space:]]*$/\1/p") ) # /etc/ethers - COMPREPLY+=( $( command sed -ne \ - "s/^[[:space:]]*\($re\)[[:space:]].*/\1/p" /etc/ethers 2>/dev/null ) ) + COMPREPLY+=( $(command sed -ne \ + "s/^[[:space:]]*\($re\)[[:space:]].*/\1/p" /etc/ethers 2>/dev/null) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") ) __ltrim_colon_completions "$cur" } @@ -890,24 +890,24 @@ _configured_interfaces() { if [[ -f /etc/debian_version ]]; then # Debian system - COMPREPLY=( $( compgen -W "$( command sed -ne 's|^iface \([^ ]\{1,\}\).*$|\1|p'\ - /etc/network/interfaces /etc/network/interfaces.d/* 2>/dev/null )" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(command sed -ne 's|^iface \([^ ]\{1,\}\).*$|\1|p'\ + /etc/network/interfaces /etc/network/interfaces.d/* 2>/dev/null)" \ + -- "$cur") ) elif [[ -f /etc/SuSE-release ]]; then # SuSE system - COMPREPLY=( $( compgen -W "$( printf '%s\n' \ + COMPREPLY=( $(compgen -W "$(printf '%s\n' \ /etc/sysconfig/network/ifcfg-* | \ - command sed -ne 's|.*ifcfg-\([^*].*\)$|\1|p' )" -- "$cur" ) ) + command sed -ne 's|.*ifcfg-\([^*].*\)$|\1|p')" -- "$cur") ) elif [[ -f /etc/pld-release ]]; then # PLD Linux - COMPREPLY=( $( compgen -W "$( command ls -B \ + COMPREPLY=( $(compgen -W "$(command ls -B \ /etc/sysconfig/interfaces | \ - command sed -ne 's|.*ifcfg-\([^*].*\)$|\1|p' )" -- "$cur" ) ) + command sed -ne 's|.*ifcfg-\([^*].*\)$|\1|p')" -- "$cur") ) else # Assume Red Hat - COMPREPLY=( $( compgen -W "$( printf '%s\n' \ + COMPREPLY=( $(compgen -W "$(printf '%s\n' \ /etc/sysconfig/network-scripts/ifcfg-* | \ - command sed -ne 's|.*ifcfg-\([^*].*\)$|\1|p' )" -- "$cur" ) ) + command sed -ne 's|.*ifcfg-\([^*].*\)$|\1|p')" -- "$cur") ) fi } @@ -924,17 +924,17 @@ _ip_addresses() -6) n='6' ;; esac local PATH=$PATH:/sbin - local addrs=$( { LC_ALL=C ifconfig -a || ip addr show; } 2>/dev/null | + local addrs=$({ LC_ALL=C ifconfig -a || ip addr show; } 2>/dev/null | command sed -e 's/[[:space:]]addr:/ /' -ne \ - "s|.*inet$n[[:space:]]\{1,\}\([^[:space:]/]*\).*|\1|p" ) - COMPREPLY+=( $( compgen -W "$addrs" -- "$cur" ) ) + "s|.*inet$n[[:space:]]\{1,\}\([^[:space:]/]*\).*|\1|p") + COMPREPLY+=( $(compgen -W "$addrs" -- "$cur") ) } # This function completes on available kernels # _kernel_versions() { - COMPREPLY=( $( compgen -W '$( command ls /lib/modules )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(command ls /lib/modules)' -- "$cur") ) } # This function completes on all available network interfaces @@ -945,7 +945,7 @@ _available_interfaces() { local PATH=$PATH:/sbin - COMPREPLY=( $( { + COMPREPLY=( $({ if [[ ${1:-} == -w ]]; then iwconfig elif [[ ${1:-} == -a ]]; then @@ -954,9 +954,9 @@ _available_interfaces() ifconfig -a || ip link show fi } 2>/dev/null | awk \ - '/^[^ \t]/ { if ($1 ~ /^[0-9]+:/) { print $2 } else { print $1 } }' ) ) + '/^[^ \t]/ { if ($1 ~ /^[0-9]+:/) { print $2 } else { print $1 } }') ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]/%[[:punct:]]/}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]/%[[:punct:]]/}' -- "$cur") ) } # Echo number of CPUs, falling back to 1 on failure. @@ -964,7 +964,7 @@ _ncpus() { local var=NPROCESSORS_ONLN [[ $OSTYPE == *linux* ]] && var=_$var - local n=$( getconf $var 2>/dev/null ) + local n=$(getconf $var 2>/dev/null) printf %s ${n:-1} } @@ -977,7 +977,7 @@ _tilde() local result=0 if [[ $1 == \~* && $1 != */* ]]; then # Try generate ~username completions - COMPREPLY=( $( compgen -P '~' -u -- "${1#\~}" ) ) + COMPREPLY=( $(compgen -P '~' -u -- "${1#\~}") ) result=${#COMPREPLY[@]} # 2>/dev/null for direct invocation, e.g. in the _tilde unit test [[ $result -gt 0 ]] && compopt -o filenames 2>/dev/null @@ -1037,11 +1037,11 @@ _expand() [[ $OSTYPE == *@(solaris|aix)* ]] && _pids() { - COMPREPLY=( $( compgen -W '$( command ps -efo pid | command sed 1d )' -- "$cur" )) + COMPREPLY=( $(compgen -W '$(command ps -efo pid | command sed 1d)' -- "$cur") ) } || _pids() { - COMPREPLY=( $( compgen -W '$( command ps axo pid= )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(command ps axo pid=)' -- "$cur") ) } # This function completes on process group IDs. @@ -1049,11 +1049,11 @@ _pids() [[ $OSTYPE == *@(solaris|aix)* ]] && _pgids() { - COMPREPLY=( $( compgen -W '$( command ps -efo pgid | command sed 1d )' -- "$cur" )) + COMPREPLY=( $(compgen -W '$(command ps -efo pgid | command sed 1d)' -- "$cur") ) } || _pgids() { - COMPREPLY=( $( compgen -W '$( command ps axo pgid= )' -- "$cur" )) + COMPREPLY=( $(compgen -W '$(command ps axo pgid=)' -- "$cur") ) } # This function completes on process names. @@ -1062,14 +1062,14 @@ _pgids() [[ $OSTYPE == *@(solaris|aix)* ]] && _pnames() { - COMPREPLY=( $( compgen -X '' -W '$( command ps -efo comm | \ - command sed -e 1d -e "s:.*/::" -e "s/^-//" | sort -u )' -- "$cur" ) ) + COMPREPLY=( $(compgen -X '' -W '$(command ps -efo comm | \ + command sed -e 1d -e "s:.*/::" -e "s/^-//" | sort -u)' -- "$cur") ) } || _pnames() { if [[ "$1" == -s ]]; then - COMPREPLY=( $( compgen -X '' \ - -W '$( command ps axo comm | command sed -e 1d )' -- "$cur" ) ) + COMPREPLY=( $(compgen -X '' \ + -W '$(command ps axo comm | command sed -e 1d)' -- "$cur") ) else # FIXME: completes "[kblockd/0]" to "0". Previously it was completed # to "kblockd" which isn't correct either. "kblockd/0" would be @@ -1077,12 +1077,12 @@ _pnames() # containing "/" specially unless -r is given so that wouldn't quite # work either. Perhaps it'd be best to not complete these to anything # for now. - COMPREPLY=( $( compgen -X '' -W '$( command ps axo command= | command sed -e \ + COMPREPLY=( $(compgen -X '' -W '$(command ps axo command= | command sed -e \ "s/ .*//" -e \ "s:.*/::" -e \ "s/:$//" -e \ "s/^[[(-]//" -e \ - "s/[])]$//" | sort -u )' -- "$cur" ) ) + "s/[])]$//" | sort -u)' -- "$cur") ) fi } @@ -1091,12 +1091,12 @@ _pnames() _uids() { if type getent &>/dev/null; then - COMPREPLY=( $( compgen -W '$( getent passwd | cut -d: -f3 )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(getent passwd | cut -d: -f3)' -- "$cur") ) elif type perl &>/dev/null; then - COMPREPLY=( $( compgen -W '$( perl -e '"'"'while (($uid) = (getpwent)[2]) { print $uid . "\n" }'"'"' )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(perl -e '"'"'while (($uid) = (getpwent)[2]) { print $uid . "\n" }'"'"')' -- "$cur") ) else # make do with /etc/passwd - COMPREPLY=( $( compgen -W '$( cut -d: -f3 /etc/passwd )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(cut -d: -f3 /etc/passwd)' -- "$cur") ) fi } @@ -1105,13 +1105,12 @@ _uids() _gids() { if type getent &>/dev/null; then - COMPREPLY=( $( compgen -W '$( getent group | cut -d: -f3 )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(getent group | cut -d: -f3)' -- "$cur") ) elif type perl &>/dev/null; then - COMPREPLY=( $( compgen -W '$( perl -e '"'"'while (($gid) = (getgrent)[2]) { print $gid . "\n" }'"'"' )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(perl -e '"'"'while (($gid) = (getgrent)[2]) { print $gid . "\n" }'"'"')' -- "$cur") ) else # make do with /etc/group - COMPREPLY=( $( compgen -W '$( cut -d: -f3 /etc/group )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(cut -d: -f3 /etc/group)' -- "$cur") ) fi } @@ -1126,9 +1125,9 @@ _xinetd_services() local xinetddir=/etc/xinetd.d if [[ -d $xinetddir ]]; then local IFS=$' \t\n' reset=$(shopt -p nullglob); shopt -s nullglob - local -a svcs=( $( printf '%s\n' $xinetddir/!($_backup_glob) ) ) + local -a svcs=( $(printf '%s\n' $xinetddir/!($_backup_glob)) ) $reset - COMPREPLY+=( $( compgen -W '${svcs[@]#$xinetddir/}' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W '${svcs[@]#$xinetddir/}' -- "$cur") ) fi } @@ -1141,18 +1140,18 @@ _services() local IFS=$' \t\n' reset=$(shopt -p nullglob); shopt -s nullglob COMPREPLY=( \ - $( printf '%s\n' ${sysvdirs[0]}/!($_backup_glob|functions|README) ) ) + $(printf '%s\n' ${sysvdirs[0]}/!($_backup_glob|functions|README)) ) $reset - COMPREPLY+=( $( { systemctl list-units --full --all || \ - systemctl list-unit-files; } 2>/dev/null | \ - awk '$1 ~ /\.service$/ { sub("\\.service$", "", $1); print $1 }' ) ) + COMPREPLY+=( $({ systemctl list-units --full --all || \ + systemctl list-unit-files; } 2>/dev/null | \ + awk '$1 ~ /\.service$/ { sub("\\.service$", "", $1); print $1 }') ) if [[ -x /sbin/upstart-udev-bridge ]]; then - COMPREPLY+=( $( initctl list 2>/dev/null | cut -d' ' -f1 ) ) + COMPREPLY+=( $(initctl list 2>/dev/null | cut -d' ' -f1) ) fi - COMPREPLY=( $( compgen -W '${COMPREPLY[@]#${sysvdirs[0]}/}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]#${sysvdirs[0]}/}' -- "$cur") ) } # This completes on a list of all available service scripts for the @@ -1173,9 +1172,9 @@ _service() else local sysvdirs _sysvdirs - COMPREPLY=( $( compgen -W '`command sed -e "y/|/ /" \ + COMPREPLY=( $(compgen -W '`command sed -e "y/|/ /" \ -ne "s/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\2/p" \ - ${sysvdirs[0]}/${prev##*/} 2>/dev/null` start stop' -- "$cur" ) ) + ${sysvdirs[0]}/${prev##*/} 2>/dev/null` start stop' -- "$cur") ) fi } && complete -F _service service @@ -1193,16 +1192,16 @@ _modules() { local modpath modpath=/lib/modules/$1 - COMPREPLY=( $( compgen -W "$( command ls -RL $modpath 2>/dev/null | \ - command sed -ne 's/^\(.*\)\.k\{0,1\}o\(\.[gx]z\)\{0,1\}$/\1/p' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(command ls -RL $modpath 2>/dev/null | \ + command sed -ne 's/^\(.*\)\.k\{0,1\}o\(\.[gx]z\)\{0,1\}$/\1/p')" -- "$cur") ) } # This function completes on installed modules # _installed_modules() { - COMPREPLY=( $( compgen -W "$( PATH="$PATH:/sbin" lsmod | \ - awk '{if (NR != 1) print $1}' )" -- "$1" ) ) + COMPREPLY=( $(compgen -W "$(PATH="$PATH:/sbin" lsmod | \ + awk '{if (NR != 1) print $1}')" -- "$1") ) } # This function completes on user or user:group format; as for chown and cpio. @@ -1229,9 +1228,9 @@ _usergroup() _allowed_groups "$mycur" else local IFS=$'\n' - COMPREPLY=( $( compgen -g -- "$mycur" ) ) + COMPREPLY=( $(compgen -g -- "$mycur") ) fi - COMPREPLY=( $( compgen -P "$prefix" -W "${COMPREPLY[@]}" ) ) + COMPREPLY=( $(compgen -P "$prefix" -W "${COMPREPLY[@]}") ) elif [[ $cur == *:* ]]; then # Completing group after 'user:gr'. # Reply with a list of unprefixed groups since readline with split on : @@ -1241,7 +1240,7 @@ _usergroup() _allowed_groups "$mycur" else local IFS=$'\n' - COMPREPLY=( $( compgen -g -- "$mycur" ) ) + COMPREPLY=( $(compgen -g -- "$mycur") ) fi else # Completing a partial 'usernam'. @@ -1253,7 +1252,7 @@ _usergroup() _allowed_users "$cur" else local IFS=$'\n' - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) fi fi } @@ -1262,11 +1261,11 @@ _allowed_users() { if _complete_as_root; then local IFS=$'\n' - COMPREPLY=( $( compgen -u -- "${1:-$cur}" ) ) + COMPREPLY=( $(compgen -u -- "${1:-$cur}") ) else local IFS=$'\n ' - COMPREPLY=( $( compgen -W \ - "$( id -un 2>/dev/null || whoami 2>/dev/null )" -- "${1:-$cur}" ) ) + COMPREPLY=( $(compgen -W \ + "$(id -un 2>/dev/null || whoami 2>/dev/null)" -- "${1:-$cur}") ) fi } @@ -1274,11 +1273,11 @@ _allowed_groups() { if _complete_as_root; then local IFS=$'\n' - COMPREPLY=( $( compgen -g -- "$1" ) ) + COMPREPLY=( $(compgen -g -- "$1") ) else local IFS=$'\n ' - COMPREPLY=( $( compgen -W \ - "$( id -Gn 2>/dev/null || groups 2>/dev/null )" -- "$1" ) ) + COMPREPLY=( $(compgen -W \ + "$(id -Gn 2>/dev/null || groups 2>/dev/null)" -- "$1") ) fi } @@ -1300,18 +1299,18 @@ _fstypes() if [[ -e /proc/filesystems ]]; then # Linux - fss="$( cut -d$'\t' -f2 /proc/filesystems ) - $( awk '! /\*/ { print $NF }' /etc/filesystems 2>/dev/null )" + fss="$(cut -d$'\t' -f2 /proc/filesystems) + $(awk '! /\*/ { print $NF }' /etc/filesystems 2>/dev/null)" else # Generic - fss="$( awk '/^[ \t]*[^#]/ { print $3 }' /etc/fstab 2>/dev/null ) - $( awk '/^[ \t]*[^#]/ { print $3 }' /etc/mnttab 2>/dev/null ) - $( awk '/^[ \t]*[^#]/ { print $4 }' /etc/vfstab 2>/dev/null ) - $( awk '{ print $1 }' /etc/dfs/fstypes 2>/dev/null ) - $( [[ -d /etc/fs ]] && command ls /etc/fs )" + fss="$(awk '/^[ \t]*[^#]/ { print $3 }' /etc/fstab 2>/dev/null) + $(awk '/^[ \t]*[^#]/ { print $3 }' /etc/mnttab 2>/dev/null) + $(awk '/^[ \t]*[^#]/ { print $4 }' /etc/vfstab 2>/dev/null) + $(awk '{ print $1 }' /etc/dfs/fstypes 2>/dev/null) + $([[ -d /etc/fs ]] && command ls /etc/fs)" fi - [[ -n $fss ]] && COMPREPLY+=( $( compgen -W "$fss" -- "$cur" ) ) + [[ -n $fss ]] && COMPREPLY+=( $(compgen -W "$fss" -- "$cur") ) } # Get real command. @@ -1374,38 +1373,38 @@ _count_args() # _pci_ids() { - COMPREPLY+=( $( compgen -W \ - "$( PATH="$PATH:/sbin" lspci -n | awk '{print $3}')" -- "$cur" ) ) + COMPREPLY+=( $(compgen -W \ + "$(PATH="$PATH:/sbin" lspci -n | awk '{print $3}')" -- "$cur") ) } # This function completes on USB IDs # _usb_ids() { - COMPREPLY+=( $( compgen -W \ - "$( PATH="$PATH:/sbin" lsusb | awk '{print $6}' )" -- "$cur" ) ) + COMPREPLY+=( $(compgen -W \ + "$(PATH="$PATH:/sbin" lsusb | awk '{print $6}')" -- "$cur") ) } # CD device names _cd_devices() { - COMPREPLY+=( $( compgen -f -d -X "!*/?([amrs])cd*" -- "${cur:-/dev/}" ) ) + COMPREPLY+=( $(compgen -f -d -X "!*/?([amrs])cd*" -- "${cur:-/dev/}") ) } # DVD device names _dvd_devices() { - COMPREPLY+=( $( compgen -f -d -X "!*/?(r)dvd*" -- "${cur:-/dev/}" ) ) + COMPREPLY+=( $(compgen -f -d -X "!*/?(r)dvd*" -- "${cur:-/dev/}") ) } # TERM environment variable values _terms() { - COMPREPLY+=( $( compgen -W \ - "$( command sed -ne 's/^\([^[:space:]#|]\{2,\}\)|.*/\1/p' /etc/termcap \ - 2>/dev/null )" -- "$cur" ) ) - COMPREPLY+=( $( compgen -W "$( { toe -a 2>/dev/null || toe 2>/dev/null; } \ - | awk '{ print $1 }' | sort -u )" -- "$cur" ) ) + COMPREPLY+=( $(compgen -W \ + "$(command sed -ne 's/^\([^[:space:]#|]\{2,\}\)|.*/\1/p' /etc/termcap \ + 2>/dev/null)" -- "$cur") ) + COMPREPLY+=( $(compgen -W "$({ toe -a 2>/dev/null || toe 2>/dev/null; } \ + | awk '{ print $1 }' | sort -u)" -- "$cur") ) } # a little help for FreeBSD ports users @@ -1423,7 +1422,7 @@ _user_at_host() if [[ $cur == *@* ]]; then _known_hosts_real "$cur" else - COMPREPLY=( $( compgen -u -S @ -- "$cur" ) ) + COMPREPLY=( $(compgen -u -S @ -- "$cur") ) compopt -o nospace fi } @@ -1452,7 +1451,7 @@ _included_ssh_config_files() [[ $# -lt 1 ]] && echo "error: $FUNCNAME: missing mandatory argument CONFIG" local configfile i f configfile=$1 - local included=$( command sed -ne 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:blank:]]\{1,\}\([^#%]*\)\(#.*\)\{0,1\}$/\1/p' "${configfile}" ) + local included=$(command sed -ne 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:blank:]]\{1,\}\([^#%]*\)\(#.*\)\{0,1\}$/\1/p' "${configfile}") for i in ${included[@]}; do # Check the origin of $configfile to complete relative included paths on included # files according to ssh_config(5): @@ -1539,7 +1538,7 @@ _known_hosts_real() # TODO(?): try to make known hosts files with more than one consecutive # spaces in their name work (watch out for ~ expansion # breakage! Alioth#311595) - tmpkh=( $( awk 'sub("^[ \t]*([Gg][Ll][Oo][Bb][Aa][Ll]|[Uu][Ss][Ee][Rr])[Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee][ \t]+", "") { print $0 }' "${config[@]}" | sort -u ) ) + tmpkh=( $(awk 'sub("^[ \t]*([Gg][Ll][Oo][Bb][Aa][Ll]|[Uu][Ss][Ee][Rr])[Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee][ \t]+", "") { print $0 }' "${config[@]}" | sort -u) ) IFS=$OIFS for i in "${tmpkh[@]}"; do # First deal with quoted entries... @@ -1595,7 +1594,7 @@ _known_hosts_real() IFS=$OIFS done < "$i" done - COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") ) fi if [[ ${#khd[@]} -gt 0 ]]; then # Needs to look for files called @@ -1619,9 +1618,9 @@ _known_hosts_real() # append any available aliases from ssh config files if [[ ${#config[@]} -gt 0 && -n "$aliases" ]]; then - local hosts=$( command sed -ne 's/^[[:blank:]]*[Hh][Oo][Ss][Tt][[:blank:]]\{1,\}\([^#*?%]*\)\(#.*\)\{0,1\}$/\1/p' "${config[@]}" ) - COMPREPLY+=( $( compgen -P "$prefix$user" \ - -S "$suffix" -W "$hosts" -- "$cur" ) ) + local hosts=$(command sed -ne 's/^[[:blank:]]*[Hh][Oo][Ss][Tt][[:blank:]]\{1,\}\([^#*?%]*\)\(#.*\)\{0,1\}$/\1/p' "${config[@]}") + COMPREPLY+=( $(compgen -P "$prefix$user" \ + -S "$suffix" -W "$hosts" -- "$cur") ) fi # Add hosts reported by avahi-browse, if desired and it's available. @@ -1632,21 +1631,21 @@ _known_hosts_real() # if it contains ";", it may mistify the result. But on Gentoo (at # least), -k wasn't available (even if mentioned in the manpage) some # time ago, so... - COMPREPLY+=( $( compgen -P "$prefix$user" -S "$suffix" -W \ - "$( avahi-browse -cpr _workstation._tcp 2>/dev/null | \ - awk -F';' '/^=/ { print $7 }' | sort -u )" -- "$cur" ) ) + COMPREPLY+=( $(compgen -P "$prefix$user" -S "$suffix" -W \ + "$(avahi-browse -cpr _workstation._tcp 2>/dev/null | \ + awk -F';' '/^=/ { print $7 }' | sort -u)" -- "$cur") ) fi # Add hosts reported by ruptime. - COMPREPLY+=( $( compgen -W \ - "$( ruptime 2>/dev/null | awk '!/^ruptime:/ { print $1 }' )" \ - -- "$cur" ) ) + COMPREPLY+=( $(compgen -W \ + "$(ruptime 2>/dev/null | awk '!/^ruptime:/ { print $1 }')" \ + -- "$cur") ) # Add results of normal hostname completion, unless # `COMP_KNOWN_HOSTS_WITH_HOSTFILE' is set to an empty value. if [[ -n ${COMP_KNOWN_HOSTS_WITH_HOSTFILE-1} ]]; then COMPREPLY+=( - $( compgen -A hostname -P "$prefix$user" -S "$suffix" -- "$cur" ) ) + $(compgen -A hostname -P "$prefix$user" -S "$suffix" -- "$cur") ) fi if [[ $ipv4 ]]; then @@ -1693,7 +1692,7 @@ _cd() for i in ${CDPATH//:/$'\n'}; do # create an array of matched subdirs k="${#COMPREPLY[@]}" - for j in $( compgen -d -- $i/$cur ); do + for j in $(compgen -d -- $i/$cur); do if [[ ( $mark_symdirs && -h $j || $mark_dirs && ! -h $j ) && ! -d ${j#$i/} ]]; then j+="/" fi @@ -1772,21 +1771,21 @@ _command_offset() if [[ $COMP_CWORD -eq 0 ]]; then local IFS=$'\n' compopt -o filenames - COMPREPLY=( $( compgen -d -c -- "$cur" ) ) + COMPREPLY=( $(compgen -d -c -- "$cur") ) else local cmd=${COMP_WORDS[0]} compcmd=${COMP_WORDS[0]} - local cspec=$( complete -p $cmd 2>/dev/null ) + local cspec=$(complete -p $cmd 2>/dev/null) # If we have no completion for $cmd yet, see if we have for basename if [[ ! $cspec && $cmd == */* ]]; then - cspec=$( complete -p ${cmd##*/} 2>/dev/null ) + cspec=$(complete -p ${cmd##*/} 2>/dev/null) [[ $cspec ]] && compcmd=${cmd##*/} fi # If still nothing, just load it for the basename if [[ ! $cspec ]]; then compcmd=${cmd##*/} _completion_loader $compcmd - cspec=$( complete -p $compcmd 2>/dev/null ) + cspec=$(complete -p $compcmd 2>/dev/null) fi if [[ -n $cspec ]]; then @@ -1815,7 +1814,7 @@ _command_offset() else cspec=${cspec#complete} cspec=${cspec%%$compcmd} - COMPREPLY=( $( eval compgen "$cspec" -- '$cur' ) ) + COMPREPLY=( $(eval compgen "$cspec" -- '$cur') ) fi elif [[ ${#COMPREPLY[@]} -eq 0 ]]; then # XXX will probably never happen as long as completion loader loads @@ -1859,8 +1858,8 @@ _longopt() return ;; --+([-a-z0-9_])) - local argtype=$( LC_ALL=C $1 --help 2>&1 | command sed -ne \ - "s|.*$prev\[\{0,1\}=[<[]\{0,1\}\([-A-Za-z0-9_]\{1,\}\).*|\1|p" ) + local argtype=$(LC_ALL=C $1 --help 2>&1 | command sed -ne \ + "s|.*$prev\[\{0,1\}=[<[]\{0,1\}\([-A-Za-z0-9_]\{1,\}\).*|\1|p") case ${argtype,,} in *dir*) _filedir -d @@ -1877,11 +1876,11 @@ _longopt() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$( LC_ALL=C $1 --help 2>&1 | \ + COMPREPLY=( $(compgen -W "$(LC_ALL=C $1 --help 2>&1 | \ while read -r line; do \ [[ $line =~ --[-A-Za-z0-9]+=? ]] && \ printf '%s\n' ${BASH_REMATCH[0]} - done )" -- "$cur" ) ) + done)" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace elif [[ "$1" == @(rmdir|chroot) ]]; then _filedir -d @@ -1943,7 +1942,7 @@ _filedir_xspec() # Try without filter if it failed to produce anything and configured to [[ -n ${COMP_FILEDIR_FALLBACK:-} && ${#toks[@]} -lt 1 ]] && { local reset=$(shopt -po noglob); set -o noglob - toks+=( $( compgen -f -- "$(quote_readline "$cur")" ) ) + toks+=( $(compgen -f -- "$(quote_readline "$cur")") ) IFS=' '; $reset; IFS=$'\n' } diff --git a/completions/2to3 b/completions/2to3 index 4dd29bf4810..049ba65b20b 100644 --- a/completions/2to3 +++ b/completions/2to3 @@ -10,12 +10,12 @@ _2to3() return ;; -f|--fix|-x|--nofix) - COMPREPLY=( $( compgen -W \ - "$( $1 --list-fixes 2>/dev/null | command sed -e 1d )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + "$($1 --list-fixes 2>/dev/null | command sed -e 1d)" -- "$cur") ) return ;; -j|--processes) - COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "{1..$(_ncpus)}" -- "$cur") ) return ;; -o|--output-dir) @@ -27,7 +27,7 @@ _2to3() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/7z b/completions/7z index 7bef5254e64..4a82e5f7a5d 100644 --- a/completions/7z +++ b/completions/7z @@ -6,7 +6,7 @@ _7z() _init_completion -n = || return if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'a b d e l t u x' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'a b d e l t u x' -- "$cur") ) return fi @@ -15,7 +15,7 @@ _7z() case $cur in -ao*) - COMPREPLY=( $( compgen -P${cur:0:3} -W 'a s t u' -- "${cur:3}" ) ) + COMPREPLY=( $(compgen -P${cur:0:3} -W 'a s t u' -- "${cur:3}") ) return ;; -?(a)[ix]*) @@ -26,11 +26,11 @@ _7z() opt=${cur:0:2} cur=${cur:2} fi if [[ $cur != *[@\!]* ]]; then - COMPREPLY=( $( compgen -P$opt -W '@ ! r@ r-@ r0@ r! r-! r0!' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -P$opt -W '@ ! r@ r-@ r0@ r! r-! r0!' \ + -- "$cur") ) elif [[ $cur == ?(r@(-|0|))@* ]]; then local x tmp - x=$( compgen -P"${opt}${cur%%@*}@" -f -- "${cur#*@}" ) && + x=$(compgen -P"${opt}${cur%%@*}@" -f -- "${cur#*@}") && while read -r tmp; do COMPREPLY+=( "$tmp" ) done <<< "$x" @@ -39,16 +39,16 @@ _7z() return ;; -mhe=*|-mhc=*|-ms=*|-mt=*) - COMPREPLY=( $( compgen -W 'on off' -- "${cur#*=}" ) ) + COMPREPLY=( $(compgen -W 'on off' -- "${cur#*=}") ) return ;; -mx=*) - COMPREPLY=( $( compgen -W '0 1 3 5 7 9' -- "${cur#*=}" ) ) + COMPREPLY=( $(compgen -W '0 1 3 5 7 9' -- "${cur#*=}") ) return ;; -o*|-w?*) local x tmp - x=$( compgen -P${cur:0:2} -S/ -d -- "${cur:2}" ) && + x=$(compgen -P${cur:0:2} -S/ -d -- "${cur:2}") && while read -r tmp; do COMPREPLY+=( "$tmp" ) done <<< "$x" @@ -56,28 +56,28 @@ _7z() return ;; -r?*) - COMPREPLY=( $( compgen -P${cur:0:2} -W '- 0' -- "${cur:2}" ) ) + COMPREPLY=( $(compgen -P${cur:0:2} -W '- 0' -- "${cur:2}") ) return ;; -scs*) - COMPREPLY=( $( compgen -P${cur:0:4} -W 'UTF-8 WIN DOS' \ - -- "${cur:4}" ) ) + COMPREPLY=( $(compgen -P${cur:0:4} -W 'UTF-8 WIN DOS' \ + -- "${cur:4}") ) return ;; -ssc?*) - COMPREPLY=( $( compgen -P${cur:0:4} -W '-' -- "${cur:4}" ) ) + COMPREPLY=( $(compgen -P${cur:0:4} -W '-' -- "${cur:4}") ) return ;; -t*) if [[ $mode == w ]]; then - COMPREPLY=( $( compgen -P${cur:0:2} -W '7z bzip2 gzip swfc - tar wim xz zip' -- "${cur:2}" ) ) + COMPREPLY=( $(compgen -P${cur:0:2} -W '7z bzip2 gzip swfc + tar wim xz zip' -- "${cur:2}") ) else - COMPREPLY=( $( compgen -P${cur:0:2} -W '7z apm arj bzip2 cab + COMPREPLY=( $(compgen -P${cur:0:2} -W '7z apm arj bzip2 cab chm cpio cramfs deb dmg elf fat flv gzip hfs iso lzh lzma lzma86 macho mbr mslz mub nsis ntfs pe ppmd rar rpm squashfs swf swfc tar udf vhd wim xar xz z zip' \ - -- "${cur:2}" ) ) + -- "${cur:2}") ) fi return ;; @@ -87,9 +87,9 @@ _7z() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '-ai -an -ao -ax -bd -i -m{x,s,f,he,hc,mt}= + COMPREPLY=( $(compgen -W '-ai -an -ao -ax -bd -i -m{x,s,f,he,hc,mt}= -o -p -r -scs -sfx -si -slp -slt -so -ssc -t -u -v -w -x -y' \ - -- "$cur" ) ) + -- "$cur") ) [[ $COMPREPLY == -@(an|bd|sfx|si|slt|so|ssc|[rwy]) ]] || compopt -o nospace return @@ -105,9 +105,9 @@ _7z() else if [[ ${words[1]} == d ]]; then local IFS=$'\n' - COMPREPLY=( $( compgen -W "$( printf '%s\n' $( $1 l ${words[2]} \ + COMPREPLY=( $(compgen -W "$(printf '%s\n' $($1 l ${words[2]} \ -slt 2>/dev/null | command sed -n '/^Path =/s/^Path = \(.*\)$/\1/p' \ - 2>/dev/null | tail -n+2 ) )" -- "$cur" ) ) + 2>/dev/null | tail -n+2))" -- "$cur") ) compopt -o filenames else _filedir diff --git a/completions/_adb b/completions/_adb index 8db1b9d6fe1..52b2cb96e89 100644 --- a/completions/_adb +++ b/completions/_adb @@ -5,9 +5,9 @@ _adb_command_usage() { - COMPREPLY=( $( compgen -W \ - '$( "$1" help 2>&1 | command grep "^ *\(adb \)\? *$2 " \ - | command sed -e "s/[]|[]/\n/g" | _parse_help - )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$("$1" help 2>&1 | command grep "^ *\(adb \)\? *$2 " \ + | command sed -e "s/[]|[]/\n/g" | _parse_help -)' -- "$cur") ) } _adb() @@ -36,13 +36,13 @@ _adb() if [[ ! "$cmd" ]]; then local tmp=() if [[ ! $cur || $cur == -* ]]; then - tmp+=( $( compgen -W '$( _parse_help "$1" help )' -- "$cur" ) ) + tmp+=( $(compgen -W '$(_parse_help "$1" help)' -- "$cur") ) fi if [[ ! $cur || $cur != -* ]]; then - tmp+=( $( $1 help 2>&1 | awk '$1 == "adb" { print $2 }' ) ) + tmp+=( $($1 help 2>&1 | awk '$1 == "adb" { print $2 }') ) tmp+=( devices connect disconnect sideload ) fi - COMPREPLY=( $( compgen -W '${tmp[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${tmp[@]}' -- "$cur") ) return fi @@ -55,12 +55,12 @@ _adb() _filedir ;; forward) - COMPREPLY=( $( compgen -W \ - '$( "$1" help 2>&1 | command sed -ne "s/^ *adb *forward *-/-/p" | \ - _parse_help - )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$("$1" help 2>&1 | command sed -ne "s/^ *adb *forward *-/-/p" | \ + _parse_help -)' -- "$cur") ) ;; reboot) - COMPREPLY=( $( compgen -W 'bootloader recovery' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'bootloader recovery' -- "$cur") ) ;; esac } && diff --git a/completions/_cal b/completions/_cal index dfe49903cf1..9aefa704780 100644 --- a/completions/_cal +++ b/completions/_cal @@ -11,7 +11,7 @@ _cal() case $prev in -m) if [[ $OSTYPE == *bsd* ]]; then - COMPREPLY=( $( compgen -W '{1..12}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{1..12}' -- "$cur") ) return fi ;; @@ -24,13 +24,13 @@ _cal() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) return fi local args _count_args - [[ $args -eq 1 ]] && COMPREPLY=( $( compgen -W '{1..12}' -- "$cur" ) ) + [[ $args -eq 1 ]] && COMPREPLY=( $(compgen -W '{1..12}' -- "$cur") ) } && complete -F _cal cal ncal diff --git a/completions/_chsh b/completions/_chsh index 88e8522ed65..48473fe8400 100644 --- a/completions/_chsh +++ b/completions/_chsh @@ -19,7 +19,7 @@ _chsh() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) else _allowed_users fi diff --git a/completions/_dmesg b/completions/_dmesg index 2ca7fdf17bd..9740932717a 100644 --- a/completions/_dmesg +++ b/completions/_dmesg @@ -15,19 +15,19 @@ _dmesg() return ;; -f|--facility) - COMPREPLY=( $( compgen -W 'kern user mail daemon auth syslog lpr - news' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'kern user mail daemon auth syslog lpr + news' -- "$cur") ) return ;; -l|--level|-n|--console-level) - COMPREPLY=( $( compgen -W '{1..8}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{1..8}' -- "$cur") ) return ;; esac - local opts=$( _parse_help "$1" ) - [[ $opts ]] || opts=$( _parse_usage "$1" ) - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + local opts=$(_parse_help "$1") + [[ $opts ]] || opts=$(_parse_usage "$1") + COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) } && complete -F _dmesg dmesg diff --git a/completions/_eject b/completions/_eject index 8f800f15591..3c5838dc926 100644 --- a/completions/_eject +++ b/completions/_eject @@ -13,13 +13,13 @@ _eject() return ;; -a|--auto|-i|--manualeject) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on off' -- "$cur") ) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return elif [[ $prev == @(-d|--default) ]]; then return diff --git a/completions/_hexdump b/completions/_hexdump index ed5cb08b6c6..bfd0a62a059 100644 --- a/completions/_hexdump +++ b/completions/_hexdump @@ -19,9 +19,9 @@ _hexdump() esac if [[ $cur == -* ]]; then - local opts="$( _parse_help "$1" )" - [[ $opts ]] || opts="$( _parse_usage "$1" )" - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + local opts="$(_parse_help "$1")" + [[ $opts ]] || opts="$(_parse_usage "$1")" + COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) return fi diff --git a/completions/_hwclock b/completions/_hwclock index 2d190283dc9..86a293460e4 100644 --- a/completions/_hwclock +++ b/completions/_hwclock @@ -19,7 +19,7 @@ _hwclock() esac COMPREPLY=( - $( PATH="$PATH:/sbin" compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + $(PATH="$PATH:/sbin" compgen -W '$(_parse_help "$1")' -- "$cur") ) } && complete -F _hwclock hwclock diff --git a/completions/_ionice b/completions/_ionice index 9b378ee8a5c..1aa51f2ab04 100644 --- a/completions/_ionice +++ b/completions/_ionice @@ -37,11 +37,11 @@ _ionice() case $prev in -c) - COMPREPLY=( $( compgen -W '{0..3}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..3}' -- "$cur") ) return ;; -n) - COMPREPLY=( $( compgen -W '{0..7}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..7}' -- "$cur") ) return ;; -p) @@ -51,7 +51,7 @@ _ionice() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) return fi } && diff --git a/completions/_look b/completions/_look index 6ea41cce0e9..074e924a8aa 100644 --- a/completions/_look +++ b/completions/_look @@ -9,7 +9,7 @@ _look() _init_completion || return if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W '$(look "$cur" 2>/dev/null)' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(look "$cur" 2>/dev/null)' -- "$cur") ) fi } && complete -F _look -o default look diff --git a/completions/_mock b/completions/_mock index 9649d306e1e..2377e3a68b8 100644 --- a/completions/_mock +++ b/completions/_mock @@ -27,7 +27,7 @@ _mock() return ;; -r|--root) - COMPREPLY=( $( compgen -W "$( command ls $cfgdir )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(command ls $cfgdir)" -- "$cur") ) COMPREPLY=( ${COMPREPLY[@]/%.cfg/} ) return ;; @@ -44,13 +44,13 @@ _mock() # (e.g. ix86 chroot builds in x86_64 mock host) # This would actually depend on what the target root # can be used to build for... - COMPREPLY=( $( compgen -W "$( command rpm --showrc | \ - command sed -ne 's/^\s*compatible\s\s*archs\s*:\s*\(.*\)/\1/i p' )" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(command rpm --showrc | \ + command sed -ne 's/^\s*compatible\s\s*archs\s*:\s*\(.*\)/\1/i p')" \ + -- "$cur") ) return ;; --enable-plugin|--disable-plugin) - COMPREPLY=( $( compgen -W "$plugins" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$plugins" -- "$cur") ) return ;; esac @@ -58,7 +58,7 @@ _mock() $split && return if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else _filedir '@(?(no)src.r|s)pm' diff --git a/completions/_modules b/completions/_modules index 9e48589b640..36fffdf60c2 100644 --- a/completions/_modules +++ b/completions/_modules @@ -23,22 +23,22 @@ _module_list () { - local modules="$( command sed 's/:/ /g' <<<$LOADEDMODULES | sort )" + local modules="$(command sed 's/:/ /g' <<<$LOADEDMODULES | sort)" compgen -W "$modules" -- $1 } _module_path () { - local modules="$( command sed 's/:/ /g' <<<$MODULEPATH | sort )" + local modules="$(command sed 's/:/ /g' <<<$MODULEPATH | sort)" compgen -W "$modules" -- $1 } _module_avail () { - local modules="$( \ + local modules="$(\ module avail 2>&1 | \ command grep -E -v '^(-|$)' | \ - xargs printf '%s\n' | command sed -e 's/(default)//g' | sort )" + xargs printf '%s\n' | command sed -e 's/(default)//g' | sort)" compgen -W "$modules" -- $1 } @@ -53,8 +53,8 @@ _module () # First parameter on line -- we expect it to be a mode selection local options - options="$( module help 2>&1 | command grep -E '^[[:space:]]*\+' | \ - awk '{print $2}' | command sed -e 's/|/ /g' | sort )" + options="$(module help 2>&1 | command grep -E '^[[:space:]]*\+' | \ + awk '{print $2}' | command sed -e 's/|/ /g' | sort)" COMPREPLY=( $(compgen -W "$options" -- "$cur") ) diff --git a/completions/_mount b/completions/_mount index ecd619f5a75..494f97ba99d 100644 --- a/completions/_mount +++ b/completions/_mount @@ -33,8 +33,8 @@ _mount() if [[ "$cur" == *:* ]]; then for sm in "$(type -P showmount)" {,/usr}/{,s}bin/showmount; do [[ -x $sm ]] || continue - COMPREPLY=( $( compgen -W "$( "$sm" -e ${cur%%:*} | \ - awk 'NR>1 {print $1}' )" -- "${cur#*:}" ) ) + COMPREPLY=( $(compgen -W "$("$sm" -e ${cur%%:*} | \ + awk 'NR>1 {print $1}')" -- "${cur#*:}") ) return done fi @@ -43,21 +43,21 @@ _mount() host=${cur#//} host=${host%%/*} if [[ -n $host ]]; then - COMPREPLY=( $( compgen -P "//$host" -W \ - "$( smbclient -d 0 -NL $host 2>/dev/null | + COMPREPLY=( $(compgen -P "//$host" -W \ + "$(smbclient -d 0 -NL $host 2>/dev/null | command sed -ne '/^[[:blank:]]*Sharename/,/^$/p' | - command sed -ne '3,$s|^[^A-Za-z]*\([^[:blank:]]*\).*$|/\1|p' )" \ - -- "${cur#//$host}" ) ) + command sed -ne '3,$s|^[^A-Za-z]*\([^[:blank:]]*\).*$|/\1|p')" \ + -- "${cur#//$host}") ) fi elif [[ -r /etc/vfstab ]]; then # Solaris - COMPREPLY=( $( compgen -W "$( awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' /etc/vfstab )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' /etc/vfstab)" -- "$cur") ) elif [[ ! -e /etc/fstab ]]; then # probably Cygwin - COMPREPLY=( $( compgen -W "$( $1 | awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 | awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}')" -- "$cur") ) else # probably BSD - COMPREPLY=( $( compgen -W "$( awk '! /^[ \t]*#/ {if ($2 ~ /\//) print $2}' /etc/fstab )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(awk '! /^[ \t]*#/ {if ($2 ~ /\//) print $2}' /etc/fstab)" -- "$cur") ) fi } && complete -F _mount -o default -o dirnames mount diff --git a/completions/_mount.linux b/completions/_mount.linux index a8f0bf0e4cb..c74aaec6020 100644 --- a/completions/_mount.linux +++ b/completions/_mount.linux @@ -18,11 +18,11 @@ _mount() cur="${cur##*,}" split=true fi - COMPREPLY=( $( compgen -W 'auto adfs affs autofs btrfs cifs coda + COMPREPLY=( $(compgen -W 'auto adfs affs autofs btrfs cifs coda 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" ) ) + udf ufs umsdos usbfs vfat xfs' -- "$cur") ) _fstypes $split && COMPREPLY=( ${COMPREPLY[@]/#/$prev,} ) return @@ -37,13 +37,13 @@ _mount() return ;; -L) - COMPREPLY=( $( cd "/dev/disk/by-label/" 2>/dev/null || return; \ - compgen -f -- "$cur" ) ) + COMPREPLY=( $(cd "/dev/disk/by-label/" 2>/dev/null || return; \ + compgen -f -- "$cur") ) return ;; -U) - COMPREPLY=( $( cd "/dev/disk/by-uuid/" 2>/dev/null || return; \ - compgen -f -- "$cur" ) ) + COMPREPLY=( $(cd "/dev/disk/by-uuid/" 2>/dev/null || return; \ + compgen -f -- "$cur") ) return ;; -O|--test-opts) @@ -209,10 +209,10 @@ _mount() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version --help --verbose --all --fork + COMPREPLY=( $(compgen -W '--version --help --verbose --all --fork --fake --internal-only -l --no-mtab --no-canonicalize --pass-fd -s --read-only --rw -L -U --types --test-opts --options --bind --rbind - --move' -- "$cur" ) ) + --move' -- "$cur") ) [[ $COMPREPLY ]] && return fi @@ -223,8 +223,8 @@ _mount() if [[ "$cur" == *:* ]]; then for sm in "$(type -P showmount)" {,/usr}/{,s}bin/showmount; do [[ -x $sm ]] || continue - COMPREPLY=( $( compgen -W "$( "$sm" -e ${cur%%:*} | \ - awk 'NR>1 {print $1}' )" -- "${cur#*:}" ) ) + COMPREPLY=( $(compgen -W "$("$sm" -e ${cur%%:*} | \ + awk 'NR>1 {print $1}')" -- "${cur#*:}") ) return done fi @@ -233,11 +233,11 @@ _mount() host=${cur#//} host=${host%%/*} if [[ -n $host ]]; then - COMPREPLY=( $( compgen -P "//$host" -W \ - "$( smbclient -d 0 -NL $host 2>/dev/null | + COMPREPLY=( $(compgen -P "//$host" -W \ + "$(smbclient -d 0 -NL $host 2>/dev/null | command sed -ne '/^[[:blank:]]*Sharename/,/^$/p' | command sed -ne '3,$s|^[^A-Za-z]*\([^[:blank:]]*\).*$|/\1|p' )" \ - -- "${cur#//$host}" ) ) + -- "${cur#//$host}") ) fi fi diff --git a/completions/_nmcli b/completions/_nmcli index f77f050583f..f2da67d8585 100644 --- a/completions/_nmcli +++ b/completions/_nmcli @@ -5,33 +5,33 @@ _nmcli_list() { - COMPREPLY=( $( compgen -W '$1' -- "$cur" ) ) + 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" ) ) + 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" ) ) + 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" ) ) + 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" ) ) + COMPREPLY=( $(compgen -W "$(nmcli dev wifi list 2>/dev/null | \ + tail -n +2 | awk -F ' {2,}' '{print $2}')" -- "$cur") ) } _nmcli() @@ -41,11 +41,11 @@ _nmcli() case $prev in -m|--mode) - COMPREPLY=( $( compgen -W 'tabular multiline' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'tabular multiline' -- "$cur") ) return ;; -f|--fields) - COMPREPLY=( $( compgen -W 'all common' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'all common' -- "$cur") ) return ;; -e|--escape) @@ -76,10 +76,10 @@ _nmcli() if [[ $cword -eq 1 ]] ; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--terse --pretty --mode --fields - --escape --version --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--terse --pretty --mode --fields + --escape --version --help' -- "$cur") ) else - COMPREPLY=( $( compgen -W "nm con dev" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "nm con dev" -- "$cur") ) fi else local object=${words[1]} @@ -110,50 +110,50 @@ _nmcli() ;; esac - COMPREPLY=( $( compgen -W 'status permissions enable sleep - wifi wwan wimax' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'status permissions enable sleep + wifi wwan wimax' -- "$cur") ) ;; con) case $command in list) - COMPREPLY=( $( compgen -W 'id uuid' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'id uuid' -- "$cur") ) return ;; up) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--nowait --timeout' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--nowait --timeout' \ + -- "$cur") ) else - COMPREPLY=( $( compgen -W 'id uuid iface ap nsp' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'id uuid iface ap nsp' \ + -- "$cur") ) fi return ;; down) - COMPREPLY=( $( compgen -W 'id uuid' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'id uuid' -- "$cur") ) return ;; delete) - COMPREPLY=( $( compgen -W 'id uuid' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'id uuid' -- "$cur") ) return ;; esac - COMPREPLY=( $( compgen -W 'list status up down delete' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'list status up down delete' \ + -- "$cur") ) ;; dev) case $command in list) - COMPREPLY=( $( compgen -W 'iface' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'iface' -- "$cur") ) return ;; disconnect) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--nowait --timeout' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--nowait --timeout' \ + -- "$cur") ) else - COMPREPLY=( $( compgen -W 'iface' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'iface' -- "$cur") ) fi return ;; @@ -162,34 +162,34 @@ _nmcli() case $subcommand in list) - COMPREPLY=( $( compgen -W 'iface bssid' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'iface bssid' \ + -- "$cur") ) return ;; connect) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--private - --nowait --timeout' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--private + --nowait --timeout' -- "$cur") ) else if [[ "$prev" == "connect" ]]; then _nmcli_ap_ssid else - COMPREPLY=( $( compgen -W 'password + COMPREPLY=( $(compgen -W 'password wep-key-type iface bssid name' \ - -- "$cur" ) ) + -- "$cur") ) fi fi return ;; esac - COMPREPLY=( $( compgen -W 'list connect' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'list connect' -- "$cur") ) return ;; esac - COMPREPLY=( $( compgen -W 'status list disconnect wifi' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'status list disconnect wifi' \ + -- "$cur") ) ;; esac diff --git a/completions/_repomanage b/completions/_repomanage index c1072e795f7..5967d25de28 100644 --- a/completions/_repomanage +++ b/completions/_repomanage @@ -13,7 +13,7 @@ _repomanage() $split && return if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else _filedir -d diff --git a/completions/_reptyr b/completions/_reptyr index 4a087b49cb6..00cccddd486 100644 --- a/completions/_reptyr +++ b/completions/_reptyr @@ -15,7 +15,7 @@ _reptyr() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi diff --git a/completions/_rfkill b/completions/_rfkill index e807d976dec..a14a3eaf6a0 100644 --- a/completions/_rfkill +++ b/completions/_rfkill @@ -9,18 +9,18 @@ _rfkill() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--version' -- "$cur") ) else case $cword in 1) - COMPREPLY=( $( compgen -W "help event list block unblock" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "help event list block unblock" \ + -- "$cur") ) ;; 2) if [[ $prev == block || $prev == unblock ]]; then - COMPREPLY=( $( compgen -W "$($1 list | awk -F: \ + COMPREPLY=( $(compgen -W "$($1 list | awk -F: \ '/^[0-9]/ {print $1}') all wifi bluetooth uwb wimax \ - wwan gps" -- "$cur" ) ) + wwan gps" -- "$cur") ) fi ;; esac diff --git a/completions/_rtcwake b/completions/_rtcwake index b03c1244b41..43d264c9111 100644 --- a/completions/_rtcwake +++ b/completions/_rtcwake @@ -13,19 +13,19 @@ _rtcwake() return ;; --mode|-m) - COMPREPLY=( $( compgen -W 'standby mem disk on no off' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'standby mem disk on no off' -- "$cur") ) return ;; --device|-d) - COMPREPLY=( $( command ls -d /dev/rtc?* 2>/dev/null ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]#/dev/}' -- "$cur" ) ) + COMPREPLY=( $(command ls -d /dev/rtc?* 2>/dev/null) ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]#/dev/}' -- "$cur") ) return ;; esac $split && return - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) } && complete -F _rtcwake rtcwake diff --git a/completions/_su b/completions/_su index 2b069498dea..9c0f59c1965 100644 --- a/completions/_su +++ b/completions/_su @@ -21,7 +21,7 @@ _su() # linux-specific completion -c|--command|--session-command) local IFS=$'\n' compopt -o filenames - COMPREPLY=( $( compgen -d -c -- "$cur" ) ) + COMPREPLY=( $(compgen -d -c -- "$cur") ) return ;; esac @@ -29,12 +29,12 @@ _su() # linux-specific completion $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" --help)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) } && complete -F _su su diff --git a/completions/_svn b/completions/_svn index 37b6b2b4035..71062baa843 100644 --- a/completions/_svn +++ b/completions/_svn @@ -18,9 +18,9 @@ _svn() if [[ $cword -eq 1 ]] ; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--version' -- "$cur") ) else - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$commands" -- "$cur") ) fi else @@ -34,8 +34,8 @@ _svn() return ;; --encoding) - COMPREPLY=( $( compgen -W '$( iconv --list | \ - command sed -e "s@//@@;" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(iconv --list | \ + command sed -e "s@//@@;")' -- "$cur") ) return ;; --editor-cmd|--diff-cmd|--diff3-cmd) @@ -196,10 +196,10 @@ _svn() esac options+=" --help --config-dir" - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$options" -- "$cur") ) else if [[ "$command" == @(help|[h?]) ]]; then - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$commands" -- "$cur") ) else _filedir fi diff --git a/completions/_svnadmin b/completions/_svnadmin index 395ae119550..be9316cc7d7 100644 --- a/completions/_svnadmin +++ b/completions/_svnadmin @@ -14,9 +14,9 @@ _svnadmin() if [[ $cword -eq 1 ]] ; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--version' -- "$cur") ) else - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$commands" -- "$cur") ) fi else case $prev in @@ -25,7 +25,7 @@ _svnadmin() return ;; --fs-type) - COMPREPLY=( $( compgen -W 'fsfs bdb' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'fsfs bdb' -- "$cur") ) return ;; esac @@ -62,10 +62,10 @@ _svnadmin() esac options+=" --help" - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$options" -- "$cur") ) else if [[ "$command" == @(help|[h?]) ]]; then - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$commands" -- "$cur") ) else _filedir fi diff --git a/completions/_svnlook b/completions/_svnlook index a4f3424339d..01484391d69 100644 --- a/completions/_svnlook +++ b/completions/_svnlook @@ -14,9 +14,9 @@ _svnlook() if [[ $cword -eq 1 ]] ; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--version' -- "$cur") ) else - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$commands" -- "$cur") ) fi else local command=${words[1]} @@ -47,10 +47,10 @@ _svnlook() esac options+=" --help" - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$options" -- "$cur") ) else if [[ "$command" == @(help|[h?]) ]]; then - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$commands" -- "$cur") ) else _filedir fi diff --git a/completions/_udevadm b/completions/_udevadm index 80424dca606..ce43f1ad563 100644 --- a/completions/_udevadm +++ b/completions/_udevadm @@ -24,12 +24,12 @@ _udevadm() return ;; --log-priority) - COMPREPLY=( $( compgen -W 'err info debug' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'err info debug' -- "$cur") ) return ;; --query) - COMPREPLY=( $( compgen -W 'name symlink path property all' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'name symlink path property all' \ + -- "$cur") ) return ;; --name) @@ -42,11 +42,11 @@ _udevadm() return ;; --action) - COMPREPLY=( $( compgen -W 'add change remove' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'add change remove' -- "$cur") ) return ;; --type) - COMPREPLY=( $( compgen -W 'devices subsystems failed' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'devices subsystems failed' -- "$cur") ) return ;; esac @@ -56,21 +56,19 @@ _udevadm() if [[ -z $udevcmd ]]; then case $cur in -*) - COMPREPLY=( $( compgen -W '--help --version --debug' -- \ - "$cur" ) ) + COMPREPLY=( $(compgen -W '--help --version --debug' -- "$cur") ) ;; *) - COMPREPLY=( $( compgen -W "$( "$1" --help 2>/dev/null | - awk '/^[ \t]/ { print $1 }' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$("$1" --help 2>/dev/null | + awk '/^[ \t]/ { print $1 }')" -- "$cur") ) ;; esac return fi if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W \ - '$( "$1" $udevcmd --help 2>/dev/null | _parse_help - )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$("$1" $udevcmd --help 2>/dev/null | _parse_help -)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && diff --git a/completions/_umount b/completions/_umount index 2c035244505..a5d338bc9a4 100644 --- a/completions/_umount +++ b/completions/_umount @@ -17,7 +17,7 @@ _umount() _init_completion || return local IFS=$'\n' - COMPREPLY=( $( compgen -W '$( mount | cut -d" " -f 3 )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(mount | cut -d" " -f 3)' -- "$cur") ) } && complete -F _umount -o dirnames umount diff --git a/completions/_umount.linux b/completions/_umount.linux index a7c5de5543f..fa34d187206 100644 --- a/completions/_umount.linux +++ b/completions/_umount.linux @@ -72,8 +72,8 @@ _linux_fstab() if [[ $cur && $cur != /* ]]; then local realcur [[ $cur == */ ]] && # don't let readlink drop last / from path - realcur="$( readlink -f "$cur." 2> /dev/null )/" || - realcur=$( readlink -f "$cur" 2> /dev/null ) + realcur="$(readlink -f "$cur." 2> /dev/null)/" || + realcur=$(readlink -f "$cur" 2> /dev/null) if [[ $realcur ]]; then local dirrealcur= dircur= basecur if [[ $cur == */* ]]; then @@ -84,9 +84,9 @@ _linux_fstab() local i n=${#COMPREPLY[@]} for (( i=0; i < $n; i++ )); do [[ "${COMPREPLY[i]}" == "$realcur"* ]] && - COMPREPLY+=( $( cd "$dircur" 2> /dev/null && + COMPREPLY+=( $(cd "$dircur" 2> /dev/null && compgen -f -d -P "$dircur" \ - -X "!${COMPREPLY[i]##"$dirrealcur"}" -- "$basecur" ) ) + -X "!${COMPREPLY[i]##"$dirrealcur"}" -- "$basecur") ) done fi fi @@ -108,11 +108,11 @@ _umount() cur="${cur##*,}" split=true fi - COMPREPLY=( $( compgen -W 'adfs affs autofs btrfs cifs coda + COMPREPLY=( $(compgen -W 'adfs affs autofs btrfs cifs coda cramfs debugfs devpts efs ext2 ext3 ext4 fuse hfs hfsplus hpfs iso9660 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" ) ) + umsdos usbfs vfat xfs' -- "$cur") ) _fstypes $split && COMPREPLY=( ${COMPREPLY[@]/#/$prev,} ) return @@ -124,8 +124,8 @@ _umount() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-V -h -v -n -r -d -i -a -t -O -f -l - --no-canonicalize --fake' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-V -h -v -n -r -d -i -a -t -O -f -l + --no-canonicalize --fake' -- "$cur") ) [[ $COMPREPLY ]] && return fi @@ -135,7 +135,7 @@ _umount() _linux_fstab < /proc/mounts else local IFS=$'\n' - COMPREPLY=( $( compgen -W '$( mount | cut -d" " -f 3 )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(mount | cut -d" " -f 3)' -- "$cur") ) fi } && complete -F _umount -o dirnames umount diff --git a/completions/_xm b/completions/_xm index 99a6ad287b9..eb6ad6b1e2d 100644 --- a/completions/_xm +++ b/completions/_xm @@ -6,14 +6,14 @@ _xen_domain_names() { - COMPREPLY=( $( compgen -W "$( xm list 2>/dev/null | \ - awk '!/Name|Domain-0/ { print $1 }' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(xm list 2>/dev/null | \ + awk '!/Name|Domain-0/ { print $1 }')" -- "$cur") ) } _xen_domain_ids() { - COMPREPLY=( $( compgen -W "$( xm list 2>/dev/null | \ - awk '!/Name|Domain-0/ { print $2 }' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(xm list 2>/dev/null | \ + awk '!/Name|Domain-0/ { print $2 }')" -- "$cur") ) } _xm() @@ -37,7 +37,7 @@ _xm() resetpolicy getpolicy shell help' if [[ $cword -eq 1 ]] ; then - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$commands" -- "$cur") ) else if [[ "$cur" == *=* ]]; then prev=${cur/=*/} @@ -78,7 +78,7 @@ _xm() -s --skipdtd -p --paused -c --console_autoconnect' ;; esac - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$options" -- "$cur") ) else case $command in console|destroy|domname|domid|list|mem-set|mem-max| \ @@ -123,8 +123,7 @@ _xm() _xen_domain_names ;; 3) - COMPREPLY=( $( compgen -W "r s e i u b" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "r s e i u b" -- "$cur") ) ;; esac ;; @@ -135,11 +134,10 @@ _xm() _xen_domain_names ;; 3) - COMPREPLY=( $( compgen -W "phy: file:" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "phy: file:" -- "$cur") ) ;; 5) - COMPREPLY=( $( compgen -W "w r" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "w r" -- "$cur") ) ;; 6) _xen_domain_names @@ -153,9 +151,9 @@ _xm() _xen_domain_names ;; 3) - COMPREPLY=( $( compgen -W "$( xm block-list $prev \ - 2>/dev/null | awk '!/Vdev/ { print $1 }' )" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(xm block-list $prev \ + 2>/dev/null | awk '!/Vdev/ { print $1 }')" \ + -- "$cur") ) ;; esac ;; @@ -166,8 +164,8 @@ _xm() _xen_domain_names ;; *) - COMPREPLY=( $( compgen -W "script= ip= mac= bridge= - backend=" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "script= ip= mac= bridge= + backend=" -- "$cur") ) ;; esac ;; @@ -178,9 +176,9 @@ _xm() _xen_domain_names ;; 3) - COMPREPLY=( $(compgen -W "$( xm network-list $prev \ - 2>/dev/null | awk '!/Idx/ { print $1 }' )" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(xm network-list $prev \ + 2>/dev/null | awk '!/Idx/ { print $1 }')" \ + -- "$cur") ) ;; esac ;; @@ -195,8 +193,8 @@ _xm() create) _filedir COMPREPLY+=( \ - $( compgen -W '$( command ls /etc/xen 2>/dev/null )' \ - -- "$cur" ) ) + $(compgen -W '$(command ls /etc/xen 2>/dev/null)' \ + -- "$cur") ) ;; new) case $prev in diff --git a/completions/_yum b/completions/_yum index f3a104bdbab..b233255076b 100644 --- a/completions/_yum +++ b/completions/_yum @@ -8,13 +8,13 @@ _yum_list() if [[ "$1" == all ]] ; then # Try to strip in between headings like "Available Packages" # This will obviously only work for English :P - COMPREPLY=( $( yum -d 0 -C list $1 "$cur*" 2>/dev/null | \ + COMPREPLY=( $(yum -d 0 -C list $1 "$cur*" 2>/dev/null | \ command sed -ne '/^Available /d' -e '/^Installed /d' -e '/^Updated /d' \ - -e 's/[[:space:]].*//p' ) ) + -e 's/[[:space:]].*//p') ) else # Drop first line (e.g. "Updated Packages") - COMPREPLY=( $( yum -d 0 -C list $1 "$cur*" 2>/dev/null | \ - command sed -ne 1d -e 's/[[:space:]].*//p' ) ) + COMPREPLY=( $(yum -d 0 -C list $1 "$cur*" 2>/dev/null | \ + command sed -ne 1d -e 's/[[:space:]].*//p') ) fi } @@ -75,22 +75,22 @@ _yum() case $prev in list) - COMPREPLY=( $( compgen -W 'all available updates installed extras - obsoletes recent' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'all available updates installed extras + obsoletes recent' -- "$cur") ) ;; clean) - COMPREPLY=( $( compgen -W 'packages headers metadata cache dbcache - all' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'packages headers metadata cache dbcache + all' -- "$cur") ) ;; repolist) - COMPREPLY=( $( compgen -W 'all enabled disabled' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'all enabled disabled' -- "$cur") ) ;; localinstall|localupdate) # TODO: should not match *src.rpm _filedir rpm ;; -d|-e) - COMPREPLY=( $( compgen -W '{0..10}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..10}' -- "$cur") ) ;; -c) _filedir @@ -99,21 +99,20 @@ _yum() _filedir -d ;; --enablerepo) - COMPREPLY=( $( compgen -W '$( _yum_repolist disabled )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_yum_repolist disabled)' -- "$cur") ) ;; --disablerepo) - COMPREPLY=( $( compgen -W '$( _yum_repolist enabled )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_yum_repolist enabled)' -- "$cur") ) ;; --disableexcludes) - COMPREPLY=( $( compgen -W '$( _yum_repolist all ) all main' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_yum_repolist all) all main' \ + -- "$cur") ) ;; --enableplugin|--disableplugin) - COMPREPLY=( $( compgen -W '$( _yum_plugins )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_yum_plugins)' -- "$cur") ) ;; --color) - COMPREPLY=( $( compgen -W 'always auto never' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'always auto never' -- "$cur") ) ;; -R|-x|--exclude) # argument required but no completions available @@ -124,18 +123,18 @@ _yum() return ;; *) - COMPREPLY=( $( compgen -W 'install update check-update upgrade + COMPREPLY=( $(compgen -W 'install update check-update upgrade remove erase list info provides whatprovides clean makecache groupinstall groupupdate grouplist groupremove groupinfo search shell resolvedep localinstall localupdate deplist - repolist help' -- "$cur" ) ) + repolist help' -- "$cur") ) ;; esac $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && diff --git a/completions/a2x b/completions/a2x index 501a40028e1..cf9f9516bfa 100644 --- a/completions/a2x +++ b/completions/a2x @@ -27,8 +27,7 @@ _a2x() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" --help)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/abook b/completions/abook index 4bb0e8e368c..29d326b95cb 100644 --- a/completions/abook +++ b/completions/abook @@ -22,21 +22,21 @@ _abook() case $prev in --informat) - COMPREPLY=( $( compgen -W "$($1 --formats | \ + COMPREPLY=( $(compgen -W "$($1 --formats | \ command sed -n -e 's/^'$'\t''\([a-z]*\).*/\1/p' -e '/^$/q')" \ - -- "$cur" ) ) + -- "$cur") ) ;; --outformat) - COMPREPLY=( $( compgen -W "$($1 --formats | \ + COMPREPLY=( $(compgen -W "$($1 --formats | \ command sed -n -e '/^$/,$s/^'$'\t''\([a-z]*\).*/\1/p')" \ - -- "$cur" ) ) + -- "$cur") ) ;; --infile) - COMPREPLY=( $( compgen -W stdin -- "$cur" ) ) + COMPREPLY=( $(compgen -W stdin -- "$cur") ) _filedir ;; --outfile) - COMPREPLY=( $( compgen -W stdout -- "$cur" ) ) + COMPREPLY=( $(compgen -W stdout -- "$cur") ) _filedir ;; --config|--datafile) diff --git a/completions/aclocal b/completions/aclocal index aca62867bf8..f0cc61140d3 100644 --- a/completions/aclocal +++ b/completions/aclocal @@ -19,15 +19,15 @@ _aclocal() ;; --warnings|-W) local cats=( syntax unsupported ) - COMPREPLY=( $( compgen -W \ - '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur") ) return ;; esac $split && return - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace } && complete -F _aclocal aclocal aclocal-1.1{0..6} diff --git a/completions/acpi b/completions/acpi index 871bca80675..745b8f78e65 100644 --- a/completions/acpi +++ b/completions/acpi @@ -15,7 +15,7 @@ _acpi() ;; esac - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) } && complete -F _acpi acpi diff --git a/completions/add_members b/completions/add_members index d582d94b9e8..75ae417cf62 100644 --- a/completions/add_members +++ b/completions/add_members @@ -11,7 +11,7 @@ _add_members() return ;; -w|-a|--welcome-msg|--admin-notify) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; esac @@ -19,8 +19,8 @@ _add_members() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--regular-members-file --digest-members-file - --welcome-msg --admin-notify --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--regular-members-file --digest-members-file + --welcome-msg --admin-notify --help' -- "$cur") ) else _xfunc list_lists _mailman_lists fi diff --git a/completions/alias b/completions/alias index e90dff60726..af39302ac0e 100644 --- a/completions/alias +++ b/completions/alias @@ -7,11 +7,11 @@ _alias() case ${words[@]} in *[^=]) - COMPREPLY=( $( compgen -A alias -- "$cur" ) ) + COMPREPLY=( $(compgen -A alias -- "$cur") ) ;; *=) - COMPREPLY=( "$( alias ${cur%=} 2>/dev/null | command sed \ - -e 's|^alias '"$cur"'\(.*\)$|\1|' )" ) + COMPREPLY=( "$(alias ${cur%=} 2>/dev/null | command sed \ + -e 's|^alias '"$cur"'\(.*\)$|\1|')" ) ;; esac } && diff --git a/completions/ant b/completions/ant index 639cde97079..e4a25d7130d 100644 --- a/completions/ant +++ b/completions/ant @@ -47,7 +47,7 @@ _ant() return ;; -nice) - COMPREPLY=( $( compgen -W '{1..10}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{1..10}' -- "$cur") ) return ;; -lib) @@ -62,7 +62,7 @@ _ant() if [[ $cur == -D* ]]; then return elif [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) else # available targets completion # find which buildfile to use @@ -89,7 +89,7 @@ _ant() # fill targets _ant_parse_targets $buildfile - COMPREPLY=( $( compgen -W '$targets' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$targets' -- "$cur") ) fi } && complete -F _ant ant phing diff --git a/completions/apache2ctl b/completions/apache2ctl index 747897441f4..fe2a2d7b842 100644 --- a/completions/apache2ctl +++ b/completions/apache2ctl @@ -9,7 +9,7 @@ _apache2ctl() APWORDS=$($1 2>&1 >/dev/null | awk 'NR<2 { print $3; exit }' | \ tr "|" " ") - COMPREPLY=( $( compgen -W "$APWORDS" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$APWORDS" -- "$cur") ) } && complete -F _apache2ctl apache2ctl diff --git a/completions/appdata-validate b/completions/appdata-validate index 3285a3b32ec..e6c6ddd6ed5 100644 --- a/completions/appdata-validate +++ b/completions/appdata-validate @@ -10,9 +10,9 @@ _appdata_validate() return ;; --output-format) - COMPREPLY=( $( compgen -W "$( $1 --help | - command sed -ne 's/--output-format.*\[\(.*\)\]/\1/' -e 's/|/ /gp' )" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 --help | + command sed -ne 's/--output-format.*\[\(.*\)\]/\1/' -e 's/|/ /gp')" \ + -- "$cur") ) return ;; esac @@ -20,7 +20,7 @@ _appdata_validate() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/apt-build b/completions/apt-build index 0723bcc4c45..4aab430f498 100644 --- a/completions/apt-build +++ b/completions/apt-build @@ -15,11 +15,11 @@ _apt_build() if [[ -n $special ]]; then case $special in install|source|info) - COMPREPLY=( $( apt-cache pkgnames "$cur" 2> /dev/null ) ) + COMPREPLY=( $(apt-cache pkgnames "$cur" 2> /dev/null) ) ;; remove) COMPREPLY=( \ - $( _xfunc dpkg _comp_dpkg_installed_packages "$cur" ) ) + $(_xfunc dpkg _comp_dpkg_installed_packages "$cur") ) ;; esac return @@ -36,15 +36,15 @@ _apt_build() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --show-upgraded -u --build-dir + COMPREPLY=( $(compgen -W '--help --show-upgraded -u --build-dir --repository-dir --build-only --build-command --reinstall --rebuild --remove-builddep --no-wrapper --purge --patch --patch-strip -p - --yes -y --version -v --no-source' -- "$cur" ) ) + --yes -y --version -v --no-source' -- "$cur") ) else - COMPREPLY=( $( compgen -W 'update upgrade install remove source + COMPREPLY=( $(compgen -W 'update upgrade install remove source dist-upgrade world clean info clean-build update-repository' \ - -- "$cur" ) ) + -- "$cur") ) fi } && diff --git a/completions/apt-cache b/completions/apt-cache index 96b5fd44d82..e73ac4ecd67 100644 --- a/completions/apt-cache +++ b/completions/apt-cache @@ -12,7 +12,7 @@ _apt_cache_sources() { # List APT source packages _apt_cache_src_packages() { - compgen -W '$( _apt_cache_sources "$cur" )' -- "$cur" + compgen -W '$(_apt_cache_sources "$cur")' -- "$cur" } _apt_cache() @@ -37,11 +37,11 @@ _apt_cache() ;; showsrc) - COMPREPLY=( $( _apt_cache_sources "$cur" ) ) + COMPREPLY=( $(_apt_cache_sources "$cur") ) ;; *) - COMPREPLY=( $( _apt_cache_packages ) ) + COMPREPLY=( $(_apt_cache_packages) ) ;; esac @@ -63,16 +63,16 @@ _apt_cache() if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-h -v -p -s -q -i -f -a -g -c -o --help + COMPREPLY=( $(compgen -W '-h -v -p -s -q -i -f -a -g -c -o --help --version --pkg-cache --src-cache --quiet --important --full --all-versions --no-all-versions --generate --no-generate --names-only --all-names --recurse --config-file --option - --installed' -- "$cur" ) ) + --installed' -- "$cur") ) else - COMPREPLY=( $( compgen -W 'add gencaches show showpkg showsrc stats + COMPREPLY=( $(compgen -W 'add gencaches show showpkg showsrc stats dump dumpavail unmet search search depends rdepends pkgnames - dotty xvcg policy madison' -- "$cur" ) ) + dotty xvcg policy madison' -- "$cur") ) fi diff --git a/completions/apt-get b/completions/apt-get index 8296d682ed8..23b59a5e718 100644 --- a/completions/apt-get +++ b/completions/apt-get @@ -17,34 +17,34 @@ _apt_get() remove|autoremove|purge) if [[ -f /etc/debian_version ]]; then # Debian system - COMPREPLY=( $( \ - _xfunc dpkg _comp_dpkg_installed_packages $cur ) ) + COMPREPLY=( $(\ + _xfunc dpkg _comp_dpkg_installed_packages $cur) ) else # assume RPM based _xfunc rpm _rpm_installed_packages fi ;; source) - COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \ - 2> /dev/null ) $( apt-cache dumpavail | \ - command grep "^Source: $cur" | sort -u | cut -f2 -d" " ) ) + COMPREPLY=( $(apt-cache --no-generate pkgnames "$cur" \ + 2> /dev/null) $(apt-cache dumpavail | \ + command grep "^Source: $cur" | sort -u | cut -f2 -d" ") ) ;; install) if [[ $cur == */* ]]; then _filedir deb return elif [[ $cur == *=* ]]; then - COMPREPLY=( $( compgen -W "$( \ + COMPREPLY=( $(compgen -W "$(\ apt-cache --no-generate show "${cur%%=*}" 2>/dev/null | command sed -ne \ - 's/^Version:[[:space:]]*\([^[:space:]]\)/\1/p' )" \ - -- "${cur#*=}" ) ) + 's/^Version:[[:space:]]*\([^[:space:]]\)/\1/p')" \ + -- "${cur#*=}") ) return fi ;;& *) - COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \ - 2>/dev/null ) ) + COMPREPLY=( $(apt-cache --no-generate pkgnames "$cur" \ + 2>/dev/null) ) ;; esac return @@ -59,15 +59,15 @@ _apt_get() return ;; --target-release|--default-release|-!(-*)t) - COMPREPLY=( $( compgen -W "$( apt-cache policy | command sed -ne \ - 's/^ *release.*[ ,]o=\(Debian\|Ubuntu\),a=\(\w*\).*/\2/p' )" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(apt-cache policy | command sed -ne \ + 's/^ *release.*[ ,]o=\(Debian\|Ubuntu\),a=\(\w*\).*/\2/p')" \ + -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--no-install-recommends --install-suggests + COMPREPLY=( $(compgen -W '--no-install-recommends --install-suggests --download-only --fix-broken --ignore-missing --fix-missing --no-download --quiet --simulate --just-print --dry-run --recon --no-act --yes --assume-yes --assume-no --no-show-upgraded @@ -80,12 +80,12 @@ _apt_get() --diff-only --dsc-only --tar-only --arch-only --indep-only --allow-unauthenticated --no-allow-insecure-repositories --allow-releaseinfo-change --show-progress --with-source --help - --version --config-file --option' -- "$cur" ) ) + --version --config-file --option' -- "$cur") ) else - COMPREPLY=( $( compgen -W 'update upgrade dist-upgrade + COMPREPLY=( $(compgen -W 'update upgrade dist-upgrade dselect-upgrade install remove purge source build-dep check download clean autoclean autoremove changelog indextargets' \ - -- "$cur" ) ) + -- "$cur") ) fi } && diff --git a/completions/aptitude b/completions/aptitude index 4e3954a55a4..0707d5e4700 100644 --- a/completions/aptitude +++ b/completions/aptitude @@ -39,16 +39,16 @@ _aptitude() install|hold|markauto|unmarkauto|dist-upgrade|full-upgrade| \ safe-upgrade|download|show|changelog|why|why-not|build-dep| \ add-user-tag|remove-user-tag|versions) - COMPREPLY=( $( _xfunc apt-cache _apt_cache_packages ) ) + COMPREPLY=( $(_xfunc apt-cache _apt_cache_packages) ) return ;; purge|remove|reinstall|forbid-version) COMPREPLY=( \ - $( _xfunc dpkg _comp_dpkg_installed_packages "$cur" ) ) + $(_xfunc dpkg _comp_dpkg_installed_packages "$cur") ) return ;; unhold) - COMPREPLY=( $( _comp_dpkg_hold_packages "$cur" ) ) + COMPREPLY=( $(_comp_dpkg_hold_packages "$cur") ) return ;; esac @@ -64,21 +64,21 @@ _aptitude() return ;; --target-release|--default-release|-!(-*)t) - COMPREPLY=( $( apt-cache policy | \ + COMPREPLY=( $(apt-cache policy | \ command grep "release.o=Debian,a=$cur" | \ - command sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null ) ) + command sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null) ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$dashoptions" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$dashoptions" -- "$cur") ) else - COMPREPLY=( $( compgen -W 'update upgrade safe-upgrade forget-new + COMPREPLY=( $(compgen -W 'update upgrade safe-upgrade forget-new clean autoclean install reinstall remove hold unhold purge markauto unmarkauto why why-not dist-upgrade full-upgrade download search show forbid-version changelog keep keep-all build-dep add-user-tag - remove-user-tag versions' -- "$cur" ) ) + remove-user-tag versions' -- "$cur") ) fi } && diff --git a/completions/arch b/completions/arch index cd33b4f0c47..9630c77f120 100644 --- a/completions/arch +++ b/completions/arch @@ -10,7 +10,7 @@ _arch() case $prev in -w|-g|-d|--welcome-msg|--goodbye-msg|--digest) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; -d|--file) @@ -22,7 +22,7 @@ _arch() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) else local args=$cword for (( i=1; i < cword; i++ )); do diff --git a/completions/arp b/completions/arp index 65a06601e7c..4b31b382e8a 100644 --- a/completions/arp +++ b/completions/arp @@ -20,14 +20,14 @@ _arp() ;; --hw-type|-!(-*)[Ht]) # TODO: parse from --help output? - COMPREPLY=( $( compgen -W 'ash ether ax25 netrom rose arcnet \ - dlci fddi hippi irda x25 eui64' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'ash ether ax25 netrom rose arcnet \ + dlci fddi hippi irda x25 eui64' -- "$cur") ) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi @@ -35,9 +35,9 @@ _arp() _count_args "" "@(--device|--protocol|--file|--hw-type|-!(-*)[iApfHt])" case $args in 1) - local ips=$( "$1" -an | sed -ne \ - 's/.*(\([0-9]\{1,3\}\(\.[0-9]\{1,3\}\)\{3\}\)).*/\1/p' ) - COMPREPLY=( $( compgen -W '$ips' -- "$cur" ) ) + local ips=$("$1" -an | sed -ne \ + 's/.*(\([0-9]\{1,3\}\(\.[0-9]\{1,3\}\)\{3\}\)).*/\1/p') + COMPREPLY=( $(compgen -W '$ips' -- "$cur") ) ;; 2) # TODO if -d mode: "pub"; if not -f mode: hw_addr diff --git a/completions/arping b/completions/arping index 62442d330de..6adcde7c664 100644 --- a/completions/arping +++ b/completions/arping @@ -20,7 +20,7 @@ _arping() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) return fi diff --git a/completions/arpspoof b/completions/arpspoof index e31288fcc68..6275a667df1 100644 --- a/completions/arpspoof +++ b/completions/arpspoof @@ -17,7 +17,7 @@ _arpspoof() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) else _known_hosts_real -- "$cur" fi diff --git a/completions/asciidoc b/completions/asciidoc index e4af83d7eb4..2ddcdfe90ec 100644 --- a/completions/asciidoc +++ b/completions/asciidoc @@ -2,7 +2,7 @@ _asciidoc_doctype() { - COMPREPLY+=( $( compgen -W 'article book manpage' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W 'article book manpage' -- "$cur") ) } _asciidoc() @@ -15,7 +15,7 @@ _asciidoc() return ;; --backend|-!(-*)b) - COMPREPLY=( $( compgen -W 'docbook html4 xhtml11' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'docbook html4 xhtml11' -- "$cur") ) return ;; --conf-file|-!(-*)f) @@ -27,7 +27,7 @@ _asciidoc() return ;; --help|-!(-*)h) - COMPREPLY=( $( compgen -W 'manpage syntax topics' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'manpage syntax topics' -- "$cur") ) return ;; --out-file|-!(-*)o) @@ -39,8 +39,8 @@ _asciidoc() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" "--help manpage" )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" "--help manpage")' \ + -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/aspell b/completions/aspell index 9457a5fafd8..040853cb1d6 100644 --- a/completions/aspell +++ b/completions/aspell @@ -3,14 +3,14 @@ _aspell_dictionary() { local datadir aspell=${1:-aspell} - datadir=$( $aspell config data-dir 2>/dev/null || echo /usr/lib/aspell ) + datadir=$($aspell config data-dir 2>/dev/null || echo /usr/lib/aspell) # First, get aliases (dicts dump does not list them) - COMPREPLY=( $( printf '%s\n' $datadir/*.alias ) ) + COMPREPLY=( $(printf '%s\n' $datadir/*.alias) ) COMPREPLY=( "${COMPREPLY[@]%.alias}" ) COMPREPLY=( "${COMPREPLY[@]#$datadir/}" ) # Then, add the canonical dicts - COMPREPLY+=( $( $aspell dicts 2>/dev/null ) ) - COMPREPLY=( $( compgen -X '\*' -W '${COMPREPLY[@]}' -- "$cur" ) ) + COMPREPLY+=( $($aspell dicts 2>/dev/null) ) + COMPREPLY=( $(compgen -X '\*' -W '${COMPREPLY[@]}' -- "$cur") ) } _aspell() @@ -28,21 +28,21 @@ _aspell() return ;; dump|create|merge) - COMPREPLY=( $( compgen -W 'master personal repl' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'master personal repl' -- "$cur") ) return ;; --mode) - COMPREPLY=( $( compgen -W "$( $1 modes 2>/dev/null | \ - awk '{ print $1 }' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 modes 2>/dev/null | \ + awk '{ print $1 }')" -- "$cur") ) return ;; --sug-mode) - COMPREPLY=( $( compgen -W 'ultra fast normal bad-speller' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'ultra fast normal bad-speller' \ + -- "$cur") ) return ;; --keymapping) - COMPREPLY=( $( compgen -W 'aspell ispell' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'aspell ispell' -- "$cur") ) return ;; -d|--master) @@ -50,8 +50,8 @@ _aspell() return ;; --add-filter|--rem-filter) - COMPREPLY=( $( compgen -W "$( $1 filters 2>/dev/null | \ - awk '{ print $1 }' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 filters 2>/dev/null | \ + awk '{ print $1 }')" -- "$cur") ) return ;; esac @@ -59,7 +59,7 @@ _aspell() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--conf= --conf-dir= --data-dir= --dict-dir= + COMPREPLY=( $(compgen -W '--conf= --conf-dir= --data-dir= --dict-dir= --encoding= --add-filter= --rem-filter= --mode= --add-extra-dicts= --rem-extra-dicts= --home-dir= --ignore= --ignore-accents --dont-ignore-accents --ignore-case --dont-ignore-case @@ -76,11 +76,11 @@ _aspell() --add-tex-command= --rem-tex-command= --tex-check-comments --dont-tex-check-comments --add-tex-extension --rem-tex-extension --add-sgml-check= --rem-sgml-check= --add-sgml-extension - --rem-sgml-extension' -- "$cur" ) ) + --rem-sgml-extension' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else - COMPREPLY=( $( compgen -W 'usage help check pipe list config soundslike - filter version dump create merge' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'usage help check pipe list config soundslike + filter version dump create merge' -- "$cur") ) fi } && complete -F _aspell aspell diff --git a/completions/autoconf b/completions/autoconf index c67f1bdbe89..94a014ff641 100644 --- a/completions/autoconf +++ b/completions/autoconf @@ -15,8 +15,8 @@ _autoconf() ;; --warnings|-W) local cats=( cross obsolete syntax ) - COMPREPLY=( $( compgen -W \ - '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur") ) return ;; --prepend-include|-B|--include|-I) @@ -28,7 +28,7 @@ _autoconf() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/automake b/completions/automake index c2a96580ab4..ff3d4523553 100644 --- a/completions/automake +++ b/completions/automake @@ -11,8 +11,8 @@ _automake() ;; --warnings|-W) local cats=( gnu obsolete override portability syntax unsupported ) - COMPREPLY=( $( compgen -W \ - '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur") ) return ;; --libdir) @@ -24,7 +24,7 @@ _automake() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/autoreconf b/completions/autoreconf index c067cec13a6..855293ce742 100644 --- a/completions/autoreconf +++ b/completions/autoreconf @@ -12,8 +12,8 @@ _autoreconf() --warnings|-W) local cats=( cross gnu obsolete override portability syntax \ unsupported ) - COMPREPLY=( $( compgen -W \ - '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur") ) return ;; --prepend-include|-B|--include|-I) @@ -25,7 +25,7 @@ _autoreconf() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/autorpm b/completions/autorpm index 8c6e299a182..7a0bbe18e9a 100644 --- a/completions/autorpm +++ b/completions/autorpm @@ -5,8 +5,8 @@ _autorpm() local cur prev words cword _init_completion || return - COMPREPLY=( $( compgen -W '--notty --debug --help --version auto add - fullinfo info help install list remove set' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--notty --debug --help --version auto add + fullinfo info help install list remove set' -- "$cur") ) } && complete -F _autorpm autorpm diff --git a/completions/autoscan b/completions/autoscan index ff3a092beac..7cd34f433d0 100644 --- a/completions/autoscan +++ b/completions/autoscan @@ -18,7 +18,7 @@ _autoscan() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/avctrl b/completions/avctrl index acd9aeb7bb3..2ef499f3d5f 100644 --- a/completions/avctrl +++ b/completions/avctrl @@ -6,12 +6,12 @@ _avctrl() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --quiet' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--help --quiet' -- "$cur") ) else local args _count_args if [[ $args -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'discover switch' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'discover switch' -- "$cur") ) fi fi } && diff --git a/completions/badblocks b/completions/badblocks index 689f4fae3d9..6de65dcbd64 100644 --- a/completions/badblocks +++ b/completions/badblocks @@ -16,7 +16,7 @@ _badblocks() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) # Filter out -w (dangerous) and -X (internal use) for i in ${!COMPREPLY[@]}; do [[ ${COMPREPLY[i]} == -[wX] ]] && unset 'COMPREPLY[i]' diff --git a/completions/bind b/completions/bind index c1f7e224129..c06654b10fb 100644 --- a/completions/bind +++ b/completions/bind @@ -10,8 +10,8 @@ _bind() return ;; -*m) - COMPREPLY=( $( compgen -W "emacs emacs-standard emacs-meta - emacs-ctlx vi vi-move vi-command vi-insert" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "emacs emacs-standard emacs-meta + emacs-ctlx vi vi-move vi-command vi-insert" -- "$cur") ) return ;; -*f) @@ -19,17 +19,17 @@ _bind() return ;; -*[qu]) - COMPREPLY=( $( compgen -W '$( "$1" -l )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$("$1" -l)' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) return fi - COMPREPLY=( $( compgen -A binding -- "$cur" ) ) + COMPREPLY=( $(compgen -A binding -- "$cur") ) } && complete -F _bind bind diff --git a/completions/bk b/completions/bk index 334e25b49d5..73b5bb1c60d 100644 --- a/completions/bk +++ b/completions/bk @@ -6,10 +6,10 @@ _bk() local cur prev words cword _init_completion || return - local BKCMDS="$( bk help topics 2>/dev/null | \ - awk '/^ bk/ { print $2 }' | xargs printf '%s ' )" + local BKCMDS="$(bk help topics 2>/dev/null | \ + awk '/^ bk/ { print $2 }' | xargs printf '%s ')" - COMPREPLY=( $( compgen -W "$BKCMDS" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$BKCMDS" -- "$cur") ) _filedir } && diff --git a/completions/brctl b/completions/brctl index 01370654e8c..755812d35a9 100644 --- a/completions/brctl +++ b/completions/brctl @@ -9,17 +9,17 @@ _brctl() case $cword in 1) - COMPREPLY=( $( compgen -W "addbr delbr addif delif setageing + COMPREPLY=( $(compgen -W "addbr delbr addif delif setageing setbridgeprio setfd sethello setmaxage setpathcost setportprio - show showmacs showstp stp" -- "$cur" ) ) + show showmacs showstp stp" -- "$cur") ) ;; 2) case $command in show) ;; *) - COMPREPLY=( $( compgen -W "$($1 show | \ - awk 'NR>1 {print $1}' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 show | \ + awk 'NR>1 {print $1}' )" -- "$cur") ) esac ;; 3) @@ -28,7 +28,7 @@ _brctl() _configured_interfaces ;; stp) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on off' -- "$cur") ) ;; esac ;; diff --git a/completions/btdownloadheadless.py b/completions/btdownloadheadless.py index f0b74615633..c15de1a4722 100644 --- a/completions/btdownloadheadless.py +++ b/completions/btdownloadheadless.py @@ -13,7 +13,7 @@ esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--max_uploads --keepalive_interval + COMPREPLY=( $(compgen -W '--max_uploads --keepalive_interval --download_slice_size --request_backlog --max_message_length --ip --minport --maxport --responsefile --url --saveas --timeout --timeout_check_interval --max_slice_length --max_rate_period @@ -21,7 +21,7 @@ --min_peers --http_timeout --max_initiate --max_allow_in --check_hashes --max_upload_rate --snub_time --spew --rarest_first_cutoff --min_uploads --report_hash_failures' \ - -- "$cur" ) ) + -- "$cur") ) else _filedir fi diff --git a/completions/bts b/completions/bts index ba33fd66090..854893a6886 100644 --- a/completions/bts +++ b/completions/bts @@ -10,7 +10,7 @@ _cached_bugs() { # List APT source packages prefixed with "src:" _src_packages_with_prefix() { ppn=${cur:4} # partial package name, after stripping "src:" - compgen -P "src:" -W '$( _xfunc apt-cache _apt_cache_sources "$ppn" )' \ + compgen -P "src:" -W '$(_xfunc apt-cache _apt_cache_sources "$ppn")' \ -- "$ppn" } @@ -22,34 +22,34 @@ _bts() case $prev in show|bugs) - COMPREPLY=( $( compgen -W 'release-critical RC from: tag: - usertag:' -- "$cur" ) $( _cached_bugs ) - $( _src_packages_with_prefix ) ) + COMPREPLY=( $(compgen -W 'release-critical RC from: tag: + usertag:' -- "$cur") $(_cached_bugs) + $(_src_packages_with_prefix) ) return ;; select) - COMPREPLY=( $( compgen -W 'package: source: maintainer: submitter: + COMPREPLY=( $(compgen -W 'package: source: maintainer: submitter: severity: status: tag: owner: correspondent: affects: bugs: - users: archive:' -- "$cur" ) ) + users: archive:' -- "$cur") ) return ;; status) - COMPREPLY=( $( compgen -W 'file: fields: verbose' -- "$cur" ) - $( _cached_bugs ) ) + COMPREPLY=( $(compgen -W 'file: fields: verbose' -- "$cur") + $(_cached_bugs) ) return ;; block|unblock) - COMPREPLY=( $( compgen -W 'by with' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'by with' -- "$cur") ) return ;; severity) - COMPREPLY=( $( compgen -W 'wishlist minor normal important serious - grave critical' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'wishlist minor normal important serious + grave critical' -- "$cur") ) return ;; limit) - COMPREPLY=( $( compgen -W 'submitter date subject msgid package - source tag severity owner affects archive' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'submitter date subject msgid package + source tag severity owner affects archive' -- "$cur") ) return ;; clone|done|reopen|archive|unarchive|retitle|summary|submitter|found\ @@ -57,23 +57,23 @@ _bts() |forwarded|notforwarded|owner|noowner|subscribe|unsubscribe\ |reportspam|spamreport|affects|usertag|usertags|reassign|tag\ |tags) - COMPREPLY=( $( _cached_bugs ) ) + COMPREPLY=( $(_cached_bugs) ) return ;; package) - COMPREPLY=( $( _xfunc apt-cache _apt_cache_packages ) ) + COMPREPLY=( $(_xfunc apt-cache _apt_cache_packages) ) return ;; cache) - COMPREPLY=( $( _xfunc apt-cache _apt_cache_packages ) - $( _src_packages_with_prefix ) - $( compgen -W 'from: release-critical RC' -- "$cur" ) ) + COMPREPLY=( $(_xfunc apt-cache _apt_cache_packages) + $(_src_packages_with_prefix) + $(compgen -W 'from: release-critical RC' -- "$cur") ) return ;; cleancache) - COMPREPLY=( $( _xfunc apt-cache _apt_cache_packages ) - $( _src_packages_with_prefix ) - $( compgen -W 'from: tag: usertag: ALL' -- "$cur" ) ) + COMPREPLY=( $(_xfunc apt-cache _apt_cache_packages) + $(_src_packages_with_prefix) + $(compgen -W 'from: tag: usertag: ALL' -- "$cur") ) return ;; user) @@ -86,7 +86,7 @@ _bts() # COMP_WORDS would be: "bts cleancache src : " pos=$((COMP_CWORD - 2)) if [[ $pos -gt 0 && "${COMP_WORDS[$pos]}" == "src" ]]; then - COMPREPLY=( $( _xfunc apt-cache _apt_cache_src_packages ) ) + COMPREPLY=( $(_xfunc apt-cache _apt_cache_src_packages) ) return fi ;; @@ -94,7 +94,7 @@ _bts() $split && return - COMPREPLY=( $( compgen -W '--offline --online --no-offline + COMPREPLY=( $(compgen -W '--offline --online --no-offline --no-action --cache --no-cache --cache-mode --cache-delay --mbox --mailreader --cc-addr --use-default-cc --no-use-default-cc --sendmail --mutt --no-mutt --smtp-host --smtp-username @@ -107,7 +107,7 @@ _bts() merge forcemerge unmerge tag tags affects user usertag usertags claim unclaim severity forwarded notforwarded package limit owner noowner subscribe unsubscribe reportspam spamreport cache cleancache version - help' -- "$cur" ) ) + help' -- "$cur") ) } && complete -F _bts bts diff --git a/completions/bzip2 b/completions/bzip2 index 4cdcf4b0ec8..8bd72cc988d 100644 --- a/completions/bzip2 +++ b/completions/bzip2 @@ -10,15 +10,15 @@ _bzip2() return ;; -!(-*)n) - COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "{1..$(_ncpus)}" -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - local helpopts=$( _parse_help "$1" ) - COMPREPLY=( $( compgen -W "${helpopts//#/} -2 -3 -4 -5 -6 -7 -8 -9" \ - -- "$cur" ) ) + local helpopts=$(_parse_help "$1") + COMPREPLY=( $(compgen -W "${helpopts//#/} -2 -3 -4 -5 -6 -7 -8 -9" \ + -- "$cur") ) return fi @@ -35,8 +35,7 @@ _bzip2() _tilde "$cur" || return compopt -o filenames - COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ - $( compgen -d -- "$cur" ) ) + COMPREPLY=( $(compgen -f -X "$xspec" -- "$cur") $(compgen -d -- "$cur") ) } && complete -F _bzip2 bzip2 pbzip2 lbzip2 diff --git a/completions/cancel b/completions/cancel index 5a03368193f..b903517bb80 100644 --- a/completions/cancel +++ b/completions/cancel @@ -14,13 +14,13 @@ _cancel() return ;; -u) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; esac - COMPREPLY=( $( compgen -W \ - "$( lpstat 2>/dev/null | cut -d' ' -f1 )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + "$(lpstat 2>/dev/null | cut -d' ' -f1)" -- "$cur") ) } && complete -F _cancel cancel diff --git a/completions/cardctl b/completions/cardctl index 273d1a9040c..588ea467063 100644 --- a/completions/cardctl +++ b/completions/cardctl @@ -6,8 +6,8 @@ _cardctl() _init_completion || return if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'status config ident suspend resume reset - eject insert scheme' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'status config ident suspend resume reset + eject insert scheme' -- "$cur") ) fi } && complete -F _cardctl cardctl pccardctl diff --git a/completions/ccache b/completions/ccache index e6a4422d9c7..7dbec9feced 100644 --- a/completions/ccache +++ b/completions/ccache @@ -20,8 +20,8 @@ _ccache() ;; --set-config|-!(-*)o) if [[ $cur != *=* ]]; then - COMPREPLY=( $( compgen -S = -W "$( $1 -p 2>/dev/null | \ - awk '$3 = "=" { print $2 }' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -S = -W "$($1 -p 2>/dev/null | \ + awk '$3 = "=" { print $2 }')" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi return @@ -30,7 +30,7 @@ _ccache() $split && return - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace } && complete -F _ccache ccache diff --git a/completions/ccze b/completions/ccze index 887313d8b65..f0bfc5f9f89 100644 --- a/completions/ccze +++ b/completions/ccze @@ -18,24 +18,24 @@ _ccze() return ;; --mode|-!(-*)m) - COMPREPLY=( $( compgen -W "curses ansi html" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "curses ansi html" -- "$cur") ) return ;; --option|-!(-*)o) local -a opts=(scroll wordcolor lookups transparent cssfile) - COMPREPLY=( $( compgen -W '${opts[@]} ${opts[@]/#/no}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${opts[@]} ${opts[@]/#/no}' -- "$cur") ) return ;; --plugin|-!(-*)p) - COMPREPLY=( $( compgen -W '$( "$1" --list-plugins | - sed -ne "s/^\([a-z0-9]\{1,\}\)[[:space:]]\{1,\}|.*/\1/p" )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$("$1" --list-plugins | + sed -ne "s/^\([a-z0-9]\{1,\}\)[[:space:]]\{1,\}|.*/\1/p")' \ + -- "$cur") ) return esac $split && return - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace } && complete -F _ccze ccze diff --git a/completions/cfagent b/completions/cfagent index fbf364eda41..14987723e08 100644 --- a/completions/cfagent +++ b/completions/cfagent @@ -13,7 +13,7 @@ _cfagent() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) fi } && complete -F _cfagent cfagent diff --git a/completions/cfrun b/completions/cfrun index f4d1f265418..01052f78aed 100644 --- a/completions/cfrun +++ b/completions/cfrun @@ -22,7 +22,7 @@ _cfrun() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-f -h -d -S -T -v' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-f -h -d -S -T -v' -- "$cur") ) else hostfile=${CFINPUTS:-/var/lib/cfengine/inputs}/cfrun.hosts for (( i=1; i < cword; i++ )); do @@ -33,12 +33,12 @@ _cfrun() done [[ ! -f $hostfile ]] && return - COMPREPLY=( $(compgen -W "$( command grep -v \ - -E '(=|^$|^#)' $hostfile )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(command grep -v \ + -E '(=|^$|^#)' $hostfile )" -- "$cur") ) fi ;; 2) - COMPREPLY=( $( compgen -W '$( _parse_help cfagent )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help cfagent)' -- "$cur") ) ;; esac } && diff --git a/completions/chage b/completions/chage index ee8f211355a..cb9d8fcf3a5 100644 --- a/completions/chage +++ b/completions/chage @@ -19,11 +19,11 @@ _chage() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) } && complete -F _chage chage diff --git a/completions/change_pw b/completions/change_pw index b0f2061fccf..61c457684ab 100644 --- a/completions/change_pw +++ b/completions/change_pw @@ -15,8 +15,8 @@ _change_pw() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--all --domain --listname --password --quiet - --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--all --domain --listname --password --quiet + --help' -- "$cur") ) fi } && diff --git a/completions/check_db b/completions/check_db index 6f666173024..ade03a5a9a9 100644 --- a/completions/check_db +++ b/completions/check_db @@ -6,7 +6,7 @@ _check_db() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--all --verbose --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--all --verbose --help' -- "$cur") ) else _xfunc list_lists _mailman_lists fi diff --git a/completions/check_perms b/completions/check_perms index 0fb05b11baf..d53b22a6deb 100644 --- a/completions/check_perms +++ b/completions/check_perms @@ -6,7 +6,7 @@ _check_perms() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-f -v -h' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-f -v -h' -- "$cur") ) fi } && diff --git a/completions/checksec b/completions/checksec index 4e9fb60121f..e07d07d063c 100644 --- a/completions/checksec +++ b/completions/checksec @@ -28,7 +28,7 @@ _checksec() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi } && diff --git a/completions/chgrp b/completions/chgrp index 986a77a6224..0e39739c8b2 100644 --- a/completions/chgrp +++ b/completions/chgrp @@ -20,9 +20,9 @@ _chgrp() for w in "${words[@]}" ; do [[ "$w" == -@(R|-recursive) ]] && opts="-H -L -P" && break done - COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes --dereference + COMPREPLY=( $(compgen -W '-c -h -f -R -v --changes --dereference --no-dereference --silent --quiet --reference --recursive --verbose - --help --version $opts' -- "$cur" ) ) + --help --version $opts' -- "$cur") ) return fi diff --git a/completions/chkconfig b/completions/chkconfig index 8766b3a2105..f1ee870448f 100644 --- a/completions/chkconfig +++ b/completions/chkconfig @@ -12,7 +12,7 @@ _chkconfig() return ;; --level) - COMPREPLY=( $( compgen -W '{1..6}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{1..6}' -- "$cur") ) return ;; esac @@ -20,12 +20,12 @@ _chkconfig() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--list --add --del --override --level' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--list --add --del --override --level' \ + -- "$cur") ) else if [[ $cword -eq 2 || $cword -eq 4 ]]; then - COMPREPLY=( $( compgen -W 'on off reset resetpriorities' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on off reset resetpriorities' \ + -- "$cur") ) else _services _xinetd_services diff --git a/completions/chmod b/completions/chmod index d8660473e22..89cb397e0dd 100644 --- a/completions/chmod +++ b/completions/chmod @@ -21,9 +21,9 @@ _chmod() local modearg="-@(@(+([rwxXst])|[ugo])|+([0-7]))" if [[ $cur == -* && $cur != $modearg ]]; then - local opts=$( _parse_help "$1" ) - [[ $opts ]] || opts=$( _parse_usage "$1" ) - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + local opts=$(_parse_help "$1") + [[ $opts ]] || opts=$(_parse_usage "$1") + COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/chown b/completions/chown index c4479dd274e..6bfa264af4d 100644 --- a/completions/chown +++ b/completions/chown @@ -25,9 +25,9 @@ _chown() for w in "${words[@]}" ; do [[ "$w" == -@(R|-recursive) ]] && opts="-H -L -P" && break done - COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes --dereference + COMPREPLY=( $(compgen -W '-c -h -f -R -v --changes --dereference --no-dereference --from --silent --quiet --reference --recursive - --verbose --help --version $opts' -- "$cur" ) ) + --verbose --help --version $opts' -- "$cur") ) else local args diff --git a/completions/chpasswd b/completions/chpasswd index 1e24a1769cf..8c5a4dfd8b3 100644 --- a/completions/chpasswd +++ b/completions/chpasswd @@ -7,8 +7,8 @@ _chpasswd() case $prev in --crypt|-!(-*)c) - COMPREPLY=( $( compgen -W 'DES MD5 NONE SHA256 SHA512' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'DES MD5 NONE SHA256 SHA512' \ + -- "$cur") ) return ;; --sha-rounds|-!(-*)s) @@ -22,7 +22,7 @@ _chpasswd() $split && return - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace } && complete -F _chpasswd chpasswd diff --git a/completions/chromium-browser b/completions/chromium-browser index a57b17280bf..f8bebd97eb4 100644 --- a/completions/chromium-browser +++ b/completions/chromium-browser @@ -14,7 +14,7 @@ _chromium_browser() return ;; --password-store) - COMPREPLY=( $( compgen -W 'basic gnome kwallet' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'basic gnome kwallet' -- "$cur") ) return ;; esac @@ -22,7 +22,7 @@ _chromium_browser() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/chronyc b/completions/chronyc index 53b87e4614c..a59746aa921 100644 --- a/completions/chronyc +++ b/completions/chronyc @@ -2,12 +2,12 @@ _chronyc_command_args() { - local -a args=( $( compgen -W "$( $1 help 2>/dev/null | \ - awk '/^'$prev'\s[^ []/ { gsub("\\|", " ", $2); print $2 }' )" ) ) + local -a args=( $(compgen -W "$($1 help 2>/dev/null | \ + awk '/^'$prev'\s[^ []/ { gsub("\\|", " ", $2); print $2 }')") ) case $args in \) _known_hosts_real -- "$cur" ;; \<*) ;; - *) COMPREPLY+=( $( compgen -W '${args[@]}' -- "$cur" ) ) ;; + *) COMPREPLY+=( $(compgen -W '${args[@]}' -- "$cur") ) ;; esac } @@ -27,7 +27,7 @@ _chronyc() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" ) -6' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1") -6' -- "$cur") ) return fi @@ -38,15 +38,15 @@ _chronyc() case $args in 0) - COMPREPLY=( $( compgen -W "$( $1 help 2>/dev/null | \ - awk '!/(^ |: *$)/ { sub("\\|", " ", $1); print $1 }' )" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 help 2>/dev/null | \ + awk '!/(^ |: *$)/ { sub("\\|", " ", $1); print $1 }')" \ + -- "$cur") ) ;; 1) _chronyc_command_args "$1" if [[ ! $COMPREPLY && $prev == sources?(tats) ]]; then # [-v] not handled by _chronyc_command_args yet - COMPREPLY=( $( compgen -W '-v' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-v' -- "$cur") ) fi ;; 2) diff --git a/completions/chrpath b/completions/chrpath index 8d2b4558446..bcd0f91d8d4 100644 --- a/completions/chrpath +++ b/completions/chrpath @@ -16,7 +16,7 @@ _chrpath() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi diff --git a/completions/cksfv b/completions/cksfv index 346e0605bd7..89ccc7b73b1 100644 --- a/completions/cksfv +++ b/completions/cksfv @@ -6,7 +6,7 @@ _cksfv() _init_completion || return if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi diff --git a/completions/cleanarch b/completions/cleanarch index edac34f80d6..5e57e5be5a6 100644 --- a/completions/cleanarch +++ b/completions/cleanarch @@ -6,8 +6,8 @@ _cleanarch() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--status --dry-run --quiet --help' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--status --dry-run --quiet --help' \ + -- "$cur") ) fi } && diff --git a/completions/clisp b/completions/clisp index 23b04f04a4a..f9ccfbb88a6 100644 --- a/completions/clisp +++ b/completions/clisp @@ -9,9 +9,9 @@ _clisp() # completing an option (may or may not be separated by a space) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-h --help --version --license -B -K -M -m -L + COMPREPLY=( $(compgen -W '-h --help --version --license -B -K -M -m -L -N -E -q --quiet --silent -w -I -ansi -traditional -p -C -norc -i - -c -l -o -x ' -- "$cur" ) ) + -c -l -o -x ' -- "$cur") ) else _filedir fi diff --git a/completions/clone_member b/completions/clone_member index fe45e494cad..5a0797feb95 100644 --- a/completions/clone_member +++ b/completions/clone_member @@ -15,8 +15,8 @@ _clone_member() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--listname --remove --admin --quiet - --nomodify --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--listname --remove --admin --quiet + --nomodify --help' -- "$cur") ) fi } && diff --git a/completions/complete b/completions/complete index dd34c3cafa1..0519744de72 100644 --- a/completions/complete +++ b/completions/complete @@ -7,30 +7,30 @@ _complete() case $prev in -*o) - COMPREPLY=( $( compgen -W 'bashdefault default dirnames filenames - nospace plusdirs' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'bashdefault default dirnames filenames + nospace plusdirs' -- "$cur") ) return ;; -*A) - COMPREPLY=( $( compgen -W 'alias arrayvar binding builtin command + COMPREPLY=( $(compgen -W 'alias arrayvar binding builtin command directory disabled enabled export file function group helptopic hostname job keyword running service setopt shopt signal - stopped user variable' -- "$cur" ) ) + stopped user variable' -- "$cur") ) return ;; -*C) - COMPREPLY=( $( compgen -A command -- "$cur" ) ) + COMPREPLY=( $(compgen -A command -- "$cur") ) return ;; -*F) - COMPREPLY=( $( compgen -A function -- "$cur" ) ) + COMPREPLY=( $(compgen -A function -- "$cur") ) return ;; -*p|-*r) - COMPREPLY=( $( complete -p | command sed -e 's|.* ||' ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) + COMPREPLY=( $(complete -p | command sed -e 's|.* ||') ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") ) return ;; esac @@ -39,9 +39,9 @@ _complete() # relevant options completion local opts="-a -b -c -d -e -f -g -j -k -o -s -u -v -A -G -W -P -S -X" [[ $1 != compgen ]] && opts+=" -F -C" - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) else - COMPREPLY=( $( compgen -A command -- "$cur" ) ) + COMPREPLY=( $(compgen -A command -- "$cur") ) fi } && complete -F _complete compgen complete diff --git a/completions/config_list b/completions/config_list index 653c628ae17..f86263d7007 100644 --- a/completions/config_list +++ b/completions/config_list @@ -15,8 +15,8 @@ _config_list() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--inputfile --outputfile --checkonly - --verbose --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--inputfile --outputfile --checkonly + --verbose --help' -- "$cur") ) else _xfunc list_lists _mailman_lists fi diff --git a/completions/configure b/completions/configure index 0e37726b2a5..726c7bda269 100644 --- a/completions/configure +++ b/completions/configure @@ -27,13 +27,13 @@ _configure() [[ "$cur" != -* ]] && return if [[ -n $COMP_CONFIGURE_HINTS ]]; then - COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \ + COMPREPLY=( $(compgen -W "$($1 --help 2>&1 | \ awk '/^ --[A-Za-z]/ { print $1; \ - if ($2 ~ /--[A-Za-z]/) print $2 }' | command sed -e 's/[[,].*//g' )" \ - -- "$cur" ) ) + if ($2 ~ /--[A-Za-z]/) print $2 }' | command sed -e 's/[[,].*//g')" \ + -- "$cur") ) [[ $COMPREPLY == *=* ]] && compopt -o nospace else - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && diff --git a/completions/convert b/completions/convert index 59647d59929..3ebfc5e9514 100644 --- a/completions/convert +++ b/completions/convert @@ -4,97 +4,97 @@ _ImageMagick() { case $prev in -channel) - COMPREPLY=( $( compgen -W 'Red Green Blue Opacity Matte Cyan - Magenta Yellow Black' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'Red Green Blue Opacity Matte Cyan + Magenta Yellow Black' -- "$cur") ) return ;; -colormap) - COMPREPLY=( $( compgen -W 'shared private' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'shared private' -- "$cur") ) return ;; -colorspace) - COMPREPLY=( $( compgen -W 'GRAY OHTA RGB Transparent XYZ YCbCr YIQ - YPbPr YUV CMYK' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'GRAY OHTA RGB Transparent XYZ YCbCr YIQ + YPbPr YUV CMYK' -- "$cur") ) return ;; -compose) - COMPREPLY=( $( compgen -W 'Over In Out Atop Xor Plus Minus Add + COMPREPLY=( $(compgen -W 'Over In Out Atop Xor Plus Minus Add Subtract Difference Multiply Bumpmap Copy CopyRed CopyGreen - CopyBlue CopyOpacity' -- "$cur" ) ) + CopyBlue CopyOpacity' -- "$cur") ) return ;; -compress) - COMPREPLY=( $( compgen -W 'None BZip Fax Group4 JPEG Lossless LZW - RLE Zip' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'None BZip Fax Group4 JPEG Lossless LZW + RLE Zip' -- "$cur") ) return ;; -dispose) - COMPREPLY=( $( compgen -W 'Undefined None Background Previous' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'Undefined None Background Previous' \ + -- "$cur") ) return ;; -encoding) - COMPREPLY=( $( compgen -W 'AdobeCustom AdobeExpert AdobeStandard + COMPREPLY=( $(compgen -W 'AdobeCustom AdobeExpert AdobeStandard AppleRoman BIG5 GB2312 Latin2 None SJIScode Symbol Unicode - Wansung' -- "$cur" ) ) + Wansung' -- "$cur") ) return ;; -endian) - COMPREPLY=( $( compgen -W 'MSB LSB' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'MSB LSB' -- "$cur") ) return ;; -filter) - COMPREPLY=( $( compgen -W 'Point Box Triangle Hermite Hanning + COMPREPLY=( $(compgen -W 'Point Box Triangle Hermite Hanning Hamming Blackman Gaussian Quadratic Cubic Catrom Mitchell - Lanczos Bessel Sinc' -- "$cur" ) ) + Lanczos Bessel Sinc' -- "$cur") ) return ;; -format) - COMPREPLY=( $( compgen -W "$( convert -list format | awk \ - '/ [r-][w-][+-] / { sub("[*]$","",$1); print tolower($1) }' )" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(convert -list format | awk \ + '/ [r-][w-][+-] / { sub("[*]$","",$1); print tolower($1) }')" \ + -- "$cur") ) return ;; -gravity) - COMPREPLY=( $( compgen -W 'Northwest North NorthEast West Center - East SouthWest South SouthEast' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'Northwest North NorthEast West Center + East SouthWest South SouthEast' -- "$cur") ) return ;; -intent) - COMPREPLY=( $( compgen -W 'Absolute Perceptual Relative - Saturation' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'Absolute Perceptual Relative + Saturation' -- "$cur") ) return ;; -interlace) - COMPREPLY=( $( compgen -W 'None Line Plane Partition' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'None Line Plane Partition' -- "$cur") ) return ;; -limit) - COMPREPLY=( $( compgen -W 'Disk File Map Memory' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'Disk File Map Memory' -- "$cur") ) return ;; -list) - COMPREPLY=( $( compgen -W 'Delegate Format Magic Module Resource - Type' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'Delegate Format Magic Module Resource + Type' -- "$cur") ) return ;; -map) - COMPREPLY=( $( compgen -W 'best default gray red green blue' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'best default gray red green blue' \ + -- "$cur") ) _filedir return ;; -noise) - COMPREPLY=( $( compgen -W 'Uniform Gaussian Multiplicative - Impulse Laplacian Poisson' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'Uniform Gaussian Multiplicative + Impulse Laplacian Poisson' -- "$cur") ) return ;; -preview) - COMPREPLY=( $( compgen -W 'Rotate Shear Roll Hue Saturation + COMPREPLY=( $(compgen -W 'Rotate Shear Roll Hue Saturation Brightness Gamma Spiff Dull Grayscale Quantize Despeckle ReduceNoise AddNoise Sharpen Blur Treshold EdgeDetect Spread Shade Raise Segment Solarize Swirl Implode Wave OilPaint - CharcoalDrawing JPEG' -- "$cur" ) ) + CharcoalDrawing JPEG' -- "$cur") ) return ;; -mask|-profile|-texture|-tile|-write) @@ -102,24 +102,24 @@ _ImageMagick() return ;; -type) - COMPREPLY=( $( compgen -W 'Bilevel Grayscale Palette PaletteMatte + COMPREPLY=( $(compgen -W 'Bilevel Grayscale Palette PaletteMatte TrueColor TrueColorMatte ColorSeparation ColorSeparationlMatte - Optimize' -- "$cur" ) ) + Optimize' -- "$cur") ) return ;; -units) - COMPREPLY=( $( compgen -W 'Undefined PixelsPerInch - PixelsPerCentimeter' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'Undefined PixelsPerInch + PixelsPerCentimeter' -- "$cur") ) return ;; -virtual-pixel) - COMPREPLY=( $( compgen -W 'Constant Edge mirror tile' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'Constant Edge mirror tile' -- "$cur") ) return ;; -visual) - COMPREPLY=( $( compgen -W 'StaticGray GrayScale StaticColor + COMPREPLY=( $(compgen -W 'StaticGray GrayScale StaticColor PseudoColor TrueColor DirectColor defaut visualid' \ - -- "$cur" ) ) + -- "$cur") ) return ;; esac @@ -135,11 +135,11 @@ _convert() _ImageMagick && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+adjoin +append +compress +contrast +debug + COMPREPLY=( $(compgen -W '+adjoin +append +compress +contrast +debug +dither +endian +gamma +label +map +mask +matte +negate +noise - +page +raise +render +write' -- "$cur" ) ) + +page +raise +render +write' -- "$cur") ) else _filedir fi @@ -154,10 +154,10 @@ _mogrify() _ImageMagick && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+compress +contrast +debug +dither +endian - +gamma +label +map +mask +matte +negate +page +raise' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '+compress +contrast +debug +dither +endian + +gamma +label +map +mask +matte +negate +page +raise' -- "$cur") ) else _filedir fi @@ -172,10 +172,10 @@ _display() _ImageMagick && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+compress +contrast +debug +dither +endian - +gamma +label +map +matte +negate +page +raise +write' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '+compress +contrast +debug +dither +endian + +gamma +label +map +matte +negate +page +raise +write' -- "$cur") ) else _filedir fi @@ -190,10 +190,10 @@ _animate() _ImageMagick && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+debug +dither +gamma +map +matte' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '+debug +dither +gamma +map +matte' \ + -- "$cur") ) else _filedir fi @@ -208,9 +208,9 @@ _identify() _ImageMagick && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+debug' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '+debug' -- "$cur") ) else _filedir fi @@ -225,10 +225,10 @@ _montage() _ImageMagick && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+adjoin +compress +debug +dither +endian - +gamma +label +matte +page' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '+adjoin +compress +debug +dither +endian + +gamma +label +matte +page' -- "$cur") ) else _filedir fi @@ -243,10 +243,10 @@ _composite() _ImageMagick && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+compress +debug +dither +endian +label - +matte +negate +page +write' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '+compress +debug +dither +endian +label + +matte +negate +page +write' -- "$cur") ) else _filedir fi @@ -261,9 +261,9 @@ _compare() _ImageMagick && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+debug' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '+debug' -- "$cur") ) else _filedir fi @@ -278,9 +278,9 @@ _conjure() _ImageMagick && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+debug' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '+debug' -- "$cur") ) else _filedir fi @@ -295,9 +295,9 @@ _import() _ImageMagick && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+debug' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '+debug' -- "$cur") ) else _filedir fi @@ -312,9 +312,9 @@ _stream() _ImageMagick && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+debug' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '+debug' -- "$cur") ) else _filedir fi diff --git a/completions/cowsay b/completions/cowsay index 4f4411acca9..c6cbf813a3f 100644 --- a/completions/cowsay +++ b/completions/cowsay @@ -7,15 +7,15 @@ _cowsay() case $prev in -f) - COMPREPLY=( $( compgen -W \ - '$( cowsay -l 2>/dev/null | tail -n +2 )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$(cowsay -l 2>/dev/null | tail -n +2)' -- "$cur") ) return ;; esac # relevant options completion - COMPREPLY=( $( compgen -W '-b -d -g -p -s -t -w -y -e -f -h -l -n -T -W' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-b -d -g -p -s -t -w -y -e -f -h -l -n -T -W' \ + -- "$cur") ) } && complete -F _cowsay -o default cowsay cowthink diff --git a/completions/cpan2dist b/completions/cpan2dist index 9704782d020..1bf41e8e9d2 100644 --- a/completions/cpan2dist +++ b/completions/cpan2dist @@ -8,9 +8,9 @@ _cpan2dist() case $prev in --format) # should remove ":" from COMP_WORDBREAKS, but doesn't work (?) - COMPREPLY=( $( compgen -W '$(perl -MCPANPLUS::Dist -e \ + COMPREPLY=( $(compgen -W '$(perl -MCPANPLUS::Dist -e \ "print map { \"\$_\n\" } CPANPLUS::Dist->dist_types")' \ - -- "$cur" ) ) + -- "$cur") ) return ;; --banlist|--ignorelist|--modulelist|--logfile) @@ -20,7 +20,7 @@ _cpan2dist() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) else local cpandirs=( "$HOME/.cpanplus/" "$HOME/.cpan/source/modules/" ) local packagelist @@ -28,8 +28,8 @@ _cpan2dist() [[ -d "$dir" && -r "$dir/02packages.details.txt.gz" ]] && \ packagelist="$dir/02packages.details.txt.gz" done - [[ $packagelist ]] && COMPREPLY=( $( zgrep "^${cur//-/::}" \ - $packagelist 2>/dev/null | awk '{print $1}' | command sed -e 's/::/-/g' ) ) + [[ $packagelist ]] && COMPREPLY=( $(zgrep "^${cur//-/::}" \ + $packagelist 2>/dev/null | awk '{print $1}' | command sed -e 's/::/-/g') ) fi } && complete -F _cpan2dist -o default cpan2dist diff --git a/completions/cpio b/completions/cpio index 0c6e1962768..bbb1ecf93c5 100644 --- a/completions/cpio +++ b/completions/cpio @@ -8,8 +8,8 @@ _cpio() # --name value style option case $prev in --format|-!(-*)H) - COMPREPLY=( $( compgen -W \ - 'bin odc newc crc tar ustar hpbin hpodc' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + 'bin odc newc crc tar ustar hpbin hpodc' -- "$cur") ) return ;; --file|--pattern-file|-!(-*)[EFI]) @@ -22,7 +22,7 @@ _cpio() ;; --rsh-command) compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=( $(compgen -c -- "$cur") ) return ;; esac @@ -30,23 +30,23 @@ _cpio() $split && return if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W '-o --create -i --extract -p --pass-through - -? --help --license --usage --version' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-o --create -i --extract -p --pass-through + -? --help --license --usage --version' -- "$cur") ) else case ${words[1]} in -o|--create) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-0 -a -c -v -A -B -L -V -C -H -M + COMPREPLY=( $(compgen -W '-0 -a -c -v -A -B -L -V -C -H -M -O -F --file --format --message --null --reset-access-time --verbose --dot --append --block-size --dereference --io-size --quiet --force-local --rsh-command --help --version' \ - -- "$cur" ) ) + -- "$cur") ) fi ;; -i|--extract) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-b -c -d -f -m -n -r -t -s -u -v + COMPREPLY=( $(compgen -W '-b -c -d -f -m -n -r -t -s -u -v -B -S -V -C -E -H -M -R -I -F --file --make-directories --nonmatching --preserve-modification-time --numeric-uid-gid --rename --list --swap-bytes --swap @@ -55,17 +55,17 @@ _cpio() --owner --no-preserve-owner --message --force-local --no-absolute-filenames --sparse --only-verify-crc --quiet --rsh-command --help --to-stdout --version' \ - -- "$cur" ) ) + -- "$cur") ) fi ;; -p*|--pass-through) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-0 -a -d -l -m -u -v -L -V -R + COMPREPLY=( $(compgen -W '-0 -a -d -l -m -u -v -L -V -R --null --reset-access-time --make-directories --link --quiet --preserve-modification-time --unconditional --verbose --dot --dereference --owner --no-preserve-owner --sparse --help --version' \ - -- "$cur" ) ) + -- "$cur") ) else _filedir -d fi diff --git a/completions/cppcheck b/completions/cppcheck index 86990dd5fb0..2e487f812cd 100644 --- a/completions/cppcheck +++ b/completions/cppcheck @@ -23,14 +23,14 @@ _cppcheck() cur="${cur##*,}" split=true fi - COMPREPLY=( $( compgen -W 'all warning style performance + COMPREPLY=( $(compgen -W 'all warning style performance portability information unusedFunction missingInclude' \ - -- "$cur" ) ) + -- "$cur") ) $split && COMPREPLY=( ${COMPREPLY[@]/#/"$prev,"} ) return ;; --error-exitcode) - COMPREPLY=( $( compgen -W '{0..255}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..255}' -- "$cur") ) return ;; --file-list) @@ -43,22 +43,22 @@ _cppcheck() return ;; -j) - COMPREPLY=( $( compgen -W "{2..$(_ncpus)}" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "{2..$(_ncpus)}" -- "$cur") ) return ;; --language|-x) - COMPREPLY=( $( compgen -W 'c c++' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'c c++' -- "$cur") ) return ;; --std) - COMPREPLY=( $( compgen -W 'c89 c99 c11 c++03 c++11 posix' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'c89 c99 c11 c++03 c++11 posix' \ + -- "$cur") ) return ;; --platform) _filedir - COMPREPLY+=( $( compgen -W 'unix32 unix64 win32A win32W win64 - native' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W 'unix32 unix64 win32A win32W win64 + native' -- "$cur") ) return ;; -rp|--relative-paths) @@ -72,7 +72,7 @@ _cppcheck() return ;; --xml-version) - COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '1 2' -- "$cur") ) return ;; esac @@ -80,7 +80,7 @@ _cppcheck() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else _filedir '@([cht]pp|[cht]xx|cc|[ch]++|[ch])' diff --git a/completions/crontab b/completions/crontab index 59a41238b3c..76a243bafc9 100644 --- a/completions/crontab +++ b/completions/crontab @@ -36,7 +36,7 @@ _crontab() done if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '${!opts[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${!opts[@]}' -- "$cur") ) return fi diff --git a/completions/cryptsetup b/completions/cryptsetup index a98d67b1c1e..f8be116fca2 100644 --- a/completions/cryptsetup +++ b/completions/cryptsetup @@ -2,8 +2,7 @@ _cryptsetup_name() { - COMPREPLY=( $( compgen -X control -W '$( command ls /dev/mapper )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -X control -W '$(command ls /dev/mapper)' -- "$cur") ) } _cryptsetup_device() @@ -27,7 +26,7 @@ _cryptsetup() return ;; --type|-!(-*)M) - COMPREPLY=( $( compgen -W "luks plain loopaes tcrypt" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "luks plain loopaes tcrypt" -- "$cur") ) return ;; esac @@ -38,13 +37,13 @@ _cryptsetup() _get_first_arg if [[ -z $arg ]]; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else - COMPREPLY=( $( compgen -W 'open close resize status benchmark + COMPREPLY=( $(compgen -W 'open close resize status benchmark repair erase luksFormat luksAddKey luksRemoveKey luksChangeKey luksKillSlot luksUUID isLuks luksDump tcryptDump luksSuspend - luksResume luksHeaderBackup luksHeaderRestore' -- "$cur" ) ) + luksResume luksHeaderBackup luksHeaderRestore' -- "$cur") ) fi else local args; _count_args "" "-!(-*)[chslSbopitTdM]" diff --git a/completions/curl b/completions/curl index 6bc4ba8e112..2fe06272dfb 100644 --- a/completions/curl +++ b/completions/curl @@ -32,7 +32,7 @@ _curl() return ;; --cert-type|--key-type) - COMPREPLY=( $( compgen -W 'DER PEM ENG' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'DER PEM ENG' -- "$cur") ) return ;; --crlfile) @@ -48,19 +48,19 @@ _curl() return ;; --delegation) - COMPREPLY=( $( compgen -W 'none policy always' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'none policy always' -- "$cur") ) return ;; --engine) - COMPREPLY=( $( compgen -W 'list' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'list' -- "$cur") ) return ;; --ftp-method) - COMPREPLY=( $( compgen -W 'multicwd nocwd singlecwd' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'multicwd nocwd singlecwd' -- "$cur") ) return ;; --ftp-ssl-ccc-mode) - COMPREPLY=( $( compgen -W 'active passive' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'active passive' -- "$cur") ) return ;; --interface) @@ -76,18 +76,18 @@ _curl() return ;; --stderr) - COMPREPLY=( $( compgen -W '-' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-' -- "$cur") ) _filedir return ;; --tlsauthtype) - COMPREPLY=( $( compgen -W 'SRP' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'SRP' -- "$cur") ) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) fi } && complete -F _curl curl diff --git a/completions/cvs b/completions/cvs index a16d8a5211f..7a052c8474a 100644 --- a/completions/cvs +++ b/completions/cvs @@ -4,7 +4,7 @@ _cvs_entries() { local prefix=${cur%/*}/ IFS=$'\n' [[ -e ${prefix:-}CVS/Entries ]] || prefix="" - entries=( $( cut -d/ -f2 -s ${prefix:-}CVS/Entries 2>/dev/null ) ) + entries=( $(cut -d/ -f2 -s ${prefix:-}CVS/Entries 2>/dev/null) ) if [[ $entries ]]; then entries=( "${entries[@]/#/${prefix:-}}" ) compopt -o filenames @@ -14,9 +14,9 @@ _cvs_entries() _cvs_modules() { if [[ -n $prefix ]]; then - COMPREPLY=( $( command ls -d ${cvsroot}/${prefix}/!(CVSROOT) ) ) + COMPREPLY=( $(command ls -d ${cvsroot}/${prefix}/!(CVSROOT)) ) else - COMPREPLY=( $( command ls -d ${cvsroot}/!(CVSROOT) ) ) + COMPREPLY=( $(command ls -d ${cvsroot}/!(CVSROOT)) ) fi } @@ -27,21 +27,21 @@ _cvs_commands() _cvs_command_options() { - COMPREPLY=( $( compgen -W '$( _parse_help "$1" "--help $2" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" "--help $2")' -- "$cur") ) } _cvs_kflags() { - COMPREPLY=( $( compgen -W 'kv kvl k o b v' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'kv kvl k o b v' -- "$cur") ) } _cvs_roots() { local -a cvsroots cvsroots=( $CVSROOT ) - [[ -r ~/.cvspass ]] && cvsroots+=( $( awk '{ print $2 }' ~/.cvspass ) ) + [[ -r ~/.cvspass ]] && cvsroots+=( $(awk '{ print $2 }' ~/.cvspass) ) [[ -r CVS/Root ]] && mapfile -tO ${#cvsroots[@]} cvsroots < CVS/Root - COMPREPLY=( $( compgen -W '${cvsroots[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${cvsroots[@]}' -- "$cur") ) __ltrim_colon_completions "$cur" } @@ -63,7 +63,7 @@ _cvs() if [[ -z $mode ]]; then case $i in --help|-!(-*)H) - COMPREPLY=( $( compgen -W "$( _cvs_commands )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(_cvs_commands)" -- "$cur") ) return ;; -!(-*)d) @@ -153,7 +153,7 @@ _cvs() if [[ "$cur" != -* ]]; then _cvs_entries [[ -z $cur ]] && files=( !(CVS) ) || \ - files=( $( command ls -d ${cur}* 2>/dev/null ) ) + files=( $(command ls -d ${cur}* 2>/dev/null) ) local f for i in ${!files[@]}; do if [[ ${files[i]} == ?(*/)CVS ]]; then @@ -167,8 +167,8 @@ _cvs() done fi done - COMPREPLY=( $( compgen -X "$_backup_glob" -W '${files[@]}' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -X "$_backup_glob" -W '${files[@]}' \ + -- "$cur") ) else _cvs_command_options "$1" $mode fi @@ -193,7 +193,7 @@ _cvs() _cvs_command_options "$1" $mode else _cvs_entries - COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${entries[@]}' -- "$cur") ) fi ;; annotate) @@ -203,7 +203,7 @@ _cvs() _cvs_command_options "$1" $mode else _cvs_entries - COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${entries[@]}' -- "$cur") ) fi ;; checkout) @@ -224,9 +224,9 @@ _cvs() if [[ "$cur" != -* ]]; then [[ -z $cvsroot ]] && cvsroot=$CVSROOT - COMPREPLY=( $( cvs -d "$cvsroot" co -c 2> /dev/null | \ - awk '{print $1}' ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) + COMPREPLY=( $(cvs -d "$cvsroot" co -c 2> /dev/null | \ + awk '{print $1}') ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") ) else _cvs_command_options "$1" $mode fi @@ -251,15 +251,15 @@ _cvs() # this is the least computationally intensive way found so # far, but other changes (something other than # changed/removed/new) may be missing - changed=( $( cvs -q diff --brief 2>&1 | \ - command sed -ne 's/^Files [^ ]* and \([^ ]*\) differ$/\1/p' ) ) - newremoved=( $( cvs -q diff --brief 2>&1 | \ - command sed -ne 's/^cvs diff: \([^ ]*\) .*, no comparison available$/\1/p' ) ) - COMPREPLY=( $( compgen -W '${changed[@]:-} \ - ${newremoved[@]:-}' -- "$cur" ) ) + changed=( $(cvs -q diff --brief 2>&1 | \ + command sed -ne 's/^Files [^ ]* and \([^ ]*\) differ$/\1/p') ) + newremoved=( $(cvs -q diff --brief 2>&1 | \ + command sed -ne 's/^cvs diff: \([^ ]*\) .*, no comparison available$/\1/p') ) + COMPREPLY=( $(compgen -W '${changed[@]:-} \ + ${newremoved[@]:-}' -- "$cur") ) else _cvs_entries - COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${entries[@]}' -- "$cur") ) fi else _cvs_command_options "$1" $mode @@ -274,7 +274,7 @@ _cvs() [[ $COMPREPLY == *= ]] && compopt -o nospace else _cvs_entries - COMPREPLY=( $( compgen -W '${entries[@]:-}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${entries[@]:-}' -- "$cur") ) fi ;; editors|watchers) @@ -282,7 +282,7 @@ _cvs() _cvs_command_options "$1" $mode else _cvs_entries - COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${entries[@]}' -- "$cur") ) fi ;; export) @@ -303,8 +303,8 @@ _cvs() if [[ "$cur" != -* ]]; then [[ -z $cvsroot ]] && cvsroot=$CVSROOT - COMPREPLY=( $( cvs -d "$cvsroot" co -c | awk '{print $1}' ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) + COMPREPLY=( $(cvs -d "$cvsroot" co -c | awk '{print $1}') ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") ) else _cvs_command_options "$1" $mode fi @@ -330,9 +330,9 @@ _cvs() COMPREPLY=( ${COMPREPLY[@]#$cvsroot} ) COMPREPLY=( ${COMPREPLY[@]#\/} ) fi - pwd=$( pwd ) + pwd=$(pwd) pwd=${pwd##*/} - COMPREPLY=( $( compgen -W '${COMPREPLY[@]} $pwd' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]} $pwd' -- "$cur") ) else _cvs_command_options "$1" $mode fi @@ -346,7 +346,7 @@ _cvs() [[ -r "${entries[i]}" ]] && unset 'entries[i]' done fi - COMPREPLY=( $( compgen -W '${entries[@]:-}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${entries[@]:-}' -- "$cur") ) else _cvs_command_options "$1" $mode fi @@ -367,7 +367,7 @@ _cvs() _cvs_command_options "$1" $mode else _cvs_entries - COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${entries[@]}' -- "$cur") ) fi ;; "") @@ -381,14 +381,14 @@ _cvs() return ;; -*z) - COMPREPLY=( $( compgen -W '{1..9}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{1..9}' -- "$cur") ) return ;; esac - COMPREPLY=( $( compgen -W '$( _cvs_commands ) - $( _parse_help "$1" --help-options ) --help --help-commands - --help-options --version' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_cvs_commands) + $(_parse_help "$1" --help-options) --help --help-commands + --help-options --version' -- "$cur") ) ;; esac diff --git a/completions/cvsps b/completions/cvsps index 64dab54f529..c46df189434 100644 --- a/completions/cvsps +++ b/completions/cvsps @@ -10,23 +10,23 @@ _cvsps() return ;; -s) - COMPREPLY=( $( compgen -W "$( $1 2>/dev/null | - awk '/^PatchSet:?[ \t]/ { print $2 }' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 2>/dev/null | + awk '/^PatchSet:?[ \t]/ { print $2 }')" -- "$cur") ) return ;; -a) - COMPREPLY=( $( compgen -W "$( $1 2>/dev/null | - awk '/^Author:[ \t]/ { print $2 }' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 2>/dev/null | + awk '/^Author:[ \t]/ { print $2 }')" -- "$cur") ) return ;; -b) - COMPREPLY=( $( compgen -W "$( $1 2>/dev/null | - awk '/^Branch:[ \t]/ { print $2 }' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 2>/dev/null | + awk '/^Branch:[ \t]/ { print $2 }')" -- "$cur") ) return ;; -r) - COMPREPLY=( $( compgen -W "$( $1 2>/dev/null | - awk '/^Tag:[ \t]+[^(]/ { print $2 }' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 2>/dev/null | + awk '/^Tag:[ \t]+[^(]/ { print $2 }')" -- "$cur") ) return ;; -p) @@ -38,7 +38,7 @@ _cvsps() return ;; -Z) - COMPREPLY=( $( compgen -W '{1..9}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{1..9}' -- "$cur") ) return ;; --root) @@ -48,7 +48,7 @@ _cvsps() esac if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) else _xfunc cvs _cvs_roots fi diff --git a/completions/dd b/completions/dd index b2647bca1cb..5384dd5ee3e 100644 --- a/completions/dd +++ b/completions/dd @@ -13,28 +13,28 @@ _dd() ;; conv=*) cur=${cur#*=} - COMPREPLY=( $( compgen -W 'ascii ebcdic ibm block unblock lcase + COMPREPLY=( $(compgen -W 'ascii ebcdic ibm block unblock lcase ucase sparse swab sync excl nocreat notrunc noerror fdatasync - fsync' -- "$cur" ) ) + fsync' -- "$cur") ) return ;; iflag=*|oflag=*) cur=${cur#*=} - COMPREPLY=( $( compgen -W 'append direct directory dsync sync + COMPREPLY=( $(compgen -W 'append direct directory dsync sync fullblock nonblock noatime nocache noctty nofollow count_bytes - skip_bytes seek_bytes' -- "$cur" ) ) + skip_bytes seek_bytes' -- "$cur") ) return ;; status=*) cur=${cur#*=} - COMPREPLY=( $( compgen -W 'none noxfer progress' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'none noxfer progress' -- "$cur") ) return ;; esac - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) \ - $( compgen -W 'bs cbs conv count ibs if iflag obs of oflag - seek skip status' -S '=' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") \ + $(compgen -W 'bs cbs conv count ibs if iflag obs of oflag + seek skip status' -S '=' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace } && complete -F _dd dd diff --git a/completions/deja-dup b/completions/deja-dup index a508bb1eed5..ad3baeb82b9 100644 --- a/completions/deja-dup +++ b/completions/deja-dup @@ -22,8 +22,7 @@ _deja_dup() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" --help-all)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/desktop-file-validate b/completions/desktop-file-validate index 93f210619d9..7d9f05b2203 100644 --- a/completions/desktop-file-validate +++ b/completions/desktop-file-validate @@ -12,7 +12,7 @@ _desktop_file_validate() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi diff --git a/completions/dhclient b/completions/dhclient index 797eca423ad..b097bbac4f8 100644 --- a/completions/dhclient +++ b/completions/dhclient @@ -10,7 +10,7 @@ _dhclient() return ;; -D) - COMPREPLY=( $( compgen -W 'LL LLT' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'LL LLT' -- "$cur") ) return ;; -*f) @@ -24,7 +24,7 @@ _dhclient() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) else _available_interfaces fi diff --git a/completions/dict b/completions/dict index c161546e64a..44180d495cb 100644 --- a/completions/dict +++ b/completions/dict @@ -34,17 +34,17 @@ _dict() done if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi case $prev in --database|-info|-!(-*)[di]) - COMPREPLY=( $( compgen -W '$( _dictdata -D )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_dictdata -D)' -- "$cur") ) return ;; --strategy|-!(-*)s) - COMPREPLY=( $( compgen -W '$( _dictdata -S )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_dictdata -S)' -- "$cur") ) return ;; esac @@ -55,10 +55,10 @@ _dict() # it down with grep if $cur looks like something that's safe to embed # in a pattern instead. if [[ $cur == +([-A-Za-z0-9/.]) ]]; then - COMPREPLY=( $( compgen -W \ - '$( command grep "^${cur//./\\.}" $dictfile )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$(command grep "^${cur//./\\.}" $dictfile)' -- "$cur") ) else - COMPREPLY=( $( compgen -W '$( cat $dictfile )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(cat $dictfile)' -- "$cur") ) fi fi } && diff --git a/completions/dnssec-keygen b/completions/dnssec-keygen index ec7b411c539..2ecfcdc5e8f 100644 --- a/completions/dnssec-keygen +++ b/completions/dnssec-keygen @@ -2,11 +2,11 @@ _dnssec_keygen_optarg() { - local args=$( "$1" -h 2>&1 | \ + local args=$("$1" -h 2>&1 | \ command sed -e 's/|/ /g' -e 's/(.*//' \ -ne '/^[[:space:]]*'$2'/,/^[[:space:]]*[(-]/p' | \ - command sed -e 's/^[[:space:]]*'$2'.*://' -e '/^[[:space:]]*-/d' ) - COMPREPLY+=( $( compgen -W '$args' -- "$cur" ) ) + command sed -e 's/^[[:space:]]*'$2'.*://' -e '/^[[:space:]]*-/d') + COMPREPLY+=( $(compgen -W '$args' -- "$cur") ) } _dnssec_keygen() @@ -32,14 +32,14 @@ _dnssec_keygen() return ;; -v) - COMPREPLY=( $( compgen -W '{0..10}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..10}' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" | \ - command sed -e "s/:\$//" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" | \ + command sed -e "s/:\$//")' -- "$cur") ) return fi } && diff --git a/completions/dnsspoof b/completions/dnsspoof index d6b7872b415..e45d48d6c2d 100644 --- a/completions/dnsspoof +++ b/completions/dnsspoof @@ -17,7 +17,7 @@ _dnsspoof() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) fi } && diff --git a/completions/dot b/completions/dot index bc3531bbc74..bad82f2c913 100644 --- a/completions/dot +++ b/completions/dot @@ -12,28 +12,28 @@ _dot() return ;; -T*) - local langs=( $( "$1" -TNON_EXISTENT 2>&1 | \ - command sed -ne 's/.*one of://p' ) ) - COMPREPLY=( $( compgen -P -T -W '${langs[@]}' -- "${cur#-T}" ) ) + local langs=( $("$1" -TNON_EXISTENT 2>&1 | \ + command sed -ne 's/.*one of://p') ) + COMPREPLY=( $(compgen -P -T -W '${langs[@]}' -- "${cur#-T}") ) return ;; -K*) - local layouts=( $( "$1" -KNON_EXISTENT 2>&1 | \ - command sed -ne 's/.*one of://p' ) ) - COMPREPLY=( $( compgen -P -K -W '${layouts[@]}' -- "${cur#-K}" ) ) + local layouts=( $("$1" -KNON_EXISTENT 2>&1 | \ + command sed -ne 's/.*one of://p') ) + COMPREPLY=( $(compgen -P -K -W '${layouts[@]}' -- "${cur#-K}") ) return ;; -o*) cur=${cur#-o} _filedir - COMPREPLY=( $( compgen -P -o -W '${COMPREPLY[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -P -o -W '${COMPREPLY[@]}' -- "$cur") ) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '-V -v -G -N -E -T -K -l -o -O -P -q -s -y -n - -n1 -n2 -x -Lg -LO -Ln -LU -LC -LT -m -c -?' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-V -v -G -N -E -T -K -l -o -O -P -q -s -y -n + -n1 -n2 -x -Lg -LO -Ln -LU -LC -LT -m -c -?' -- "$cur") ) [[ $COMPREPLY == -@([GNETKo]|L[nUCT]) ]] && compopt -o nospace return fi diff --git a/completions/dpkg b/completions/dpkg index f5b79103b38..d5f7e6efe77 100644 --- a/completions/dpkg +++ b/completions/dpkg @@ -60,7 +60,7 @@ _dpkg() return ;; --status|--print-avail|--list|--show|-!(-*)[splW]) - COMPREPLY=( $( apt-cache pkgnames "$cur" 2>/dev/null ) ) + COMPREPLY=( $(apt-cache pkgnames "$cur" 2>/dev/null) ) return ;; --search|-!(-*)S) @@ -68,18 +68,18 @@ _dpkg() return ;; --remove|--verify|-!(-*)[rV]) - COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) ) + COMPREPLY=( $(_comp_dpkg_installed_packages "$cur") ) return ;; --listfiles|--purge|-!(-*)[LP]) - COMPREPLY=( $( _comp_dpkg_purgeable_packages "$cur" ) ) + COMPREPLY=( $(_comp_dpkg_purgeable_packages "$cur") ) return ;; esac $split && return - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace } && complete -F _dpkg dpkg dpkg-deb dpkg-query @@ -95,14 +95,14 @@ _dpkg_reconfigure() case $prev in --frontend|-!(-*)f) - opt=( $( printf '%s\n' /usr/share/perl5/Debconf/FrontEnd/* ) ) + opt=( $(printf '%s\n' /usr/share/perl5/Debconf/FrontEnd/*) ) opt=( ${opt[@]##*/} ) opt=( ${opt[@]%.pm} ) - COMPREPLY=( $( compgen -W '${opt[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${opt[@]}' -- "$cur") ) return ;; --priority|-!(-*)p) - COMPREPLY=( $( compgen -W 'low medium high critical' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'low medium high critical' -- "$cur") ) return ;; esac @@ -111,7 +111,7 @@ _dpkg_reconfigure() COMPREPLY=( $(compgen -W '--frontend --priority --all --unseen-only --help --showold --force --terse' -- "$cur" ) ) else - COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) ) + COMPREPLY=( $(_comp_dpkg_installed_packages "$cur") ) fi } && complete -F _dpkg_reconfigure -o default dpkg-reconfigure diff --git a/completions/dpkg-source b/completions/dpkg-source index 826d0f83970..ffc34c41b2f 100644 --- a/completions/dpkg-source +++ b/completions/dpkg-source @@ -33,7 +33,7 @@ _dpkg_source() _filedir 'dsc' ;; *) - COMPREPLY=( $( compgen -W "$unpackopts" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$unpackopts" -- "$cur") ) _filedir -d _filedir ;; @@ -57,7 +57,7 @@ _dpkg_source() ;; -F) # -F: force change log format - COMPREPLY=( $( command ls /usr/lib/dpkg/parsechangelog ) ) + COMPREPLY=( $(command ls /usr/lib/dpkg/parsechangelog) ) ;; -V|-D) # -V: set a substitution variable @@ -72,23 +72,23 @@ _dpkg_source() # $cur contains a "=" COMPREPLY=() else - COMPREPLY=( $( compgen -W "$fields" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$fields" -- "$cur") ) fi ;; -U) # -U: remove a field # Suggest possible fieldnames - COMPREPLY=( $( compgen -W "$fields" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$fields" -- "$cur") ) ;; *) - COMPREPLY=( $( compgen -W "$packopts $unpackopts" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$packopts $unpackopts" \ + -- "$cur") ) ;; esac return ;; *) - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$options" -- "$cur") ) return ;; esac diff --git a/completions/dselect b/completions/dselect index 19a90fd643d..6ad388428cd 100644 --- a/completions/dselect +++ b/completions/dselect @@ -17,10 +17,10 @@ _dselect() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) else - COMPREPLY=( $( compgen -W 'access update select install config remove - quit' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'access update select install config remove + quit' -- "$cur") ) fi } && diff --git a/completions/dsniff b/completions/dsniff index 165ab74bcad..e8e5bf37b7c 100644 --- a/completions/dsniff +++ b/completions/dsniff @@ -17,7 +17,7 @@ _dsniff() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" ) -r -w -p' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1") -r -w -p' -- "$cur") ) fi } && diff --git a/completions/dumpdb b/completions/dumpdb index ced754f5afd..981211bbbb2 100644 --- a/completions/dumpdb +++ b/completions/dumpdb @@ -6,8 +6,8 @@ _dumpdb() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--marshal --pickle --noprint --help' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--marshal --pickle --noprint --help' \ + -- "$cur") ) else _filedir fi diff --git a/completions/dumpe2fs b/completions/dumpe2fs index fe992f62b0b..f44ecc321d1 100644 --- a/completions/dumpe2fs +++ b/completions/dumpe2fs @@ -16,7 +16,7 @@ _dumpe2fs() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) return fi diff --git a/completions/e2freefrag b/completions/e2freefrag index bee4a169df0..355ebb94018 100644 --- a/completions/e2freefrag +++ b/completions/e2freefrag @@ -12,7 +12,7 @@ _e2freefrag() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" -h)' -- "$cur") ) return fi diff --git a/completions/ebtables b/completions/ebtables index 05bfed602a3..696676d1f77 100644 --- a/completions/ebtables +++ b/completions/ebtables @@ -18,35 +18,35 @@ _ebtables() case $prev in -!(-*)[AIDPFXLZ]) - COMPREPLY=( $( compgen -W '`"$1" $table -L 2>/dev/null | \ - command sed -ne "$chain"`' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '`"$1" $table -L 2>/dev/null | \ + command sed -ne "$chain"`' -- "$cur") ) ;; -!(-*)t) - COMPREPLY=( $( compgen -W 'nat filter broute' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'nat filter broute' -- "$cur") ) ;; -!(-*)j) if [[ "$table" == "-t filter" || -z "$table" ]]; then - COMPREPLY=( $( compgen -W '$targets + COMPREPLY=( $(compgen -W '$targets $("$1" $table -L 2>/dev/null | \ command sed -n -e "s/INPUT\|OUTPUT\|FORWARD//" \ -e "$chain")' \ - -- "$cur" ) ) + -- "$cur") ) elif [[ $table == "-t nat" ]]; then - COMPREPLY=( $( compgen -W '$targets + COMPREPLY=( $(compgen -W '$targets $("$1" $table -L 2>/dev/null | \ command sed -n -e "s/OUTPUT|PREROUTING|POSTROUTING//" \ -e "$chain")' \ - -- "$cur" ) ) + -- "$cur") ) elif [[ $table == "-t broute" ]]; then - COMPREPLY=( $( compgen -W 'ACCEPT DROP + COMPREPLY=( $(compgen -W 'ACCEPT DROP $("$1" $table -L 2>/dev/null | \ command sed -n -e "s/BROUTING//" -e "$chain")' \ - -- "$cur" ) ) + -- "$cur") ) fi ;; *) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--802_3-sap --802_3-type --among-dst + COMPREPLY=( $(compgen -W '--802_3-sap --802_3-type --among-dst --among-dst-file --among-src --among-src-file --append --arp-gratuitous --arp-htype --arp-ip-dst --arp-ip-src --arp-mac-dst --arp-mac-src --arp-opcode --arp-ptype --arpreply-mac @@ -72,7 +72,7 @@ _ebtables() --stp-sender-prio --stp-type --table --to-destination --to-dst --to-source --to-src --ulog --ulog-cprange --ulog-nlgroup --ulog-prefix --ulog-qthreshold --version --vlan-encap --vlan-id - --vlan-prio --zero' -- "$cur" ) ) + --vlan-prio --zero' -- "$cur") ) fi ;; esac diff --git a/completions/ecryptfs-migrate-home b/completions/ecryptfs-migrate-home index 50798350276..bad0962e4e3 100644 --- a/completions/ecryptfs-migrate-home +++ b/completions/ecryptfs-migrate-home @@ -10,12 +10,12 @@ _ecryptfs_migrate_home() return ;; --user|-u) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; esac - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) } && complete -F _ecryptfs_migrate_home ecryptfs-migrate-home diff --git a/completions/eog b/completions/eog index d5621119037..d10cbbae862 100644 --- a/completions/eog +++ b/completions/eog @@ -14,8 +14,7 @@ _eog() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" --help-all)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/ether-wake b/completions/ether-wake index 5c368f7c6a0..a3e3e406ebf 100644 --- a/completions/ether-wake +++ b/completions/ether-wake @@ -16,7 +16,7 @@ _ether_wake() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -u ) -V' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -u) -V' -- "$cur") ) return fi diff --git a/completions/evince b/completions/evince index 63d98801eac..d50f23c3a4f 100644 --- a/completions/evince +++ b/completions/evince @@ -20,8 +20,7 @@ _evince() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" --help-all)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/export b/completions/export index 31715f9a45b..816182f63ce 100644 --- a/completions/export +++ b/completions/export @@ -33,7 +33,7 @@ _export() case $cur in *=) - local pval=$( quote "$( eval printf %s \"\$${cur%=}\" )" ) + local pval=$(quote "$(eval printf %s \"\$${cur%=}\")") # Complete previous value if it's not empty. if [[ $pval != \'\' ]]; then COMPREPLY=( "$pval" ) @@ -48,8 +48,7 @@ _export() ;; *) if [[ $cword -eq 1 && $cur == -* ]]; then - COMPREPLY=( $( compgen -W \ - '-p $( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-p $(_parse_usage "$1")' -- "$cur") ) return fi local suffix @@ -57,7 +56,7 @@ _export() suffix+== compopt -o nospace fi - COMPREPLY=( $( compgen -A $action -S "$suffix" -- "$cur" ) ) + COMPREPLY=( $(compgen -A $action -S "$suffix" -- "$cur") ) ;; esac } && diff --git a/completions/faillog b/completions/faillog index acb74558890..5e7d2ab2f7b 100644 --- a/completions/faillog +++ b/completions/faillog @@ -10,7 +10,7 @@ _faillog() return ;; --user|-!(-*)u) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; esac @@ -18,7 +18,7 @@ _faillog() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && diff --git a/completions/fbgs b/completions/fbgs index c58a7af9e4e..ebaf670c6bb 100644 --- a/completions/fbgs +++ b/completions/fbgs @@ -8,23 +8,23 @@ _fbgs() case "$prev" in -f|--font) local IFS=$'\n' - COMPREPLY=( $( compgen -W '$( fc-list 2>/dev/null )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(fc-list 2>/dev/null)' -- "$cur") ) return ;; -m|--mode) - COMPREPLY=( $( compgen -W '$( command sed \ + COMPREPLY=( $(compgen -W '$(command sed \ -n "/^mode/{s/^mode \{1,\}\"\([^\"]\{1,\}\)\"/\1/g;p}" \ - /etc/fb.modes 2> /dev/null )' -- "$cur" ) ) + /etc/fb.modes 2> /dev/null)' -- "$cur") ) return ;; -d|--device) - COMPREPLY=( $( compgen -f -d -- "${cur:-/dev/}" ) ) + COMPREPLY=( $(compgen -f -d -- "${cur:-/dev/}") ) return ;; -fp|--firstpage|-lp|--lastpage|-r|--resolution|-s|--scroll|-t|\ --timeout) # expect integer value - COMPREPLY+=( $( compgen -W '{0..9}' ) ) + COMPREPLY+=( $(compgen -W '{0..9}') ) compopt -o nospace return ;; @@ -35,11 +35,11 @@ _fbgs() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--bell --help --password -fp --firstpage + COMPREPLY=( $(compgen -W '--bell --help --password -fp --firstpage -lp --lastpage --color -l -xl -xxl --resolution --autozoom --{,no}autoup --{,no}autodown --{,no}fitwidth --{,no}verbose --{,no}random --vt --scroll --timeout --{,no}once --gamma --font - --device --mode' -- "$cur" ) ) + --device --mode' -- "$cur") ) [[ $COMPREPLY ]] && return fi diff --git a/completions/fbi b/completions/fbi index 75b46b61e43..89c2ce124f3 100644 --- a/completions/fbi +++ b/completions/fbi @@ -11,22 +11,22 @@ _fbi() return ;; -r|--resolution) - COMPREPLY+=( $( compgen -W '{1..5}' ) ) + COMPREPLY+=( $(compgen -W '{1..5}') ) return ;; -f|--font) local IFS=$'\n' - COMPREPLY=( $( compgen -W '$( fc-list 2> /dev/null )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(fc-list 2> /dev/null)' -- "$cur") ) return ;; -m|--mode) - COMPREPLY=( $( compgen -W '$( command sed \ + COMPREPLY=( $(compgen -W '$(command sed \ -n "/^mode/{s/^mode \{1,\}\"\([^\"]\{1,\}\)\"/\1/g;p}" \ - /etc/fb.modes 2> /dev/null )' -- "$cur" ) ) + /etc/fb.modes 2> /dev/null)' -- "$cur") ) return ;; -d|--device) - COMPREPLY=( $( compgen -f -d -- "${cur:-/dev/}" ) ) + COMPREPLY=( $(compgen -f -d -- "${cur:-/dev/}") ) return ;; --cachemem|--blend|-T|--vt|-s|--scroll|-t|--timeout|-g|--gamma) @@ -36,12 +36,12 @@ _fbi() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --version --store --list --text + COMPREPLY=( $(compgen -W '--help --version --store --list --text --autozoom --{,no}autoup --{,no}autodown --{,no}fitwidth --{,no}verbose --{,no}random --{,no}comments --{,no}edit --{,no}backup --{,no}preserve --{,no}readahead --cachemem --blend --vt --scroll --timeout --{,no}once --resolution --gamma --font - --device --mode' -- "$cur" ) ) + --device --mode' -- "$cur") ) [[ $COMPREPLY ]] && return fi diff --git a/completions/feh b/completions/feh index 3b8fc384dda..a4400ec8138 100644 --- a/completions/feh +++ b/completions/feh @@ -7,7 +7,7 @@ _feh() case "$prev" in --image-bg|-B) - COMPREPLY=( $( compgen -W 'checks white black' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'checks white black' -- "$cur") ) return ;; --filelist|--output|--output-only|--start-at|-!(-*)[foO\|]) @@ -21,19 +21,19 @@ _feh() --font|--menu-font|--title-font|-!(-*)[eM@]) # expect string like "dejavu.ttf/12" if [[ "$cur" == */* ]]; then # expect integer value - COMPREPLY=( $( compgen -P "$cur" -W '{0..9}' ) ) + COMPREPLY=( $(compgen -P "$cur" -W '{0..9}') ) compopt -o nospace return fi local font_path - # font_path="$( imlib2-config --prefix 2> /dev/null )/share/imlib2/data/fonts" - # COMPREPLY=( $( cd "$font_path" 2> /dev/null; compgen -f \ - # -X "!*.@([tT][tT][fF])" -S / -- "$cur" ) ) + # font_path="$(imlib2-config --prefix 2> /dev/null)/share/imlib2/data/fonts" + # COMPREPLY=( $(cd "$font_path" 2> /dev/null; compgen -f \ + # -X "!*.@([tT][tT][fF])" -S / -- "$cur") ) for (( i=${#words[@]}-1; i>0; i-- )); do if [[ ${words[i]} == -@(C|-fontpath) ]]; then font_path="${words[i+1]}" - COMPREPLY+=( $( cd "$font_path" 2> /dev/null; compgen -f \ - -X "!*.@([tT][tT][fF])" -S / -- "$cur" ) ) + COMPREPLY+=( $(cd "$font_path" 2> /dev/null; compgen -f \ + -X "!*.@([tT][tT][fF])" -S / -- "$cur") ) fi done compopt -o nospace @@ -47,38 +47,38 @@ _feh() if [[ "$theme_name" == '#'* || "$theme_name" == "" ]]; then continue fi - COMPREPLY+=( $( compgen -W "$theme_name" -- "$cur" ) ) + COMPREPLY+=( $(compgen -W "$theme_name" -- "$cur") ) done < "$conf_path" return ;; --sort|-!(-*)S) - COMPREPLY=( $( compgen -W 'name filename mtime width height - pixels size format' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'name filename mtime width height + pixels size format' -- "$cur") ) return ;; --reload|--limit-height|--limit-width|--thumb-height|--thumb-width|\ --thumb-redraw|--magick-timeout|-!(-*)[RHWEyJ]) # expect integer value - COMPREPLY+=( $( compgen -W '{0..9}' ) ) + COMPREPLY+=( $(compgen -W '{0..9}') ) compopt -o nospace return ;; --zoom) # expect integer value or "max", "fill" - COMPREPLY=( $( compgen -W 'max fill' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'max fill' -- "$cur") ) if [[ ! $cur || ! $COMPREPLY ]]; then - COMPREPLY+=( $( compgen -W '{0..9}' ) ) + COMPREPLY+=( $(compgen -W '{0..9}') ) compopt -o nospace fi return ;; --alpha|-!(-*)a) - COMPREPLY=( $( compgen -W '{0..255}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..255}' -- "$cur") ) return ;; --bg|-!(-*)b) _filedir - COMPREPLY+=( $( compgen -W 'trans' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W 'trans' -- "$cur") ) return ;; --geometry|--max-dimension|--min-dimension|-!(-*)g) @@ -86,7 +86,7 @@ _feh() if [[ $cur && "$cur" != *x* ]]; then COMPREPLY=( x ) fi - COMPREPLY+=( $( compgen -W "{0..9}" ) ) + COMPREPLY+=( $(compgen -W "{0..9}") ) compopt -o nospace return ;; @@ -101,7 +101,7 @@ _feh() if [[ "$cur" == -* ]]; then # Some versions of feh just output "See 'man feh'" for --help :( - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" --help)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace [[ $COMPREPLY ]] && return fi diff --git a/completions/file b/completions/file index 558273c0d64..494c7866afa 100644 --- a/completions/file +++ b/completions/file @@ -14,14 +14,14 @@ _file() return ;; --exclude|-!(-*)e) - COMPREPLY=( $( compgen -W 'apptype ascii cdf compress elf encoding - soft tar text tokens troff' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'apptype ascii cdf compress elf encoding + soft tar text tokens troff' -- "$cur") ) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi diff --git a/completions/file-roller b/completions/file-roller index ef7b6ac74e1..bebf04eed49 100644 --- a/completions/file-roller +++ b/completions/file-roller @@ -29,8 +29,7 @@ _file_roller() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" --help-all)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/filefrag b/completions/filefrag index b4866dc0e49..b8b51e3c5c7 100644 --- a/completions/filefrag +++ b/completions/filefrag @@ -6,7 +6,7 @@ _filefrag() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) return fi diff --git a/completions/filesnarf b/completions/filesnarf index 0cdcfe2776d..01766555a4a 100644 --- a/completions/filesnarf +++ b/completions/filesnarf @@ -13,7 +13,7 @@ _snarf() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) fi } && diff --git a/completions/find b/completions/find index 4451d0595c9..6008c2164cf 100644 --- a/completions/find +++ b/completions/find @@ -9,7 +9,7 @@ _find() case $prev in -maxdepth|-mindepth) - COMPREPLY=( $( compgen -W '{0..9}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..9}' -- "$cur") ) return ;; -newer|-anewer|-cnewer|-fls|-fprint|-fprint0|-fprintf|-name|-iname|\ @@ -20,7 +20,7 @@ _find() -fstype) _fstypes [[ $OSTYPE == *bsd* ]] && \ - COMPREPLY+=( $( compgen -W 'local rdonly' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W 'local rdonly' -- "$cur") ) return ;; -gid) @@ -28,11 +28,11 @@ _find() return ;; -group) - COMPREPLY=( $( compgen -g -- "$cur" 2>/dev/null) ) + COMPREPLY=( $(compgen -g -- "$cur" 2>/dev/null) ) return ;; -xtype|-type) - COMPREPLY=( $( compgen -W 'b c d p f l s' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'b c d p f l s' -- "$cur") ) return ;; -uid) @@ -40,7 +40,7 @@ _find() return ;; -user) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; -exec|-execdir|-ok|-okdir) @@ -56,8 +56,8 @@ _find() return ;; -regextype) - COMPREPLY=( $( compgen -W 'emacs posix-awk posix-basic posix-egrep - posix-extended' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'emacs posix-awk posix-basic posix-egrep + posix-extended' -- "$cur") ) return ;; esac @@ -75,7 +75,7 @@ _find() fi # complete using basic options - COMPREPLY=( $( compgen -W '-daystart -depth -follow -help + COMPREPLY=( $(compgen -W '-daystart -depth -follow -help -ignore_readdir_race -maxdepth -mindepth -mindepth -mount -noignore_readdir_race -noleaf -regextype -version -warn -nowarn -xdev -amin -anewer -atime -cmin -cnewer -ctime -empty -executable -false @@ -84,7 +84,7 @@ _find() -readable -regex -samefile -size -true -type -uid -used -user -wholename -writable -xtype -context -delete -exec -execdir -fls -fprint -fprint0 -fprintf -ls -ok -okdir -print -print0 -printf -prune - -quit' -- "$cur" ) ) + -quit' -- "$cur") ) if [[ ${#COMPREPLY[@]} -ne 0 ]]; then # this removes any options from the list of completions that have diff --git a/completions/find_member b/completions/find_member index df1a24f9c94..720e3074b28 100644 --- a/completions/find_member +++ b/completions/find_member @@ -15,8 +15,8 @@ _find_member() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--listname --exclude --owners --help' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--listname --exclude --owners --help' \ + -- "$cur") ) fi } && diff --git a/completions/fio b/completions/fio index 00a3350bac0..7710cf6b330 100644 --- a/completions/fio +++ b/completions/fio @@ -11,23 +11,23 @@ _fio() ;; --debug) local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," - COMPREPLY=( $( compgen -W "process file io mem blktrace verify + COMPREPLY=( $(compgen -W "process file io mem blktrace verify random parse diskutil job mutex profile time net rate compress - steadystate helperthread" -- "${cur##*,}" ) ) + steadystate helperthread" -- "${cur##*,}") ) [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} ) return ;; --output-format) - COMPREPLY=( $( compgen -W "terse json json+ normal" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "terse json json+ normal" -- "$cur") ) return ;; --terse-version) - COMPREPLY=( $( compgen -W "2 3" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "2 3" -- "$cur") ) return ;; --cmdhelp) # TODO more commands? - COMPREPLY=( $( compgen -W "all" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "all" -- "$cur") ) return ;; --enghelp) @@ -36,7 +36,7 @@ _fio() return ;; --eta) - COMPREPLY=( $( compgen -W "always never auto" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "always never auto" -- "$cur") ) return ;; --daemonize) @@ -52,7 +52,7 @@ _fio() return ;; --idle-prof) - COMPREPLY=( $( compgen -W "system percpu calibrate" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "system percpu calibrate" -- "$cur") ) return ;; --inflate-log) @@ -65,7 +65,7 @@ _fio() ;; --trigger|--trigger-remote) compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=( $(compgen -c -- "$cur") ) return ;; --aux-path) @@ -77,7 +77,7 @@ _fio() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/firefox b/completions/firefox index adbda33c533..eeaca9f6727 100644 --- a/completions/firefox +++ b/completions/firefox @@ -26,7 +26,7 @@ _firefox() return ;; --debugger|-d) - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=( $(compgen -c -- "$cur") ) return ;; esac @@ -34,7 +34,7 @@ _firefox() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/flake8 b/completions/flake8 index 37fce9eb212..f18351e861a 100644 --- a/completions/flake8 +++ b/completions/flake8 @@ -10,11 +10,11 @@ _flake8() return ;; --format) - COMPREPLY=( $( compgen -W 'default pylint' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'default pylint' -- "$cur") ) return ;; --jobs|-!(-*)j) - COMPREPLY=( $( compgen -W "auto {1..$(_ncpus)}" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "auto {1..$(_ncpus)}" -- "$cur") ) return ;; --output-file|--append-config|--config) @@ -30,7 +30,7 @@ _flake8() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/freeciv b/completions/freeciv index 40caa6b9b6c..0f475482869 100644 --- a/completions/freeciv +++ b/completions/freeciv @@ -14,11 +14,11 @@ _freeciv() return ;; --Announce|-A) - COMPREPLY=( $( compgen -W 'IPv4 IPv6 none' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'IPv4 IPv6 none' -- "$cur") ) return ;; --debug|-d) - COMPREPLY=( $( compgen -W '{0..3}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..3}' -- "$cur") ) return ;; --Meta|--server|-[Ms]) @@ -26,13 +26,13 @@ _freeciv() return ;; --Plugin|-P) - COMPREPLY=( $( compgen -W 'none esd sdl' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'none esd sdl' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) fi } && diff --git a/completions/freeciv-server b/completions/freeciv-server index 78f57afae8e..08f63158f6a 100644 --- a/completions/freeciv-server +++ b/completions/freeciv-server @@ -13,7 +13,7 @@ _civserver() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) fi } && diff --git a/completions/function b/completions/function index fbcf10d285b..a97b5255c41 100644 --- a/completions/function +++ b/completions/function @@ -8,28 +8,28 @@ _function() if [[ $1 == @(declare|typeset) ]]; then if [[ $cur == [-+]* ]]; then local opts - opts=( $( _parse_usage "$1" ) ) + opts=( $(_parse_usage "$1") ) # Most options also have a '+' form. We'll exclude the ones that don't with compgen. opts+=( ${opts[*]/-/+} ) - COMPREPLY=( $( compgen -W "${opts[*]}" -X '+[Ffgp]' -- "$cur" ) ) + COMPREPLY=( $(compgen -W "${opts[*]}" -X '+[Ffgp]' -- "$cur") ) else local i=1 while [[ ${words[i]} == [-+]* ]]; do if [[ ${words[i]} == -*[fF]* ]]; then - COMPREPLY=( $( compgen -A function -- "$cur" ) ) + COMPREPLY=( $(compgen -A function -- "$cur") ) return fi ((i++)) done if [[ $i -gt 1 ]]; then # There was at least one option and it was not one that limited operations to functions - COMPREPLY=( $( compgen -A variable -- "$cur" ) ) + COMPREPLY=( $(compgen -A variable -- "$cur") ) fi fi elif [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -A function -- "$cur" ) ) + COMPREPLY=( $(compgen -A function -- "$cur") ) else - COMPREPLY=( "() $( type -- ${words[1]} | command sed -e 1,2d )" ) + COMPREPLY=( "() $(type -- ${words[1]} | command sed -e 1,2d)" ) fi } && complete -F _function function declare typeset diff --git a/completions/fusermount b/completions/fusermount index ba42b1d6e94..e4c29630994 100644 --- a/completions/fusermount +++ b/completions/fusermount @@ -10,15 +10,15 @@ _fusermount() return ;; -*u) - COMPREPLY=( $( compgen -W "$( awk \ + COMPREPLY=( $(compgen -W "$(awk \ '{ if ($3 ~ /^fuse(\.|$)/) print $2 }' /etc/mtab \ - 2>/dev/null )" -- "$cur" ) ) + 2>/dev/null)" -- "$cur") ) return ;; esac if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) else _filedir -d fi diff --git a/completions/gcc b/completions/gcc index d593d092114..b72bf972eb9 100644 --- a/completions/gcc +++ b/completions/gcc @@ -34,13 +34,14 @@ _gcc() esac if [[ "$cur" == -* ]]; then - cc=$( $1 -print-prog-name=$backend 2>/dev/null ) + cc=$($1 -print-prog-name=$backend 2>/dev/null) [[ $cc ]] || return # sink stderr: # for C/C++/ObjectiveC it's useless # for FORTRAN/Java it's an error - COMPREPLY=( $( compgen -W "$( $cc --help 2>/dev/null | tr '\t' ' ' |\ - command sed -e '/^ *-/!d' -e 's/ *-\([^][ <>]*\).*/-\1/' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($cc --help 2>/dev/null | tr '\t' ' ' |\ + command sed -e '/^ *-/!d' -e 's/ *-\([^][ <>]*\).*/-\1/')" \ + -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else _filedir @@ -50,16 +51,16 @@ complete -F _gcc gcc{,-5,-6,-7,-8} g++{,-5,-6,-7,-8} g77 g95 \ gccgo{,-5,-6,-7,-8} gcj gfortran{,-5,-6,-7,-8} gpc && { cc --version 2>/dev/null | command grep -q GCC || \ - [[ $( _realcommand cc ) == *gcc* ]] && \ + [[ $(_realcommand cc) == *gcc* ]] && \ complete -F _gcc cc || complete -F _minimal cc c++ --version 2>/dev/null | command grep -q GCC || \ - [[ $( _realcommand c++ ) == *g++* ]] && \ + [[ $(_realcommand c++) == *g++* ]] && \ complete -F _gcc c++ || complete -F _minimal c++ f77 --version 2>/dev/null | command grep -q GCC || \ - [[ $( _realcommand f77 ) == *gfortran* ]] && \ + [[ $(_realcommand f77) == *gfortran* ]] && \ complete -F _gcc f77 || complete -F _minimal f77 f95 --version 2>/dev/null | command grep -q GCC || \ - [[ $( _realcommand f95 ) == *gfortran* ]] && \ + [[ $(_realcommand f95) == *gfortran* ]] && \ complete -F _gcc f95 || complete -F _minimal f95 } diff --git a/completions/gcl b/completions/gcl index 5d1ca5f32a7..9acc813d3f2 100644 --- a/completions/gcl +++ b/completions/gcl @@ -9,8 +9,8 @@ _gcl() # completing an option (may or may not be separated by a space) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-eval -load -f -batch -dir -libdir -compile - -o-file -c-file -h-file -data-file -system-p' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-eval -load -f -batch -dir -libdir -compile + -o-file -c-file -h-file -data-file -system-p' -- "$cur") ) else _filedir fi diff --git a/completions/gdb b/completions/gdb index 75414782c41..6157fbe5528 100644 --- a/completions/gdb +++ b/completions/gdb @@ -20,25 +20,25 @@ _gdb() if [[ "$cur" == */* ]]; then # compgen -c works as expected if $cur contains any slashes. IFS=$'\n' - COMPREPLY=( $( PATH="$PATH:." compgen -d -c -- "$cur" ) ) + COMPREPLY=( $(PATH="$PATH:." compgen -d -c -- "$cur") ) else # otherwise compgen -c contains Bash's built-in commands, # functions and aliases. Thus we need to retrieve the program # names manually. IFS=":" - local path_array=( $( \ - command sed -e 's/:\{2,\}/:/g' -e 's/^://' -e 's/:$//' <<<"$PATH" ) ) + local path_array=( $(\ + command sed -e 's/:\{2,\}/:/g' -e 's/^://' -e 's/:$//' <<<"$PATH") ) IFS=$'\n' - COMPREPLY=( $( compgen -d -W '$(find "${path_array[@]}" . \ + COMPREPLY=( $(compgen -d -W '$(find "${path_array[@]}" . \ -mindepth 1 -maxdepth 1 -not -type d -executable \ - -printf "%f\\n" 2>/dev/null)' -- "$cur" ) ) + -printf "%f\\n" 2>/dev/null)' -- "$cur") ) fi elif [[ $cword -eq 2 ]]; then - COMPREPLY=( $( compgen -W "$( command ps axo comm,pid | \ - awk '{if ($1 ~ /^'"${prev##*/}"'/) print $2}' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(command ps axo comm,pid | \ + awk '{if ($1 ~ /^'"${prev##*/}"'/) print $2}')" -- "$cur") ) compopt -o filenames - COMPREPLY+=( $( compgen -f -X '!?(*/)core?(.+([0-9]))' -o plusdirs \ - -- "$cur" ) ) + COMPREPLY+=( $(compgen -f -X '!?(*/)core?(.+([0-9]))' -o plusdirs \ + -- "$cur") ) fi } && complete -F _gdb gdb diff --git a/completions/genaliases b/completions/genaliases index f9a9890a723..3bad5c7e24b 100644 --- a/completions/genaliases +++ b/completions/genaliases @@ -6,7 +6,7 @@ _genaliases() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--quiet --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--quiet --help' -- "$cur") ) fi } && diff --git a/completions/genisoimage b/completions/genisoimage index caf6d457be2..52b66bbe98d 100644 --- a/completions/genisoimage +++ b/completions/genisoimage @@ -12,8 +12,8 @@ _mkisofs() return ;; -*-charset) - COMPREPLY=( $( compgen -W '$( mkisofs -input-charset \ - help 2>&1 | tail -n +3 )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(mkisofs -input-charset \ + help 2>&1 | tail -n +3)' -- "$cur") ) return ;; -uid) @@ -27,7 +27,7 @@ _mkisofs() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) else _filedir fi diff --git a/completions/geoiplookup b/completions/geoiplookup index 0c92548aefa..8347728ff34 100644 --- a/completions/geoiplookup +++ b/completions/geoiplookup @@ -20,7 +20,7 @@ _geoiplookup() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" -h)' -- "$cur") ) return fi diff --git a/completions/getconf b/completions/getconf index 80be667c60f..0ff18eadb50 100644 --- a/completions/getconf +++ b/completions/getconf @@ -11,9 +11,9 @@ _getconf() return ;; -v) - COMPREPLY=( $( compgen -W \ - '$( "$1" -a 2>/dev/null | awk "{ print \$1 }" )' -- \ - "${cur:-POSIX_V}" ) ) + COMPREPLY=( $(compgen -W \ + '$("$1" -a 2>/dev/null | awk "{ print \$1 }")' -- \ + "${cur:-POSIX_V}") ) return ;; esac @@ -21,10 +21,10 @@ _getconf() if [[ $prev == PATH_MAX ]]; then # TODO more path vars, better handling _filedir elif [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '-a -v' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-a -v' -- "$cur") ) else - COMPREPLY=( $( compgen -W \ - '$( "$1" -a 2>/dev/null | awk "{ print \$1 }" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$("$1" -a 2>/dev/null | awk "{ print \$1 }")' -- "$cur") ) fi } && complete -F _getconf getconf diff --git a/completions/getent b/completions/getent index 288fae28b20..9a181f60a4e 100644 --- a/completions/getent +++ b/completions/getent @@ -26,29 +26,28 @@ _getent() case $db in passwd) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; group) - COMPREPLY=( $( compgen -g -- "$cur" ) ) + COMPREPLY=( $(compgen -g -- "$cur") ) return ;; services) - COMPREPLY=( $( compgen -s -- "$cur" ) ) + COMPREPLY=( $(compgen -s -- "$cur") ) return ;; hosts) - COMPREPLY=( $( compgen -A hostname -- "$cur" ) ) + COMPREPLY=( $(compgen -A hostname -- "$cur") ) return ;; protocols|networks|ahosts|ahostsv4|ahostsv6|rpc) - COMPREPLY=( $( compgen -W "$( $1 $db | \ - awk '{ print $1 }' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 $db | \ + awk '{ print $1 }')" -- "$cur") ) return ;; aliases|shadow|gshadow) - COMPREPLY=( $( compgen -W "$( $1 $db | cut -d: -f1 )" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 $db | cut -d: -f1)" -- "$cur") ) return ;; ethers|netgroup) @@ -65,12 +64,12 @@ _getent() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace elif [[ -z $db ]]; then - COMPREPLY=( $( compgen -W 'passwd group hosts services protocols + COMPREPLY=( $(compgen -W 'passwd group hosts services protocols networks ahosts ahostsv4 ahostsv6 aliases ethers netgroup rpc - shadow gshadow' -- "$cur" ) ) + shadow gshadow' -- "$cur") ) fi } && complete -F _getent getent diff --git a/completions/gkrellm b/completions/gkrellm index 52d2a651ae9..9eb76bcb2e6 100644 --- a/completions/gkrellm +++ b/completions/gkrellm @@ -32,7 +32,7 @@ _gkrellm() ;; esac - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) } && complete -F _gkrellm gkrellm gkrellm2 diff --git a/completions/gm b/completions/gm index 88c233c6ae6..4ea4f3e9f09 100644 --- a/completions/gm +++ b/completions/gm @@ -2,8 +2,8 @@ _gm_commands() { - COMPREPLY+=( $( compgen -W '$( "$1" help | - awk "/^ +[^ ]+ +- / { print \$1 }" )' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W '$("$1" help | + awk "/^ +[^ ]+ +- / { print \$1 }")' -- "$cur") ) } _gm() diff --git a/completions/gnatmake b/completions/gnatmake index 4cd24d2e3bf..383bb9b46e9 100644 --- a/completions/gnatmake +++ b/completions/gnatmake @@ -8,14 +8,14 @@ _gnatmake() if [[ "$cur" == -* ]]; then # relevant (and less relevant ;-) )options completion - COMPREPLY=( $( compgen -W '-a -c -f -i -j -k -m -M -n -o -q -s -v -z + COMPREPLY=( $(compgen -W '-a -c -f -i -j -k -m -M -n -o -q -s -v -z -aL -A -aO -aI -I -I- -L -nostdinc -nostdlib -cargs -bargs -largs -fstack-check -fno-inline -g -O1 -O0 -O2 -O3 -gnata -gnatA -gnatb -gnatc -gnatd -gnatD -gnate -gnatE -gnatf -gnatF -gnatg -gnatG -gnath -gnati -gnatk -gnatl -gnatL -gnatm -gnatn -gnato -gnatO -gnatp -gnatP -gnatq -gnatR -gnats -gnatt -gnatT -gnatu -gnatU -gnatv -gnatws -gnatwe -gnatwl -gnatwu -gnatW -gnatx -gnatX -gnaty - -gnatz -gnatZ -gnat83' -- "$cur" ) ) + -gnatz -gnatZ -gnat83' -- "$cur") ) else # source file completion _filedir '@(adb|ads)' diff --git a/completions/gnokii b/completions/gnokii index 95ccaeae725..ff43c3d1beb 100644 --- a/completions/gnokii +++ b/completions/gnokii @@ -3,7 +3,7 @@ _gnokii_memory_type() { # TODO: reduce the number of choices - COMPREPLY=( $( compgen -W "IN OU SM ME MT" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "IN OU SM ME MT" -- "$cur") ) } _gnokii() @@ -24,15 +24,15 @@ _gnokii() [[ -f $config_file ]] && break done [[ ! -f $config_file ]] && return - COMPREPLY=( $( compgen -W \ - "$( command sed -n 's/^\[phone_\(.*\)\]/\1/p' $config_file )" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + "$(command sed -n 's/^\[phone_\(.*\)\]/\1/p' $config_file)" \ + -- "$cur") ) return ;; --help) - COMPREPLY=( $( compgen -W 'all monitor sms mms phonebook calendar + COMPREPLY=( $(compgen -W 'all monitor sms mms phonebook calendar todo dial profile settings wap logo ringtone security file - other' -- "$cur" ) ) + other' -- "$cur") ) return ;; --version|--shell|ping) @@ -41,15 +41,15 @@ _gnokii() # MONITOR --monitor) - COMPREPLY=( $( compgen -W 'delay once' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'delay once' -- "$cur") ) return ;; --getdisplaystatus|--displayoutput) return ;; --netmonitor) - COMPREPLY=( $( compgen -W 'reset off field devel next nr' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'reset off field devel next nr' \ + -- "$cur") ) return ;; @@ -59,8 +59,8 @@ _gnokii() return ;; --savesms) - COMPREPLY=( $( compgen -W '--sender --smsc --smscno --folder - --location --sent --read --deliver --datetime' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--sender --smsc --smscno --folder + --location --sent --read --deliver --datetime' -- "$cur") ) return ;; --memory-type|--memory|--getsms|--deletesms|--getmms|--deletemms|\ @@ -82,8 +82,8 @@ _gnokii() return ;; --writephonebook) - COMPREPLY=( $( compgen -W '--overwrite --find-free --memory-type - --location --vcard --ldif' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--overwrite --find-free --memory-type + --location --vcard --ldif' -- "$cur") ) return ;; --writecalendarnote|--writetodo) @@ -97,7 +97,7 @@ _gnokii() return ;; --divert) - COMPREPLY=( $( compgen -W '--op' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--op' -- "$cur") ) return ;; @@ -112,7 +112,7 @@ _gnokii() # SETTINGS --reset) - COMPREPLY=( $( compgen -W 'soft hard' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'soft hard' -- "$cur") ) return ;; --setdatetime|--setalarm) @@ -131,12 +131,12 @@ _gnokii() # LOGOS --sendlogo) - COMPREPLY=( $( compgen -W 'caller op picture' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'caller op picture' -- "$cur") ) return ;; --setlogo|--getlogo) - COMPREPLY=( $( compgen -W 'op startup caller dealer text' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'op startup caller dealer text' \ + -- "$cur") ) return ;; --viewlogo) @@ -145,7 +145,7 @@ _gnokii() ;; --entersecuritycode) - COMPREPLY=( $( compgen -W 'PIN PIN2 PUK PUK2 SEC' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'PIN PIN2 PUK PUK2 SEC' -- "$cur") ) return ;; @@ -166,16 +166,16 @@ _gnokii() return ;; --gettodo|--getcalendarnote) - COMPREPLY=( $( compgen -W '{1..9} end --vCal' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{1..9} end --vCal' -- "$cur") ) return ;; --deletecalendarnote) - COMPREPLY=( $( compgen -W '{1..9} end' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{1..9} end' -- "$cur") ) return ;; --divert) - COMPREPLY=( $( compgen -W 'register enable query disable - erasure' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'register enable query disable + erasure' -- "$cur") ) return ;; esac @@ -186,20 +186,20 @@ _gnokii() tprev=${words[cword-3]} case $tprev in --deletesms|--deletemms) - COMPREPLY=( $( compgen -W 'end' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'end' -- "$cur") ) return ;; --getphonebook|--writetodo|--writecalendarnote) - COMPREPLY=( $( compgen -W '{1..9} end' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{1..9} end' -- "$cur") ) return ;; --gettodo|--getcalendarnote) [[ ${words[cword-1]} == end ]] && \ - COMPREPLY=( $( compgen -W '--vCal' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--vCal' -- "$cur") ) return ;; --divert) - COMPREPLY=( $( compgen -W '--type' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--type' -- "$cur") ) return esac fi @@ -209,26 +209,26 @@ _gnokii() fprev=${words[cword-4]} case $fprev in --getphonebook) - COMPREPLY=( $( compgen -W '--raw --vcard --ldif' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--raw --vcard --ldif' -- "$cur") ) return ;; --divert) - COMPREPLY=( $( compgen -W 'all busy noans outofreach notavail' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'all busy noans outofreach notavail' \ + -- "$cur") ) return esac fi # safer to use LANG=C - local all_cmd="$( LANG=C _parse_help $1 "--help all" )" + local all_cmd="$(LANG=C _parse_help $1 "--help all")" # these 2 below are allowed in combination with others - local main_cmd=$( command grep -v -- '--config\|--phone' <<<"$all_cmd" ) + local main_cmd=$(command grep -v -- '--config\|--phone' <<<"$all_cmd") # don't provide main command completions if one is # already on the command line - [[ $COMP_LINE =~ $( tr ' ' '\b|'<<<$main_cmd ) ]] && return + [[ $COMP_LINE =~ $(tr ' ' '\b|'<<<$main_cmd) ]] && return - COMPREPLY=( $( compgen -W "$all_cmd" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$all_cmd" -- "$cur") ) } && complete -F _gnokii gnokii diff --git a/completions/gnome-mplayer b/completions/gnome-mplayer index 9a250419930..fa4361df1cf 100644 --- a/completions/gnome-mplayer +++ b/completions/gnome-mplayer @@ -10,7 +10,7 @@ _gnome_mplayer() return ;; --showcontrols|--showsubtitles|--autostart) - COMPREPLY=( $( compgen -w '0 1' -- "$cur" ) ) + COMPREPLY=( $(compgen -w '0 1' -- "$cur") ) return ;; --subtitle) @@ -18,7 +18,7 @@ _gnome_mplayer() return ;; --tvdriver) - COMPREPLY=( $( compgen -W 'v4l v4l2' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'v4l v4l2' -- "$cur") ) return ;; esac @@ -26,8 +26,7 @@ _gnome_mplayer() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" --help-all)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/gnome-screenshot b/completions/gnome-screenshot index fec77d76323..d0270c38bd3 100644 --- a/completions/gnome-screenshot +++ b/completions/gnome-screenshot @@ -10,7 +10,7 @@ _gnome_screenshot() return ;; --border-effect|-!(-*)e) - COMPREPLY=( $( compgen -W 'shadow border vintage none' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'shadow border vintage none' -- "$cur") ) return ;; --file|-!(-*)f) @@ -22,7 +22,7 @@ _gnome_screenshot() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && diff --git a/completions/gpasswd b/completions/gpasswd index 2b7276574ac..8f27cfec2f6 100644 --- a/completions/gpasswd +++ b/completions/gpasswd @@ -7,18 +7,18 @@ _gpasswd() case $prev in --add|--delete|--administrators|--members|-!(-*)[adAM]) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then # TODO: only -A and -M can be combined - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi - COMPREPLY=( $( compgen -g -- "$cur" ) ) + COMPREPLY=( $(compgen -g -- "$cur") ) } && complete -F _gpasswd gpasswd diff --git a/completions/gpg b/completions/gpg index 143737e86f8..cb00fa661c6 100644 --- a/completions/gpg +++ b/completions/gpg @@ -12,25 +12,25 @@ _gpg() ;; --export|--sign-key|--lsign-key|--nrsign-key|--nrlsign-key|--edit-key) # return list of public keys - COMPREPLY=( $( compgen -W "$( $1 --list-keys 2>/dev/null | command sed -ne \ + COMPREPLY=( $(compgen -W "$($1 --list-keys 2>/dev/null | command sed -ne \ 's@^pub.*/\([^ ]*\).*$@\1@p' -ne \ - 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) ) + 's@^.*\(<\([^>]*\)>\).*$@\2@p')" -- "$cur") ) return ;; --recipient|-!(-*)r) - COMPREPLY=( $( compgen -W "$( $1 --list-keys 2>/dev/null | command sed -ne \ - 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 --list-keys 2>/dev/null | command sed -ne \ + 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur") ) if [[ -e ~/.gnupg/gpg.conf ]]; then - COMPREPLY+=( $( compgen -W "$( command sed -ne \ + COMPREPLY+=( $(compgen -W "$(command sed -ne \ 's@^[ \t]*group[ \t][ \t]*\([^=]*\).*$@\1@p' \ - ~/.gnupg/gpg.conf )" -- "$cur" ) ) + ~/.gnupg/gpg.conf)" -- "$cur") ) fi return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$($1 --dump-options)' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$($1 --dump-options)' -- "$cur") ) fi } && complete -F _gpg -o default gpg diff --git a/completions/gpg2 b/completions/gpg2 index 3e73d949554..450149226b9 100644 --- a/completions/gpg2 +++ b/completions/gpg2 @@ -16,25 +16,25 @@ _gpg2() ;; --export|--sign-key|--lsign-key|--nrsign-key|--nrlsign-key|--edit-key) # return list of public keys - COMPREPLY=( $( compgen -W "$( $1 --list-keys 2>/dev/null | command sed -ne \ + COMPREPLY=( $(compgen -W "$($1 --list-keys 2>/dev/null | command sed -ne \ 's@^pub.*/\([^ ]*\).*$@\1@p' -ne \ - 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) ) + 's@^.*\(<\([^>]*\)>\).*$@\2@p')" -- "$cur") ) return ;; --recipient|-!(-*)r) - COMPREPLY=( $( compgen -W "$( $1 --list-keys 2>/dev/null | \ - command sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 --list-keys 2>/dev/null | \ + command sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur") ) if [[ -e ~/.gnupg/gpg.conf ]]; then - COMPREPLY+=( $( compgen -W "$( command sed -ne \ + COMPREPLY+=( $(compgen -W "$(command sed -ne \ 's@^[ \t]*group[ \t][ \t]*\([^=]*\).*$@\1@p' \ - ~/.gnupg/gpg.conf)" -- "$cur" ) ) + ~/.gnupg/gpg.conf)" -- "$cur") ) fi return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$($1 --dump-options)' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$($1 --dump-options)' -- "$cur") ) fi } && complete -F _gpg2 -o default gpg2 diff --git a/completions/gpgv b/completions/gpgv index 83c81624478..a3221afc0c3 100644 --- a/completions/gpgv +++ b/completions/gpgv @@ -23,7 +23,7 @@ _gpgv() _count_args "" "--@(weak-digest|*-fd|keyring|homedir)" if [[ $cur == -* && $args -eq 1 ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi @@ -31,7 +31,7 @@ _gpgv() if [[ ${COMP_LINE,,} == *.@(asc|sig|sign)\ * ]]; then # Detached signature, only complete one arbitrary file arg and - if [[ $args -eq 2 ]]; then - COMPREPLY=( $( compgen -W '-' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-' -- "$cur") ) _filedir fi else diff --git a/completions/gphoto2 b/completions/gphoto2 index 94bf063465a..89277a95712 100644 --- a/completions/gphoto2 +++ b/completions/gphoto2 @@ -23,20 +23,20 @@ _gphoto2() return ;; --port) - COMPREPLY=( $(compgen -W "$( $1 --list-ports 2>/dev/null | \ - awk 'NR>3 { print $1 }' )" -- "$cur") ) + COMPREPLY=( $(compgen -W "$($1 --list-ports 2>/dev/null | \ + awk 'NR>3 { print $1 }')" -- "$cur") ) __ltrim_colon_completions "$cur" return ;; --camera) local IFS=$'\n' - COMPREPLY=( $(compgen -W "$( $1 --list-cameras 2>/dev/null | \ - awk -F'"' 'NR>2 { print $2 }' )" -- "$cur") ) + COMPREPLY=( $(compgen -W "$($1 --list-cameras 2>/dev/null | \ + awk -F'"' 'NR>2 { print $2 }')" -- "$cur") ) return ;; --get-config|--set-config|--set-config-index|--set-config-value) - COMPREPLY=( $(compgen -W "$( $1 --list-config 2>/dev/null \ - )" -- "$cur") ) + COMPREPLY=( $(compgen -W "$($1 --list-config 2>/dev/null \ + )" -- "$cur") ) return ;; esac @@ -44,7 +44,7 @@ _gphoto2() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi diff --git a/completions/gprof b/completions/gprof index b9692badcd7..d1f4a4a3611 100644 --- a/completions/gprof +++ b/completions/gprof @@ -17,8 +17,8 @@ _gprof() ;; -O*) cur=${cur:2} - COMPREPLY=( $( compgen -P -O -W 'auto bsd 4.4bsd magic prof' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -P -O -W 'auto bsd 4.4bsd magic prof' \ + -- "$cur") ) return ;; esac @@ -36,8 +36,7 @@ _gprof() return ;; --file-format) - COMPREPLY=( $( compgen -W 'auto bsd 4.4bsd magic prof' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'auto bsd 4.4bsd magic prof' -- "$cur") ) return ;; esac @@ -45,7 +44,7 @@ _gprof() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '--annotated-source --brief --exec-counts + COMPREPLY=( $(compgen -W '--annotated-source --brief --exec-counts --file-info --directory-path --no-annotated-source --print-path --flat-profile --no-flat-profile --graph --no-graph --table-length= --separate-files --no-exec-counts --function-ordering @@ -53,7 +52,7 @@ _gprof() --no-demangle --no-static --static-call-graph --ignore-non-functions -k --line --min-count= --time= --no-time= --external-symbol-table= --display-unused-functions --debug --help - --file-format= --sum --version' -- "$cur" ) ) + --file-format= --sum --version' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/groupadd b/completions/groupadd index 0674a2f7256..013feaa4685 100644 --- a/completions/groupadd +++ b/completions/groupadd @@ -17,7 +17,7 @@ _groupadd() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && diff --git a/completions/groupdel b/completions/groupdel index 867b1741dfd..fcdd14c106a 100644 --- a/completions/groupdel +++ b/completions/groupdel @@ -16,11 +16,11 @@ _groupdel() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi - COMPREPLY=( $( compgen -g -- "$cur" ) ) + COMPREPLY=( $(compgen -g -- "$cur") ) } && complete -F _groupdel groupdel diff --git a/completions/groupmems b/completions/groupmems index 3bb5d8200d2..6e599a24a13 100644 --- a/completions/groupmems +++ b/completions/groupmems @@ -7,11 +7,11 @@ _groupmems() case $prev in -a|--add|-d|--delete) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; -g|--group) - COMPREPLY=( $( compgen -g -- "$cur" ) ) + COMPREPLY=( $(compgen -g -- "$cur") ) return ;; -R|--root) @@ -20,7 +20,7 @@ _groupmems() ;; esac - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) } && complete -F _groupmems groupmems diff --git a/completions/groupmod b/completions/groupmod index 3092adf1be2..2ac62ea3c87 100644 --- a/completions/groupmod +++ b/completions/groupmod @@ -17,12 +17,12 @@ _groupmod() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi - COMPREPLY=( $( compgen -g -- "$cur" ) ) + COMPREPLY=( $(compgen -g -- "$cur") ) } && complete -F _groupmod groupmod diff --git a/completions/growisofs b/completions/growisofs index 04b29a55933..a36e169da55 100644 --- a/completions/growisofs +++ b/completions/growisofs @@ -26,8 +26,8 @@ _growisofs() if [[ "$cur" == -* ]]; then # TODO: mkisofs options - COMPREPLY=( $( compgen -W '-dvd-compat -overburn -speed= -Z -M' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-dvd-compat -overburn -speed= -Z -M' \ + -- "$cur") ) [[ ${COMPREPLY[@]} == *= ]] && compopt -o nospace return fi diff --git a/completions/grpck b/completions/grpck index c68642ea39e..3b0d1964cb0 100644 --- a/completions/grpck +++ b/completions/grpck @@ -13,9 +13,9 @@ _grpck() esac if [[ "$cur" == -* ]]; then - local opts=$( _parse_help "$1" ) - [[ $opts ]] || opts=$( _parse_usage "$1" ) - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + local opts=$(_parse_help "$1") + [[ $opts ]] || opts=$(_parse_usage "$1") + COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) return fi diff --git a/completions/gzip b/completions/gzip index 829c5602bc0..d3bce28213f 100644 --- a/completions/gzip +++ b/completions/gzip @@ -10,14 +10,13 @@ _gzip() return ;; --processes|-!(-*)p) - COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "{1..$(_ncpus)}" -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) {-1..-9}' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1") {-1..-9}' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi @@ -36,8 +35,8 @@ _gzip() _tilde "$cur" || return compopt -o filenames - COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ - $( compgen -d -- "$cur" ) ) + COMPREPLY=( $(compgen -f -X "$xspec" -- "$cur") \ + $(compgen -d -- "$cur") ) } && complete -F _gzip gzip pigz diff --git a/completions/hcitool b/completions/hcitool index 38d66427d92..ccc64f18e41 100644 --- a/completions/hcitool +++ b/completions/hcitool @@ -3,28 +3,28 @@ _bluetooth_addresses() { if [[ -n ${COMP_BLUETOOTH_SCAN:-} ]]; then - COMPREPLY+=( $( compgen -W "$( hcitool scan | \ - awk '/^\t/{print $1}' )" -- "$cur" ) ) + COMPREPLY+=( $(compgen -W "$(hcitool scan | \ + awk '/^\t/{print $1}')" -- "$cur") ) fi } _bluetooth_devices() { - COMPREPLY+=( $( compgen -W "$( hcitool dev | \ - awk '/^\t/{print $1}' )" -- "$cur" ) ) + COMPREPLY+=( $(compgen -W "$(hcitool dev | \ + awk '/^\t/{print $1}')" -- "$cur") ) } _bluetooth_services() { - COMPREPLY=( $( compgen -W 'DID SP DUN LAN FAX OPUSH FTP HS HF HFAG SAP NAP + COMPREPLY=( $(compgen -W 'DID SP DUN LAN FAX OPUSH FTP HS HF HFAG SAP NAP GN PANU HCRP HID CIP A2SRC A2SNK AVRCT AVRTG UDIUE UDITE SYNCML' \ - -- "$cur" ) ) + -- "$cur") ) } _bluetooth_packet_types() { - COMPREPLY=( $( compgen -W 'DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3' \ + -- "$cur") ) } _hcitool() @@ -38,7 +38,7 @@ _hcitool() return ;; --role) - COMPREPLY=( $( compgen -W 'm s' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'm s' -- "$cur") ) return ;; --pkt-type) @@ -53,11 +53,11 @@ _hcitool() _get_first_arg if [[ -z $arg ]]; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) else - COMPREPLY=( $( compgen -W 'dev inq scan name info spinq epinq cmd + COMPREPLY=( $(compgen -W 'dev inq scan name info spinq epinq cmd con cc dc sr cpt rssi lq tpl afh lst auth enc key clkoff - clock' -- "$cur" ) ) + clock' -- "$cur") ) fi else local args @@ -70,7 +70,7 @@ _hcitool() ;; cc) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--role --pkt-type' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--role --pkt-type' -- "$cur") ) else _count_args if [[ $args -eq 2 ]]; then @@ -83,7 +83,7 @@ _hcitool() if [[ $args -eq 2 ]]; then _bluetooth_addresses else - COMPREPLY=( $( compgen -W 'master slave' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'master slave' -- "$cur") ) fi ;; cpt) @@ -99,7 +99,7 @@ _hcitool() if [[ $args -eq 2 ]]; then _bluetooth_addresses else - COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '0 1' -- "$cur") ) fi ;; esac @@ -125,39 +125,39 @@ _sdptool() _get_first_arg if [[ -z $arg ]]; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) else - COMPREPLY=( $( compgen -W 'search browse records add del get - setattr setseq' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'search browse records add del get + setattr setseq' -- "$cur") ) fi else case $arg in search) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--bdaddr --tree --raw --xml' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--bdaddr --tree --raw --xml' \ + -- "$cur") ) else _bluetooth_services fi ;; browse|records) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--tree --raw --xml' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--tree --raw --xml' -- "$cur") ) else _bluetooth_addresses fi ;; add) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--handle --channel' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--handle --channel' -- "$cur") ) else _bluetooth_services fi ;; get) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--bdaddr --tree --raw --xml' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--bdaddr --tree --raw --xml' \ + -- "$cur") ) fi ;; esac @@ -181,7 +181,7 @@ _l2ping() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) else _bluetooth_addresses fi @@ -209,10 +209,10 @@ _rfcomm() _get_first_arg if [[ -z $arg ]]; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) else - COMPREPLY=( $( compgen -W 'show connect listen watch bind - release' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'show connect listen watch bind + release' -- "$cur") ) fi else local args @@ -249,10 +249,10 @@ _ciptool() _get_first_arg if [[ -z $arg ]]; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) else - COMPREPLY=( $( compgen -W 'show search connect release loopback' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'show search connect release loopback' \ + -- "$cur") ) fi else local args @@ -281,14 +281,14 @@ _dfutool() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) else local args _count_args case $args in 1) - COMPREPLY=( $( compgen -W 'verify modify upgrade archive' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'verify modify upgrade archive' \ + -- "$cur") ) ;; 2) _filedir @@ -307,13 +307,13 @@ _hciconfig() _get_first_arg if [[ -z $arg ]]; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --all' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--help --all' -- "$cur") ) else - COMPREPLY=( $( compgen -W 'up down reset rstat auth noauth encrypt + COMPREPLY=( $(compgen -W 'up down reset rstat auth noauth encrypt noencrypt secmgr nosecmgr piscan noscan iscan pscan ptype name class voice iac inqmode inqdata inqtype inqparams pageparms pageto afhmode aclmtu scomtu putkey delkey commands features - version revision lm' -- "$cur" ) ) + version revision lm' -- "$cur") ) fi else local args @@ -327,8 +327,8 @@ _hciconfig() lm) _count_args if [[ $args -eq 2 ]]; then - COMPREPLY=( $( compgen -W 'MASTER SLAVE NONE ACCEPT' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'MASTER SLAVE NONE ACCEPT' \ + -- "$cur") ) fi ;; ptype) @@ -348,26 +348,26 @@ _hciattach() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-n -p -t -b -s -l' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-n -p -t -b -s -l' -- "$cur") ) else local args _count_args case $args in 1) - COMPREPLY=( $( printf '%s\n' /dev/tty* ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]} - ${COMPREPLY[@]#/dev/}' -- "$cur" ) ) + COMPREPLY=( $(printf '%s\n' /dev/tty*) ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]} + ${COMPREPLY[@]#/dev/}' -- "$cur") ) ;; 2) - COMPREPLY=( $( compgen -W 'any ericsson digi xircom csr bboxes - swave bcsp 0x0105 0x080a 0x0160 0x0002' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'any ericsson digi xircom csr bboxes + swave bcsp 0x0105 0x080a 0x0160 0x0002' -- "$cur") ) ;; 3) - COMPREPLY=( $( compgen -W '9600 19200 38400 57600 115200 230400 - 460800 921600' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '9600 19200 38400 57600 115200 230400 + 460800 921600' -- "$cur") ) ;; 4) - COMPREPLY=( $( compgen -W 'flow noflow' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'flow noflow' -- "$cur") ) ;; 5) _bluetooth_addresses diff --git a/completions/hddtemp b/completions/hddtemp index a7cbfd739e4..b7487cc927c 100644 --- a/completions/hddtemp +++ b/completions/hddtemp @@ -15,7 +15,7 @@ _hddtemp() return ;; --unit|-!(-*)u) - COMPREPLY=( $( compgen -W 'C F' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'C F' -- "$cur") ) return ;; --port|--separator|--syslog|--version|--help|-!(-*)[psSvh?]) @@ -26,7 +26,7 @@ _hddtemp() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1") --help' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else cur=${cur:=/dev/} diff --git a/completions/hid2hci b/completions/hid2hci index 9221c4d031b..9e3305d060c 100644 --- a/completions/hid2hci +++ b/completions/hid2hci @@ -6,8 +6,8 @@ _hid2hci() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --quiet -0 --tohci -1 --tohid' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--help --quiet -0 --tohci -1 --tohid' \ + -- "$cur") ) fi } && complete -F _hid2hci hid2hci diff --git a/completions/hostname b/completions/hostname index 7ca0983cb6d..68f9b4ed106 100644 --- a/completions/hostname +++ b/completions/hostname @@ -16,7 +16,7 @@ _hostname() esac [[ $cur == -* ]] && \ - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) } && complete -F _hostname hostname diff --git a/completions/hping2 b/completions/hping2 index e0feb2b15cd..78d35b05df1 100644 --- a/completions/hping2 +++ b/completions/hping2 @@ -15,7 +15,7 @@ _hping2() return ;; --tos|-!(-*)o) - COMPREPLY=( $( compgen -W '02 04 08 10' ) ) + COMPREPLY=( $(compgen -W '02 04 08 10') ) return ;; --file|-!(-*)E) @@ -25,7 +25,7 @@ _hping2() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) else _known_hosts_real -- "$cur" fi diff --git a/completions/htop b/completions/htop index ba82470a751..3f1680b5a01 100644 --- a/completions/htop +++ b/completions/htop @@ -7,11 +7,11 @@ _htop() case "$prev" in --sort-key|-!(-*)s) - COMPREPLY=( $( compgen -W '$( "$1" -s help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$("$1" -s help)' -- "$cur") ) return ;; --user|-!(-*)u) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; --delay|-!(-*)d) @@ -23,7 +23,7 @@ _htop() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" --help)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/htpasswd b/completions/htpasswd index bf3acb2256e..827e6dcc6cf 100644 --- a/completions/htpasswd +++ b/completions/htpasswd @@ -16,7 +16,7 @@ _htpasswd() if [[ $o -eq 0 || $o -eq $cword ]]; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi # Password file (first non-option argument) @@ -24,8 +24,8 @@ _htpasswd() elif [[ $o -eq $cword-1 ]]; then # Username (second non-option argument) - COMPREPLY=( $( compgen -W \ - '$( cut -d: -f1 "${words[o]}" 2>/dev/null )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$(cut -d: -f1 "${words[o]}" 2>/dev/null)' -- "$cur") ) fi } && complete -F _htpasswd htpasswd diff --git a/completions/hunspell b/completions/hunspell index 3507f5dbcf8..627f3e4b193 100644 --- a/completions/hunspell +++ b/completions/hunspell @@ -17,7 +17,7 @@ _hunspell() dicts=( "${dicts[@]%.dic}" ) $reset IFS=$'\n' - COMPREPLY=( $( compgen -W '${dicts[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${dicts[@]}' -- "$cur") ) return ;; -i) @@ -31,7 +31,7 @@ _hunspell() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi diff --git a/completions/iconv b/completions/iconv index 17528899884..2fb1c92d05f 100644 --- a/completions/iconv +++ b/completions/iconv @@ -2,8 +2,8 @@ _iconv_charsets() { - COMPREPLY+=( $( compgen -W '$( ${1:-iconv} -l | \ - command sed -e "s@/*\$@@" -e "s/[,()]//g" )' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W '$(${1:-iconv} -l | \ + command sed -e "s@/*\$@@" -e "s/[,()]//g")' -- "$cur") ) } _iconv() @@ -29,7 +29,7 @@ _iconv() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && diff --git a/completions/id b/completions/id index 137a5f7eeb2..3f3087cb4bc 100644 --- a/completions/id +++ b/completions/id @@ -6,11 +6,11 @@ _id() _init_completion || return if [[ "$cur" == -* ]]; then - local opts=$( _parse_help "$1" ) + local opts=$(_parse_help "$1") [[ $opts ]] || opts="-G -g -u" # POSIX fallback - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) else - COMPREPLY=( $( compgen -u "$cur" ) ) + COMPREPLY=( $(compgen -u "$cur") ) fi } && complete -F _id id diff --git a/completions/idn b/completions/idn index 5ea7f5cb928..39d13021f05 100644 --- a/completions/idn +++ b/completions/idn @@ -10,14 +10,14 @@ _idn() return ;; --profile|-!(-*)p) - COMPREPLY=( $( compgen -W 'Nameprep iSCSI Nodeprep Resourceprep - trace SASLprep' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'Nameprep iSCSI Nodeprep Resourceprep + trace SASLprep' -- "$cur") ) return ;; esac if ! $split && [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && diff --git a/completions/ifstat b/completions/ifstat index f4803730fb9..2be902e59f3 100644 --- a/completions/ifstat +++ b/completions/ifstat @@ -19,8 +19,8 @@ _ifstat() # traditional: parse driver if ! { "$1" --help 2>&1 || :; } | \ command grep -q -- '-d.*--scan'; then - COMPREPLY=( $( compgen -W '$( "$1" -v | - sed -e "s/[,.]//g" -ne "s/^.*drivers://p" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$("$1" -v | + sed -e "s/[,.]//g" -ne "s/^.*drivers://p")' -- "$cur") ) fi return ;; @@ -41,9 +41,9 @@ _ifstat() ;; --extended|-!(-*)x) # iproute2: parse xstat types - COMPREPLY=( $( compgen -W '$( "$1" -x nonexistent-xstat 2>&1 | - awk "found { print \$1 } /supported xstats:/ { found=1 }" )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$("$1" -x nonexistent-xstat 2>&1 | + awk "found { print \$1 } /supported xstats:/ { found=1 }")' \ + -- "$cur") ) return ;; esac @@ -51,9 +51,9 @@ _ifstat() $split && return if [[ "$cur" == -* ]]; then - local opts=$( _parse_help "$1" ) - [[ $opts ]] || opts=$( _parse_usage "$1" ) - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + local opts=$(_parse_help "$1") + [[ $opts ]] || opts=$(_parse_usage "$1") + COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/iftop b/completions/iftop index 831e327bac1..6320316d16d 100644 --- a/completions/iftop +++ b/completions/iftop @@ -19,7 +19,7 @@ _iftop() ;; esac - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) } && complete -F _iftop iftop diff --git a/completions/ifup b/completions/ifup index bcc7a23fbc3..db8de8e06b4 100644 --- a/completions/ifup +++ b/completions/ifup @@ -22,7 +22,7 @@ _ifupdown() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi diff --git a/completions/info b/completions/info index 7a6d85d8723..87179ac884c 100644 --- a/completions/info +++ b/completions/info @@ -34,7 +34,7 @@ _info() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi @@ -57,7 +57,7 @@ _info() fi # redirect stderr for when path doesn't exist - COMPREPLY=( $( eval command ls "$infopath" 2>/dev/null ) ) + COMPREPLY=( $(eval command ls "$infopath" 2>/dev/null) ) # weed out directory path names and paths to info pages COMPREPLY=( ${COMPREPLY[@]##*/?(:)} ) # weed out info dir file @@ -66,7 +66,7 @@ _info() done # strip suffix from info pages COMPREPLY=( ${COMPREPLY[@]%.@(gz|bz2|xz|lzma)} ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}") ) } && complete -F _info info pinfo diff --git a/completions/inject b/completions/inject index 20ea9b7f15c..8becf274a61 100644 --- a/completions/inject +++ b/completions/inject @@ -15,7 +15,7 @@ _inject() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--listname --queue --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--listname --queue --help' -- "$cur") ) else _filedir fi diff --git a/completions/inotifywait b/completions/inotifywait index 2df4d75f0da..01b4e132b77 100644 --- a/completions/inotifywait +++ b/completions/inotifywait @@ -5,10 +5,10 @@ _inotifywait_events() # Expecting line with "Events:", followed by ones starting with one # tab. Word following the tab is event name, others are line # wrapped explanations. - COMPREPLY+=( $( compgen -W "$( $1 --help 2>/dev/null | \ + COMPREPLY+=( $(compgen -W "$($1 --help 2>/dev/null | \ sed -e '/^Events:/,/^[^'$'\t'']/!d' \ - -ne 's/^'$'\t''\([^ '$'\t'']\{1,\}\)[ '$'\t''].*/\1/p' )" \ - -- "$cur" ) ) + -ne 's/^'$'\t''\([^ '$'\t'']\{1,\}\)[ '$'\t''].*/\1/p')" \ + -- "$cur") ) } _inotifywait() @@ -29,14 +29,14 @@ _inotifywait() return ;; --ascending|--descending) - COMPREPLY=( $( compgen -W 'total' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'total' -- "$cur") ) _inotifywait_events "$1" return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi diff --git a/completions/insmod b/completions/insmod index ec81c93eb23..36c29dc463f 100644 --- a/completions/insmod +++ b/completions/insmod @@ -9,8 +9,8 @@ _insmod() if [[ $cword -eq 1 ]]; then _filedir '@(?(k)o?(.gz))' else # do module parameter completion - COMPREPLY=( $( compgen -W "$( PATH="$PATH:/sbin" modinfo \ - -p ${words[1]} 2>/dev/null | cut -d: -f1 )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(PATH="$PATH:/sbin" modinfo \ + -p ${words[1]} 2>/dev/null | cut -d: -f1)" -- "$cur") ) fi } && complete -F _insmod insmod insmod.static diff --git a/completions/installpkg b/completions/installpkg index f002f7754bd..3ebf1dfccf3 100644 --- a/completions/installpkg +++ b/completions/installpkg @@ -11,7 +11,7 @@ _installpkg() return ;; --priority) - COMPREPLY=( $( compgen -W 'ADD REC OPT SKP' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'ADD REC OPT SKP' -- "$cur") ) return ;; --tagfile) @@ -21,8 +21,8 @@ _installpkg() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--warn --md5sum --root --infobox --terse - --menu --ask --priority --tagfile' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--warn --md5sum --root --infobox --terse + --menu --ask --priority --tagfile' -- "$cur") ) return fi diff --git a/completions/interdiff b/completions/interdiff index 5a4906bbdaf..6ab28c49ad1 100644 --- a/completions/interdiff +++ b/completions/interdiff @@ -14,7 +14,7 @@ _interdiff() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/invoke-rc.d b/completions/invoke-rc.d index 777f6acec28..5ed9423e50a 100644 --- a/completions/invoke-rc.d +++ b/completions/invoke-rc.d @@ -12,22 +12,22 @@ _invoke_rc_d() [[ -d /etc/rc.d/init.d ]] && sysvdir=/etc/rc.d/init.d \ || sysvdir=/etc/init.d - services=( $( printf '%s ' $sysvdir/!(README*|*.sh|$_backup_glob) ) ) + services=( $(printf '%s ' $sysvdir/!(README*|*.sh|$_backup_glob)) ) services=( ${services[@]#$sysvdir/} ) options=( --help --quiet --force --try-anyway --disclose-deny --query \ --no-fallback ) if [[ ($cword -eq 1) || ("$prev" == --* ) ]]; then - valid_options=( $( \ + valid_options=( $(\ tr " " "\n" <<<"${words[@]} ${options[@]}" \ - | command sed -ne "/$( command sed "s/ /\\\\|/g" <<<"${options[@]}" )/p" \ + | command sed -ne "/$(command sed "s/ /\\\\|/g" <<<"${options[@]}")/p" \ | sort | uniq -u \ ) ) - COMPREPLY=( $( compgen -W '${valid_options[@]} ${services[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${valid_options[@]} ${services[@]}' -- "$cur") ) elif [[ -x $sysvdir/$prev ]]; then - COMPREPLY=( $( compgen -W '`command sed -e "y/|/ /" \ + COMPREPLY=( $(compgen -W '`command sed -e "y/|/ /" \ -ne "s/^.*Usage:[ ]*[^ ]*[ ]*{*\([^}\"]*\).*$/\1/p" \ - $sysvdir/$prev`' -- "$cur" ) ) + $sysvdir/$prev`' -- "$cur") ) else COMPREPLY=() fi diff --git a/completions/ip b/completions/ip index 00dd839da9e..372d2d85ba2 100644 --- a/completions/ip +++ b/completions/ip @@ -2,9 +2,9 @@ _iproute2_etc() { - COMPREPLY+=( $( compgen -W \ - "$( awk '!/#/ { print $2 }' /etc/iproute2/$1 2>/dev/null )" \ - -- "$cur" ) ) + COMPREPLY+=( $(compgen -W \ + "$(awk '!/#/ { print $2 }' /etc/iproute2/$1 2>/dev/null)" \ + -- "$cur") ) } _ip() @@ -17,7 +17,7 @@ _ip() return ;; -f|-family) - COMPREPLY=( $( compgen -W 'inet inet6 ipx dnet link' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'inet inet6 ipx dnet link' -- "$cur") ) return ;; -b|-batch) @@ -25,7 +25,7 @@ _ip() return ;; -force) - COMPREPLY=( $( compgen -W '-batch' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-batch' -- "$cur") ) return ;; esac @@ -45,15 +45,15 @@ _ip() local c="-Version -statistics -details -resolve -family -oneline -timestamp -batch -rcvbuf" [[ $cword -eq 1 ]] && c+=" -force" - COMPREPLY=( $( compgen -W "$c" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$c" -- "$cur") ) return ;; *) - COMPREPLY=( $( compgen -W "help $( ip help 2>&1 | command sed -e \ + COMPREPLY=( $(compgen -W "help $(ip help 2>&1 | command sed -e \ '/OBJECT := /,/}/!d' -e \ 's/.*{//' -e \ 's/}.*//' -e \ - 's/|//g' )" -- "$cur" ) ) + 's/|//g')" -- "$cur") ) return ;; esac @@ -73,12 +73,12 @@ _ip() _available_interfaces ;; 2) - COMPREPLY=( $( compgen -W 'type' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'type' -- "$cur") ) ;; 3) [[ $prev == type ]] && \ - COMPREPLY=( $( compgen -W 'vlan veth vcan dummy - ifb macvlan can' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'vlan veth vcan dummy + ifb macvlan can' -- "$cur") ) ;; esac ;; @@ -89,8 +89,7 @@ _ip() case $prev in arp|dynamic|multicast|allmulticast|promisc|\ trailers) - COMPREPLY=( $( compgen -W 'on off' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on off' -- "$cur") ) ;; txqueuelen|name|address|broadcast|mtu|netns|alias) ;; @@ -99,7 +98,7 @@ _ip() promisc trailers txqueuelen name address broadcast mtu netns alias" [[ $prev != @(up|down) ]] && c+=" up down" - COMPREPLY=( $( compgen -W "$c" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$c" -- "$cur") ) ;; esac fi @@ -107,7 +106,7 @@ _ip() show) if [[ $cword -eq $subcword+1 ]]; then _available_interfaces - COMPREPLY+=( $( compgen -W 'dev group up' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W 'dev group up' -- "$cur") ) elif [[ $prev == dev ]]; then _available_interfaces elif [[ $prev == group ]]; then @@ -116,8 +115,8 @@ _ip() ;; *) [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help add delete set show' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'help add delete set show' \ + -- "$cur") ) ;; esac ;; @@ -145,9 +144,9 @@ _ip() show|flush) if [[ $cword -eq $subcword+1 ]]; then _available_interfaces - COMPREPLY+=( $( compgen -W 'dev scope to label dynamic + COMPREPLY+=( $(compgen -W 'dev scope to label dynamic permanent tentative deprecated dadfailed temporary - primary secondary up' -- "$cur" ) ) + primary secondary up' -- "$cur") ) elif [[ $prev == dev ]]; then _available_interfaces elif [[ $prev == scope ]]; then @@ -156,8 +155,8 @@ _ip() ;; *) [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help add change replace del - show flush' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'help add change replace del + show flush' -- "$cur") ) ;; esac ;; @@ -173,8 +172,8 @@ _ip() ;; *) [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help list add del flush' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'help list add del flush' \ + -- "$cur") ) ;; esac ;; @@ -196,8 +195,8 @@ _ip() ;; *) [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help list flush get add del - change append replace monitor' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'help list flush get add del + change append replace monitor' -- "$cur") ) ;; esac ;; @@ -211,8 +210,8 @@ _ip() ;; *) [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help list add del flush' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'help list add del flush' \ + -- "$cur") ) ;; esac ;; @@ -227,8 +226,8 @@ _ip() ;; *) [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help add del change replace - show flush' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'help add del change replace + show flush' -- "$cur") ) ;; esac ;; @@ -243,8 +242,8 @@ _ip() ;; *) [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help change show' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'help change show' \ + -- "$cur") ) ;; esac ;; @@ -258,8 +257,8 @@ _ip() ;; *) [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help add change del show prl - 6rd' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'help add change del show prl + 6rd' -- "$cur") ) ;; esac ;; @@ -273,14 +272,14 @@ _ip() if [[ $cword -eq $subcword+1 || $prev == dev ]]; then _available_interfaces [[ $prev != dev ]] && \ - COMPREPLY=( $( compgen -W '${COMPREPLY[@]} dev' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]} dev' \ + -- "$cur") ) fi ;; *) [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help add del show' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'help add del show' \ + -- "$cur") ) ;; esac ;; @@ -292,7 +291,7 @@ _ip() ;; *) [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help show' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'help show' -- "$cur") ) ;; esac ;; @@ -302,7 +301,7 @@ _ip() all) ;; *) [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'help all' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'help all' -- "$cur") ) ;; esac ;; @@ -314,8 +313,8 @@ _ip() ;; *) [[ $cword -eq $subcword ]] && \ - COMPREPLY=( $( compgen -W 'state policy monitor' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'state policy monitor' \ + -- "$cur") ) ;; esac ;; diff --git a/completions/iperf b/completions/iperf index eead7ed6b0d..417c7dc994d 100644 --- a/completions/iperf +++ b/completions/iperf @@ -13,7 +13,7 @@ _iperf() return ;; --format|-!(-*)f) - COMPREPLY=( $( compgen -W 'k m g K M G' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'k m g K M G' -- "$cur") ) return ;; --output|--fileinput|-!(-*)[oF]) @@ -31,11 +31,11 @@ _iperf() return ;; --reportexclude|-!(-*)x) - COMPREPLY=( $( compgen -W 'C D M S V' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'C D M S V' -- "$cur") ) return ;; --reportstyle|-!(-*)y) - COMPREPLY=( $( compgen -W 'C' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'C' -- "$cur") ) return ;; --logfile) @@ -60,8 +60,8 @@ _iperf() done [[ $filter != cat ]] && filter+=' -e /--client/d -e /--server/d' - COMPREPLY=( $( compgen -W \ - '$( "$1" --help 2>&1 | $filter | _parse_help - )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$("$1" --help 2>&1 | $filter | _parse_help -)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace } && complete -F _iperf iperf iperf3 diff --git a/completions/ipmitool b/completions/ipmitool index 4a9c50249de..635f893fa9f 100644 --- a/completions/ipmitool +++ b/completions/ipmitool @@ -2,8 +2,8 @@ _ipmitool_singleline_help() { - COMPREPLY=( $( compgen -W "$( $1 $2 2>&1 | \ - command sed -ne 's/[,\r]//g' -e 's/^.*[Cc]ommands://p' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 $2 2>&1 | \ + command sed -ne 's/[,\r]//g' -e 's/^.*[Cc]ommands://p')" -- "$cur") ) } _ipmitool() @@ -16,17 +16,17 @@ _ipmitool() return ;; -*d) - COMPREPLY=( $( compgen -W "$( \ + COMPREPLY=( $(compgen -W "$(\ command ls -d /dev/ipmi* /dev/ipmi/* /dev/ipmidev/* \ - 2>/dev/null | command sed -ne 's/^[^0-9]*\([0-9]\{1,\}\)/\1/p' )" \ - -- "$cur" ) ) + 2>/dev/null | command sed -ne 's/^[^0-9]*\([0-9]\{1,\}\)/\1/p')" \ + -- "$cur") ) return ;; -*I) - COMPREPLY=( $( compgen -W "$( $1 -h 2>&1 | \ + COMPREPLY=( $(compgen -W "$($1 -h 2>&1 | \ command sed -e '/^Interfaces:/,/^[[:space:]]*$/!d' \ - -ne 's/^[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*/\1/p' )" \ - -- "$cur" ) ) + -ne 's/^[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*/\1/p')" \ + -- "$cur") ) return ;; -*H) @@ -38,27 +38,27 @@ _ipmitool() return ;; -*C) - COMPREPLY=( $( compgen -W '{0..14}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..14}' -- "$cur") ) return ;; -*L) - COMPREPLY=( $( compgen -W 'CALLBACK USER OPERATOR ADMINISTRATOR' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'CALLBACK USER OPERATOR ADMINISTRATOR' \ + -- "$cur") ) return ;; -*A) - COMPREPLY=( $( compgen -W 'NONE PASSWORD MD2 MD5 OEM' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'NONE PASSWORD MD2 MD5 OEM' -- "$cur") ) return ;; -*o) - COMPREPLY=( $( compgen -W "$( $1 -o list 2>&1 | \ - awk '/^[ \t]+/ { print $1 }' ) list" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 -o list 2>&1 | \ + awk '/^[ \t]+/ { print $1 }') list" -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h)' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) return fi @@ -76,7 +76,7 @@ _ipmitool() done if [[ -z $cmd ]]; then - COMPREPLY=( $( compgen -W '${cmds[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${cmds[@]}' -- "$cur") ) return fi @@ -101,15 +101,15 @@ _ipmitool() ;; alert) [[ $prev == alert ]] && \ - COMPREPLY=( $( compgen -W 'print set' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'print set' -- "$cur") ) ;; stats) [[ $prev == stats ]] && \ - COMPREPLY=( $( compgen -W 'print set' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'print set' -- "$cur") ) ;; *) - COMPREPLY=( $( compgen -W 'print set alert stats' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'print set alert stats' \ + -- "$cur") ) ;; esac ;; @@ -119,8 +119,8 @@ _ipmitool() get|info|type|list|entity) ;; elist) - COMPREPLY=( $( compgen -W 'all full compact event mclog fru - generic' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'all full compact event mclog fru + generic' -- "$cur") ) ;; dump) _filedir @@ -128,8 +128,7 @@ _ipmitool() fill) case $prev in fill) - COMPREPLY=( $( compgen -W 'sensors file' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'sensors file' -- "$cur") ) ;; file) _filedir @@ -137,8 +136,8 @@ _ipmitool() esac ;; *) - COMPREPLY=( $( compgen -W 'get info type list elist entity - dump fill' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'get info type list elist entity + dump fill' -- "$cur") ) ;; esac ;; @@ -148,7 +147,7 @@ _ipmitool() list|get|thresh) ;; *) - COMPREPLY=( $( compgen -W 'list get thresh' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'list get thresh' -- "$cur") ) ;; esac ;; @@ -162,11 +161,11 @@ _ipmitool() ;; time) [[ $prev == time ]] && \ - COMPREPLY=( $( compgen -W 'get set' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'get set' -- "$cur") ) ;; *) - COMPREPLY=( $( compgen -W 'info clear list elist delete add - get save writeraw readraw time' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'info clear list elist delete add + get save writeraw readraw time' -- "$cur") ) ;; esac ;; @@ -177,20 +176,19 @@ _ipmitool() ;; set) [[ $prev == set ]] && \ - COMPREPLY=( $( compgen -W 'name password' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'name password' -- "$cur") ) ;; *) - COMPREPLY=( $( compgen -W 'summary list set disable enable - priv test' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'summary list set disable enable + priv test' -- "$cur") ) ;; esac ;; set) [[ $prev == set ]] && \ - COMPREPLY=( $( compgen -W 'hostname username password privlvl - authtype localaddr targetaddr port csv verbose' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'hostname username password privlvl + authtype localaddr targetaddr port csv verbose' -- "$cur") ) ;; esac diff --git a/completions/ipsec b/completions/ipsec index 357d50551b7..3e00b7e0210 100644 --- a/completions/ipsec +++ b/completions/ipsec @@ -10,7 +10,7 @@ _ipsec_connections() if [[ $keyword == [#]* ]]; then continue; fi [[ $keyword == conn && $name != '%default' ]] && COMPREPLY+=( "$name" ) done - COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") ) } _ipsec_freeswan() @@ -19,28 +19,27 @@ _ipsec_freeswan() _init_completion || return if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look manual + COMPREPLY=( $(compgen -W 'auto barf eroute klipsdebug look manual pluto ranbits rsasigkey setup showdefaults showhostkey spi spigrp - tncfg whack' -- "$cur" ) ) + tncfg whack' -- "$cur") ) return fi case ${words[1]} in auto) - COMPREPLY=( $( compgen -W '--asynchronous --up --add --delete + COMPREPLY=( $(compgen -W '--asynchronous --up --add --delete --replace --down --route --unroute --ready --status - --rereadsecrets' -- "$cur" ) ) + --rereadsecrets' -- "$cur") ) ;; manual) - COMPREPLY=( $( compgen -W '--up --down --route --unroute --union' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--up --down --route --unroute --union' \ + -- "$cur") ) ;; ranbits) - COMPREPLY=( $( compgen -W '--quick --continuous --bytes' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--quick --continuous --bytes' -- "$cur") ) ;; setup) - COMPREPLY=( $( compgen -W '--start --stop --restart' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--start --stop --restart' -- "$cur") ) ;; *) ;; @@ -53,7 +52,7 @@ _ipsec_strongswan() _init_completion || return if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'down irdumm leases listaacerts listacerts + COMPREPLY=( $(compgen -W 'down irdumm leases listaacerts listacerts listalgs listall listcacerts listcainfos listcards listcerts listcrls listgroups listocsp listocspcerts listpubkeys openac pki pluto pool purgecerts purgecrls purgeike purgeocsp ready reload @@ -61,25 +60,25 @@ _ipsec_strongswan() rereadgroups rereadocspcerts rereadsecrets restart route scdecrypt scencrypt scepclient secrets start starter status statusall stop stroke unroute uci up update version whack --confdir --copyright - --directory --help --version --versioncode' -- "$cur" ) ) + --directory --help --version --versioncode' -- "$cur") ) return fi case ${words[1]} in down|route|status|statusall|unroute|up) - local confdir=$( ipsec --confdir ) + local confdir=$(ipsec --confdir) _ipsec_connections < "$confdir/ipsec.conf" ;; list*) - COMPREPLY=( $( compgen -W '--utc' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--utc' -- "$cur") ) ;; restart|start) - COMPREPLY=( $( compgen -W '--attach-gdb --auto-update --debug - --debug-all --debug-more --nofork' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--attach-gdb --auto-update --debug + --debug-all --debug-more --nofork' -- "$cur") ) ;; pki) - COMPREPLY=( $( compgen -W '--gen --issue --keyid --print --pub - --req --self --signcrl --verify' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--gen --issue --keyid --print --pub + --req --self --signcrl --verify' -- "$cur") ) ;; pool) ;; @@ -91,7 +90,7 @@ _ipsec_strongswan() esac } -case "$( ipsec --version 2>/dev/null )" in +case "$(ipsec --version 2>/dev/null)" in *strongSwan*) complete -F _ipsec_strongswan ipsec ;; diff --git a/completions/iptables b/completions/iptables index 5ef81037bf6..32ae48c5339 100644 --- a/completions/iptables +++ b/completions/iptables @@ -17,34 +17,34 @@ _iptables() case $prev in -*[AIDRPFXLZ]) - COMPREPLY=( $( compgen -W '`"$1" $table -nL 2>/dev/null | \ - command sed -ne "s/^Chain \([^ ]\{1,\}\).*$/\1/p"`' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '`"$1" $table -nL 2>/dev/null | \ + command sed -ne "s/^Chain \([^ ]\{1,\}\).*$/\1/p"`' -- "$cur") ) ;; -*t) - COMPREPLY=( $( compgen -W 'nat filter mangle' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'nat filter mangle' -- "$cur") ) ;; -j) if [[ "$table" == "-t filter" || -z "$table" ]]; then - COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT + COMPREPLY=( $(compgen -W 'ACCEPT DROP LOG ULOG REJECT `"$1" $table -nL 2>/dev/null | command sed -ne "$chain" \ -e "s/INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING//"`' -- \ - "$cur" ) ) + "$cur") ) elif [[ $table == "-t nat" ]]; then - COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT MIRROR SNAT + COMPREPLY=( $(compgen -W 'ACCEPT DROP LOG ULOG REJECT MIRROR SNAT DNAT MASQUERADE `"$1" $table -nL 2>/dev/null | \ command sed -ne "$chain" -e "s/OUTPUT|PREROUTING|POSTROUTING//"`' \ - -- "$cur" ) ) + -- "$cur") ) elif [[ $table == "-t mangle" ]]; then - COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT MARK TOS + COMPREPLY=( $(compgen -W 'ACCEPT DROP LOG ULOG REJECT MARK TOS `"$1" $table -nL 2>/dev/null | command sed -ne "$chain" \ -e "s/INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING//"`' -- \ - "$cur" ) ) + "$cur") ) fi ;; *) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( "$1" --help 2>&1 | - command sed -e "s/^\[\!\]//" | _parse_help - )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$("$1" --help 2>&1 | + command sed -e "s/^\[\!\]//" | _parse_help -)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi ;; diff --git a/completions/ipv6calc b/completions/ipv6calc index ef8f4372afb..f001999a16a 100644 --- a/completions/ipv6calc +++ b/completions/ipv6calc @@ -11,9 +11,9 @@ _ipv6calc() ;; --in|--out|--action|-!(-*)[IOA]) # With ipv6calc < 0.73.0, -m does nothing here, so use sed instead. - COMPREPLY=( $( compgen -W "$( $1 "$prev" -h 2>&1 | \ - command sed -ne 's/^[[:space:]]\{1,\}\([^[:space:]:]\{1,\}\)[[:space:]]*:.*/\1/p' )" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 "$prev" -h 2>&1 | \ + command sed -ne 's/^[[:space:]]\{1,\}\([^[:space:]:]\{1,\}\)[[:space:]]*:.*/\1/p')" \ + -- "$cur") ) return ;; --db-geoip|--db-ip2location-ipv4|--db-ip2location-ipv6) @@ -28,13 +28,13 @@ _ipv6calc() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --debug --quiet --in --out --action + COMPREPLY=( $(compgen -W '--help --debug --quiet --in --out --action --examples --showinfo --show_types --machine_readable --db-geoip --db-geoip-default --db-ip2location-ipv4 --db-ip2location-ipv6 --lowercase --uppercase --printprefix --printsuffix --maskprefix --masksuffix --printstart --printend --printcompressed --printuncompressed --printfulluncompressed --printmirrored' \ - -- "$cur" ) ) + -- "$cur") ) fi } && diff --git a/completions/iscsiadm b/completions/iscsiadm index fdaebe77888..37961e63043 100644 --- a/completions/iscsiadm +++ b/completions/iscsiadm @@ -7,20 +7,20 @@ _iscsiadm() case $prev in --mode|-!(-*)m) - COMPREPLY=( $( compgen -W 'discovery node session iface fw host' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'discovery node session iface fw host' \ + -- "$cur") ) return ;; --op|-!(-*)o) - COMPREPLY=( $( compgen -W 'new delete update show' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'new delete update show' -- "$cur") ) return ;; --type|-!(-*)t) - COMPREPLY=( $( compgen -W 'sendtargets st slp isns fw' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'sendtargets st slp isns fw' -- "$cur") ) return ;; --loginall|--logoutall|-!(-*)[LU]) - COMPREPLY=( $( compgen -W 'all manual automatic' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'all manual automatic' -- "$cur") ) return ;; esac @@ -59,7 +59,7 @@ _iscsiadm() options='--mode' fi - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$options" -- "$cur") ) } && complete -F _iscsiadm iscsiadm diff --git a/completions/isort b/completions/isort index 127e3d106cd..e4a028bef44 100644 --- a/completions/isort +++ b/completions/isort @@ -15,22 +15,22 @@ _isort() return ;; --jobs|-j) - COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "{1..$(_ncpus)}" -- "$cur") ) return ;; --multi-line|-m) - COMPREPLY=( $( compgen -W '{0..5}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..5}' -- "$cur") ) return ;; --section-default|-sd) - COMPREPLY=( $( compgen -W 'FUTURE STDLIB THIRDPARTY FIRSTPARTY - LOCALFOLDER' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'FUTURE STDLIB THIRDPARTY FIRSTPARTY + LOCALFOLDER' -- "$cur") ) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi diff --git a/completions/isql b/completions/isql index 862a9304244..4bd24c41e5e 100644 --- a/completions/isql +++ b/completions/isql @@ -7,7 +7,7 @@ _isql() _init_completion || return [[ -f $ODBCINI ]] \ - && COMPREPLY=( $( command grep "\[$cur" "$ODBCINI" | tr -d \[\] ) ) + && COMPREPLY=( $(command grep "\[$cur" "$ODBCINI" | tr -d \[\]) ) } && complete -F _isql isql diff --git a/completions/iwconfig b/completions/iwconfig index 114081ddfae..762ec2eaf70 100644 --- a/completions/iwconfig +++ b/completions/iwconfig @@ -7,81 +7,81 @@ _iwconfig() case $prev in mode) - COMPREPLY=( $( compgen -W 'managed ad-hoc master repeater secondary - monitor' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'managed ad-hoc master repeater secondary + monitor' -- "$cur") ) return ;; essid) - COMPREPLY=( $( compgen -W 'on off any' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on off any' -- "$cur") ) if [[ -n ${COMP_IWLIST_SCAN:-} ]]; then - COMPREPLY+=( $( compgen -W \ - "$( iwlist ${words[1]} scan | \ - awk -F'\"' '/ESSID/ {print $2}' )" -- "$cur" ) ) + COMPREPLY+=( $(compgen -W \ + "$(iwlist ${words[1]} scan | \ + awk -F'\"' '/ESSID/ {print $2}')" -- "$cur") ) fi return ;; nwid) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on off' -- "$cur") ) return ;; channel) - COMPREPLY=( $( compgen -W "$( iwlist ${words[1]} channel | \ - awk '/^[ \t]*Channel/ {print $2}' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(iwlist ${words[1]} channel | \ + awk '/^[ \t]*Channel/ {print $2}')" -- "$cur") ) return ;; freq) - COMPREPLY=( $( compgen -W "$( iwlist ${words[1]} channel | \ - awk '/^[ \t]*Channel/ {print $4"G"}')" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(iwlist ${words[1]} channel | \ + awk '/^[ \t]*Channel/ {print $4"G"}')" -- "$cur") ) return ;; ap) - COMPREPLY=( $( compgen -W 'on off any' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on off any' -- "$cur") ) if [[ -n ${COMP_IWLIST_SCAN:-} ]]; then - COMPREPLY+=( $( compgen -W \ - "$( iwlist ${words[1]} scan | \ - awk -F ': ' '/Address/ {print $2}' )" -- "$cur" ) ) + COMPREPLY+=( $(compgen -W \ + "$(iwlist ${words[1]} scan | \ + awk -F ': ' '/Address/ {print $2}')" -- "$cur") ) fi return ;; rate) - COMPREPLY=( $( compgen -W 'auto fixed' -- "$cur" ) ) - COMPREPLY+=( $( compgen -W \ - "$( iwlist ${words[1]} rate | \ - awk '/^[ \t]*[0-9]/ {print $1"M"}' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'auto fixed' -- "$cur") ) + COMPREPLY+=( $(compgen -W \ + "$(iwlist ${words[1]} rate | \ + awk '/^[ \t]*[0-9]/ {print $1"M"}')" -- "$cur") ) return ;; rts|frag) - COMPREPLY=( $( compgen -W 'auto fixed off' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'auto fixed off' -- "$cur") ) return ;; key|enc) - COMPREPLY=( $( compgen -W 'off on open restricted' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'off on open restricted' -- "$cur") ) return ;; power) - COMPREPLY=( $( compgen -W 'period timeout off on' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'period timeout off on' -- "$cur") ) return ;; txpower) - COMPREPLY=( $( compgen -W 'off on auto' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'off on auto' -- "$cur") ) return ;; retry) - COMPREPLY=( $( compgen -W 'limit lifetime' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'limit lifetime' -- "$cur") ) return ;; esac if [[ $cword -eq 1 ]]; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --version' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--help --version' -- "$cur") ) else _available_interfaces -w fi else - COMPREPLY=( $( compgen -W 'essid nwid mode freq channel sens mode ap - nick rate rts frag enc key power txpower commit' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'essid nwid mode freq channel sens mode ap + nick rate rts frag enc key power txpower commit' -- "$cur") ) fi } && diff --git a/completions/iwlist b/completions/iwlist index b27dbe8bf9a..65e0b2fbf6b 100644 --- a/completions/iwlist +++ b/completions/iwlist @@ -7,14 +7,14 @@ _iwlist() if [[ $cword -eq 1 ]]; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --version' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--help --version' -- "$cur") ) else _available_interfaces -w fi else - COMPREPLY=( $( compgen -W 'scan scanning freq frequency channel rate + COMPREPLY=( $(compgen -W 'scan scanning freq frequency channel rate bit bitrate key enc encryption power txpower retry ap accesspoint - peers event' -- "$cur" ) ) + peers event' -- "$cur") ) fi } && complete -F _iwlist iwlist diff --git a/completions/iwpriv b/completions/iwpriv index c7f8209eb24..83673b4e1c0 100644 --- a/completions/iwpriv +++ b/completions/iwpriv @@ -7,23 +7,23 @@ _iwpriv() case $prev in roam) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on off' -- "$cur") ) return ;; port) - COMPREPLY=( $( compgen -W 'ad-hoc managed' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'ad-hoc managed' -- "$cur") ) return ;; esac if [[ $cword -eq 1 ]]; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --version' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--help --version' -- "$cur") ) else _available_interfaces -w fi else - COMPREPLY=( $( compgen -W '--all roam port' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--all roam port' -- "$cur") ) fi } && complete -F _iwpriv iwpriv diff --git a/completions/iwspy b/completions/iwspy index 1cf3a283675..e48051166d3 100644 --- a/completions/iwspy +++ b/completions/iwspy @@ -7,12 +7,12 @@ _iwspy() if [[ $cword -eq 1 ]]; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --version' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--help --version' -- "$cur") ) else _available_interfaces -w fi else - COMPREPLY=( $( compgen -W 'setthr getthr off' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'setthr getthr off' -- "$cur") ) fi } && complete -F _iwspy iwspy diff --git a/completions/jar b/completions/jar index b7de930f8ad..c839aa85617 100644 --- a/completions/jar +++ b/completions/jar @@ -6,7 +6,7 @@ _jar() _init_completion || return if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'c t x u' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'c t x u' -- "$cur") ) return fi diff --git a/completions/jarsigner b/completions/jarsigner index 2441bd1a6ca..e05ec2818d7 100644 --- a/completions/jarsigner +++ b/completions/jarsigner @@ -7,7 +7,7 @@ _jarsigner() case $prev in -keystore) - COMPREPLY=( $( compgen -W 'NONE' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'NONE' -- "$cur") ) _filedir '@(jks|ks|p12|pfx)' return ;; @@ -21,7 +21,7 @@ _jarsigner() return ;; -storetype) - COMPREPLY=( $( compgen -W 'JKS PKCS11 PKCS12' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'JKS PKCS11 PKCS12' -- "$cur") ) return ;; -signedjar) @@ -43,11 +43,11 @@ _jarsigner() if ! $jar ; then if [[ "$cur" == -* ]] ; then # Documented as "should not be used": -internalsf, -sectionsonly - COMPREPLY=( $( compgen -W '-keystore -storepass -storetype + COMPREPLY=( $(compgen -W '-keystore -storepass -storetype -keypass -sigfile -signedjar -digestalg -sigalg -verify -verbose -certs -tsa -tsacert -altsigner -altsignerpath -protected -providerName -providerClass -providerArg' \ - -- "$cur" ) ) + -- "$cur") ) fi _filedir jar fi diff --git a/completions/java b/completions/java index e8d81fb454e..3ca65869c39 100644 --- a/completions/java +++ b/completions/java @@ -62,18 +62,18 @@ _java_classes() for i in ${classpath//:/ }; do if [[ "$i" == *.@(jar|zip) && -r $i ]]; then if type zipinfo &>/dev/null; then - COMPREPLY+=( $( zipinfo -1 "$i" "$cur*" 2>/dev/null | \ - command grep '^[^$]*\.class$' ) ) + COMPREPLY+=( $(zipinfo -1 "$i" "$cur*" 2>/dev/null | \ + command grep '^[^$]*\.class$') ) else - COMPREPLY+=( $( jar tf "$i" "$cur" | \ - command grep '^[^$]*\.class$' ) ) + COMPREPLY+=( $(jar tf "$i" "$cur" | \ + command grep '^[^$]*\.class$') ) fi elif [[ -d $i ]]; then COMPREPLY+=( - $( compgen -d -- "$i/$cur" | command sed -e "s|^$i/\(.*\)|\1.|" ) - $( compgen -f -X '!*.class' -- "$i/$cur" | \ - command sed -e '/\$/d' -e "s|^$i/||" ) + $(compgen -d -- "$i/$cur" | command sed -e "s|^$i/\(.*\)|\1.|") + $(compgen -f -X '!*.class' -- "$i/$cur" | \ + command sed -e '/\$/d' -e "s|^$i/||") ) [[ $COMPREPLY == *.class ]] || compopt -o nospace @@ -102,12 +102,12 @@ _java_packages() # parse each sourcepath element for packages for i in ${sourcepath//:/ }; do if [[ -d $i ]]; then - COMPREPLY+=( $( command ls -F -d $i/$cur* 2>/dev/null | \ - command sed -e 's|^'$i'/||' ) ) + COMPREPLY+=( $(command ls -F -d $i/$cur* 2>/dev/null | \ + command sed -e 's|^'$i'/||') ) fi done # keep only packages - COMPREPLY=( $( tr " " "\n" <<<"${COMPREPLY[@]}" | command grep "/$" ) ) + COMPREPLY=( $(tr " " "\n" <<<"${COMPREPLY[@]}" | command grep "/$") ) # remove packages extension COMPREPLY=( ${COMPREPLY[@]%/} ) # convert path syntax to package syntax @@ -142,7 +142,7 @@ _java() case $cur in # standard option completions -verbose:*) - COMPREPLY=( $( compgen -W 'class gc jni' -- "${cur#*:}" ) ) + COMPREPLY=( $(compgen -W 'class gc jni' -- "${cur#*:}") ) return ;; -javaagent:*) @@ -166,17 +166,17 @@ _java() return ;; -Xcheck:*) - COMPREPLY=( $( compgen -W 'jni' -- "${cur#*:}" ) ) + COMPREPLY=( $(compgen -W 'jni' -- "${cur#*:}") ) return ;; -Xgc:*) - COMPREPLY=( $( compgen -W 'singlecon gencon singlepar genpar' \ - -- "${cur#*:}" ) ) + COMPREPLY=( $(compgen -W 'singlecon gencon singlepar genpar' \ + -- "${cur#*:}") ) return ;; -Xgcprio:*) - COMPREPLY=( $( compgen -W 'throughput pausetime deterministic' \ - -- "${cur#*:}" ) ) + COMPREPLY=( $(compgen -W 'throughput pausetime deterministic' \ + -- "${cur#*:}") ) return ;; -Xloggc:*|-Xverboselog:*) @@ -185,16 +185,16 @@ _java() return ;; -Xshare:*) - COMPREPLY=( $( compgen -W 'auto off on' -- "${cur#*:}" ) ) + COMPREPLY=( $(compgen -W 'auto off on' -- "${cur#*:}") ) return ;; -Xverbose:*) - COMPREPLY=( $( compgen -W 'memory load jni cpuinfo codegen opt - gcpause gcreport' -- "${cur#*:}" ) ) + COMPREPLY=( $(compgen -W 'memory load jni cpuinfo codegen opt + gcpause gcreport' -- "${cur#*:}") ) return ;; -Xverify:*) - COMPREPLY=( $( compgen -W 'all none remote' -- "${cur#*:}" ) ) + COMPREPLY=( $(compgen -W 'all none remote' -- "${cur#*:}") ) return ;; # the rest that we have no completions for @@ -211,9 +211,9 @@ _java() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) [[ $cur == -X* ]] && \ - COMPREPLY+=( $( compgen -W '$( _parse_help "$1" -X )' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W '$(_parse_help "$1" -X)' -- "$cur") ) else if [[ "$prev" == -jar ]]; then # jar file completion @@ -271,7 +271,7 @@ _javadoc() fi if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) else # source files completion _filedir java @@ -304,16 +304,16 @@ _javac() # For some reason there may be -g:none AND -g:{lines,source,vars}; # convert the none case to the curly brace format so it parses like # the others. - local opts=$( "$1" $helpopt 2>&1 | command sed -e 's/-g:none/-g:{none}/' -ne \ - "s/^[[:space:]]*${cur%%:*}:{\([^}]\{1,\}\)}.*/\1/p" ) - COMPREPLY=( $( compgen -W "${opts//,/ }" -- "${cur#*:}" ) ) + local opts=$("$1" $helpopt 2>&1 | command sed -e 's/-g:none/-g:{none}/' -ne \ + "s/^[[:space:]]*${cur%%:*}:{\([^}]\{1,\}\)}.*/\1/p") + COMPREPLY=( $(compgen -W "${opts//,/ }" -- "${cur#*:}") ) return fi if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) [[ $cur == -X* ]] && \ - COMPREPLY+=( $( compgen -W '$( _parse_help "$1" -X )' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W '$(_parse_help "$1" -X)' -- "$cur") ) else # source files completion _filedir java diff --git a/completions/javaws b/completions/javaws index 7d6e22c8835..c21d3ac4ecc 100644 --- a/completions/javaws +++ b/completions/javaws @@ -22,7 +22,7 @@ _javaws() if [[ $cur == *= ]]; then return elif [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W "$( _parse_help "$1" -help ) " -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(_parse_help "$1" -help) " -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/jpegoptim b/completions/jpegoptim index 748a47e4c71..044cc753a2b 100644 --- a/completions/jpegoptim +++ b/completions/jpegoptim @@ -14,11 +14,11 @@ _jpegoptim() return ;; --max|--threshold|-!(-*)[mT]) - COMPREPLY=( $( compgen -W '{0..100}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..100}' -- "$cur") ) return ;; --size|-!(-*)S) - COMPREPLY=( $( compgen -W '{1..99}%' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{1..99}%' -- "$cur") ) return ;; esac @@ -26,7 +26,7 @@ _jpegoptim() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/jps b/completions/jps index e46c9f1667e..a6a602994d2 100644 --- a/completions/jps +++ b/completions/jps @@ -14,7 +14,7 @@ _jps() if [[ $cur == -* ]]; then # Not using _parse_usage because output has [-help] which does not # mean -h, -e, -l, -p... - COMPREPLY=( $( compgen -W "-q -m -l -v -V -J -help" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "-q -m -l -v -V -J -help" -- "$cur") ) [[ $COMPREPLY == -J* ]] && compopt -o nospace else _known_hosts_real -- "$cur" diff --git a/completions/jq b/completions/jq index 6857089da3e..3fdbfb0ccbd 100644 --- a/completions/jq +++ b/completions/jq @@ -10,7 +10,7 @@ _jq() return ;; --indent) - COMPREPLY=( $( compgen -W '{1..8}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{1..8}' -- "$cur") ) return ;; --from-file|--run-tests|-!(-*)f) @@ -35,7 +35,7 @@ _jq() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi diff --git a/completions/jshint b/completions/jshint index ea9bbeb5ec5..ee89070a609 100644 --- a/completions/jshint +++ b/completions/jshint @@ -14,11 +14,11 @@ _jshint() return ;; --reporter) - COMPREPLY=( $( compgen -W "jslint checkstyle unix" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "jslint checkstyle unix" -- "$cur") ) return ;; --extract) - COMPREPLY=( $( compgen -W "auto always never" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "auto always never" -- "$cur") ) return ;; esac @@ -26,7 +26,7 @@ _jshint() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/json_xs b/completions/json_xs index 187eaf040a7..98d0ba63eee 100644 --- a/completions/json_xs +++ b/completions/json_xs @@ -7,15 +7,15 @@ _json_xs() case $prev in -*f) - COMPREPLY=( $( compgen -W 'json cbor storable storable-file bencode - clzf eval yaml string none' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'json cbor storable storable-file bencode + clzf eval yaml string none' -- "$cur") ) return ;; -*t) - COMPREPLY=( $( compgen -W 'json json-utf-8 json-pretty + COMPREPLY=( $(compgen -W 'json json-utf-8 json-pretty json-utf-16le json-utf-16be json-utf-32le json-utf-32be cbor storable storable-file bencode clzf yaml dump dumper - string none' -- "$cur" ) ) + string none' -- "$cur") ) return ;; -*e) @@ -24,7 +24,7 @@ _json_xs() esac [[ $cur == -* ]] && - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" ) -f' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1") -f' -- "$cur") ) } && complete -F _json_xs json_xs diff --git a/completions/jsonschema b/completions/jsonschema index ec52586818f..441977e4f57 100644 --- a/completions/jsonschema +++ b/completions/jsonschema @@ -16,7 +16,7 @@ _jsonschema() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi diff --git a/completions/k3b b/completions/k3b index 2cbcbb1bcb3..111ae7b462a 100644 --- a/completions/k3b +++ b/completions/k3b @@ -31,13 +31,13 @@ _k3b() return ;; --ao) - COMPREPLY=( $( compgen -W 'alsa arts' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'alsa arts' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W "$( _parse_help "$1" )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(_parse_help "$1")" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else _filedir diff --git a/completions/kcov b/completions/kcov index 5d067778158..8490a969e04 100644 --- a/completions/kcov +++ b/completions/kcov @@ -11,8 +11,8 @@ _kcov() return ;; --sort-type|-s) - COMPREPLY=( $( compgen -W 'filename percent reverse lines - uncovered' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'filename percent reverse lines + uncovered' -- "$cur") ) return ;; --include-path|--exclude-path) @@ -33,11 +33,11 @@ _kcov() if [[ "$cur" == ?*,* ]]; then prev="${cur%,*}" cur="${cur##*,}" - COMPREPLY=( $( compgen -W "{0..100}" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "{0..100}" -- "$cur") ) [[ ${#COMPREPLY[@]} -eq 1 ]] && \ COMPREPLY=( ${COMPREPLY/#/$prev,} ) else - COMPREPLY=( $( compgen -W "{0..100}" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "{0..100}" -- "$cur") ) [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/%/,} ) compopt -o nospace fi @@ -52,7 +52,7 @@ _kcov() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" --help)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/kill b/completions/kill index ac179cd996a..4cd5f9112fa 100644 --- a/completions/kill +++ b/completions/kill @@ -18,7 +18,7 @@ _kill() if [[ $cword -eq 1 && "$cur" == -* ]]; then # return list of available signals _signals - - COMPREPLY+=( $( compgen -W "-s -l" -- "$cur" ) ) + COMPREPLY+=( $(compgen -W "-s -l" -- "$cur") ) else # return list of available PIDs _pids diff --git a/completions/killall b/completions/killall index fc7929b7405..e1b56ce133b 100644 --- a/completions/killall +++ b/completions/killall @@ -24,7 +24,7 @@ _killall() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $cword -eq 1 ]] && _signals - return fi diff --git a/completions/kldload b/completions/kldload index 0442e95e800..4817679e1e8 100644 --- a/completions/kldload +++ b/completions/kldload @@ -11,7 +11,7 @@ _kldload() [[ -d $moddir ]] || moddir=/boot/kernel/ compopt -o filenames - COMPREPLY=( $( compgen -f "$moddir$cur" ) ) + COMPREPLY=( $(compgen -f "$moddir$cur") ) COMPREPLY=( ${COMPREPLY[@]#$moddir} ) COMPREPLY=( ${COMPREPLY[@]%.ko} ) diff --git a/completions/kldunload b/completions/kldunload index 52634c1e102..e14626770f7 100644 --- a/completions/kldunload +++ b/completions/kldunload @@ -7,7 +7,7 @@ _kldunload() local cur prev words cword _init_completion || return - COMPREPLY=( $( compgen -W '$(kldstat)' -X 'kernel' -X '!*.ko' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(kldstat)' -X 'kernel' -X '!*.ko' -- "$cur") ) COMPREPLY=( ${COMPREPLY[@]%.ko} ) } && complete -F _kldunload kldunload diff --git a/completions/koji b/completions/koji index 2e75ed709ee..be43f0a2459 100644 --- a/completions/koji +++ b/completions/koji @@ -2,8 +2,8 @@ _koji_search() { - COMPREPLY+=( $( compgen -W \ - '$( "$1" -q search $2 "$cur*" 2>/dev/null )' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W \ + '$("$1" -q search $2 "$cur*" 2>/dev/null)' -- "$cur") ) } _koji_build() @@ -23,14 +23,13 @@ _koji_user() _koji_tag() { - COMPREPLY+=( $( compgen -W '$( "$1" -q list-tags 2>/dev/null )' \ - -- "$cur" ) ) + COMPREPLY+=( $(compgen -W '$("$1" -q list-tags 2>/dev/null)' -- "$cur") ) } _koji_target() { - COMPREPLY+=( $( compgen -W '$( "$1" -q list-targets 2>/dev/null | - awk "{ print \$1 }" )' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W '$("$1" -q list-targets 2>/dev/null | + awk "{ print \$1 }")' -- "$cur") ) } _koji() @@ -59,8 +58,7 @@ _koji() return ;; --authtype) - COMPREPLY=( $( compgen -W 'noauth ssl password kerberos' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'noauth ssl password kerberos' -- "$cur") ) return ;; --topdir) @@ -70,7 +68,7 @@ _koji() --type) case $command in latest-pkg|list-tagged) - COMPREPLY=( $( compgen -W 'maven' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'maven' -- "$cur") ) ;; esac return @@ -109,8 +107,8 @@ _koji() if [[ $command ]]; then if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W \ - '$( _parse_help "$1" "$command --help" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$(_parse_help "$1" "$command --help")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi @@ -199,8 +197,8 @@ _koji() search) case $nth in 1) - COMPREPLY=( $( compgen -W 'package build tag target - user host rpm' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'package build tag target + user host rpm' -- "$cur") ) ;; esac ;; @@ -235,11 +233,11 @@ _koji() fi if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace elif [[ ! $command ]]; then - COMPREPLY=( $( compgen -W '$( "$1" --help-commands 2>/dev/null | \ - awk "/^( +|\t)/ { print \$1 }" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$("$1" --help-commands 2>/dev/null | \ + awk "/^( +|\t)/ { print \$1 }")' -- "$cur") ) fi } && complete -F _koji koji arm-koji ppc-koji s390-koji sparc-koji diff --git a/completions/ktutil b/completions/ktutil index 2baa1c6cb81..5ee5fdad8be 100644 --- a/completions/ktutil +++ b/completions/ktutil @@ -2,21 +2,21 @@ _heimdal_principals() { - COMPREPLY=( $( compgen -W "$( kadmin -l dump 2>/dev/null | \ - awk '{print $1}' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(kadmin -l dump 2>/dev/null | \ + awk '{print $1}')" -- "$cur") ) } _heimdal_realms() { - COMPREPLY=( $( compgen -W "( kadmin -l dump 2>/dev/null | \ - awk '{print $1}' | awk -F@ '{print $2}' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(kadmin -l dump 2>/dev/null | \ + awk '{print $1}' | awk -F@ '{print $2}')" -- "$cur") ) } _heimdal_encodings() { - COMPREPLY=( $( compgen -W 'des-cbc-mcrc des-cbc-md4 des-cbc-md5 + COMPREPLY=( $(compgen -W 'des-cbc-mcrc des-cbc-md4 des-cbc-md5 des3-cbc-sha1 arcfour-hmac-md5 aes128-cts-hmac-sha1-96 - aes256-cts-hmac-sha1-96' -- "$cur" ) ) + aes256-cts-hmac-sha1-96' -- "$cur") ) } _ktutil() @@ -97,7 +97,7 @@ _ktutil() options='-k --keytab -v --verbose --version -v --help' ;; esac - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$options" -- "$cur") ) else case $command in copy) @@ -110,7 +110,7 @@ _ktutil() _heimdal_principals ;; *) - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$commands" -- "$cur") ) ;; esac fi diff --git a/completions/larch b/completions/larch index 5b7ebd148d9..0773c2dac5e 100644 --- a/completions/larch +++ b/completions/larch @@ -7,7 +7,7 @@ _larch() _init_completion || return if [[ $cword -eq 1 || "$prev" == -* ]]; then - COMPREPLY=( $( compgen -W ' \ + COMPREPLY=( $(compgen -W ' \ my-id my-default-archive register-archive whereis-archive archives \ init-tree tree-root tree-version set-tree-version inventory \ tagging-method tree-lint missing-tags add delete \ @@ -30,7 +30,7 @@ _larch() distribution-name notify my-notifier mail-new-categories \ mail-new-branches mail-new-versions mail-new-revisions \ notify-library notify-browser push-new-revisions sendmail-mailx' \ - "$cur" ) ) + "$cur") ) fi } && diff --git a/completions/lastlog b/completions/lastlog index 83e232b0eec..19e928c202e 100644 --- a/completions/lastlog +++ b/completions/lastlog @@ -10,14 +10,14 @@ _lastlog() return ;; --user|-!(-*)u) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; esac $split && return - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace } && complete -F _lastlog lastlog diff --git a/completions/ldapsearch b/completions/ldapsearch index 66c0e03c56f..a0bdcb9d7bf 100644 --- a/completions/ldapsearch +++ b/completions/ldapsearch @@ -2,12 +2,12 @@ _ldap_uris() { - COMPREPLY=( $( compgen -W 'ldap:// ldaps://' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'ldap:// ldaps://' -- "$cur") ) } _ldap_protocols() { - COMPREPLY=( $( compgen -W '2 3' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '2 3' -- "$cur") ) } _ldapsearch() @@ -33,12 +33,11 @@ _ldapsearch() return ;; -*s) - COMPREPLY=( $( compgen -W 'base one sub children' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'base one sub children' -- "$cur") ) return ;; -*a) - COMPREPLY=( $( compgen -W 'never always search find' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'never always search find' -- "$cur") ) return ;; -*P) @@ -48,7 +47,7 @@ _ldapsearch() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1") -MM -ZZ' -- "$cur") ) fi } && complete -F _ldapsearch ldapsearch @@ -78,7 +77,7 @@ _ldapaddmodify() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1") -MM -ZZ' -- "$cur") ) fi } && complete -F _ldapaddmodify ldapadd ldapmodify @@ -108,7 +107,7 @@ _ldapdelete() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1") -MM -ZZ' -- "$cur") ) fi } && complete -F _ldapdelete ldapdelete @@ -138,7 +137,7 @@ _ldapcompare() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1") -MM -ZZ' -- "$cur") ) fi } && complete -F _ldapcompare ldapcompare @@ -168,7 +167,7 @@ _ldapmodrdn() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -ZZ -MM' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1") -ZZ -MM' -- "$cur") ) fi } && complete -F _ldapmodrdn ldapmodrdn @@ -198,7 +197,7 @@ _ldapwhoami() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1") -MM -ZZ' -- "$cur") ) fi } && complete -F _ldapwhoami ldapwhoami @@ -224,7 +223,7 @@ _ldappasswd() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -MM -ZZ' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1") -MM -ZZ' -- "$cur") ) fi } && complete -F _ldappasswd ldappasswd diff --git a/completions/ldapvi b/completions/ldapvi index 0fc3a67f967..a7b55fcc293 100644 --- a/completions/ldapvi +++ b/completions/ldapvi @@ -11,39 +11,39 @@ _ldapvi() return ;; --sasl-mech|-!(-*)Y) - COMPREPLY=( $( compgen -W 'EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 - PLAIN ANONYMOUS' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 + PLAIN ANONYMOUS' -- "$cur") ) return ;; --bind) - COMPREPLY=( $( compgen -W 'simple sasl' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'simple sasl' -- "$cur") ) return ;; --bind-dialog) - COMPREPLY=( $( compgen -W 'never auto always' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'never auto always' -- "$cur") ) return ;; --scope) - COMPREPLY=( $( compgen -W 'base one sub' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'base one sub' -- "$cur") ) return ;; --deref) - COMPREPLY=( $( compgen -W 'never searching finding always' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'never searching finding always' \ + -- "$cur") ) return ;; --encoding) - COMPREPLY=( $( compgen -W 'ASCII UTF-8 binary' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'ASCII UTF-8 binary' -- "$cur") ) return ;; --tls) - COMPREPLY=( $( compgen -W 'never allow try strict' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'never allow try strict' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) fi } && complete -F _ldapvi ldapvi diff --git a/completions/lftp b/completions/lftp index 674a5bfdd6b..427800ae13c 100644 --- a/completions/lftp +++ b/completions/lftp @@ -16,12 +16,12 @@ _lftp() esac if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi - COMPREPLY=( $( compgen -W \ - '$( cut -f 1 -s ~/.lftp/bookmarks ${XDG_DATA_HOME:-$HOME/.local/share}/lftp/bookmarks 2>/dev/null )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$(cut -f 1 -s ~/.lftp/bookmarks ${XDG_DATA_HOME:-$HOME/.local/share}/lftp/bookmarks 2>/dev/null)' -- "$cur") ) _known_hosts_real -- "$cur" } && complete -F _lftp lftp diff --git a/completions/lftpget b/completions/lftpget index 8f1d4a2f906..fd0157b78b9 100644 --- a/completions/lftpget +++ b/completions/lftpget @@ -6,7 +6,7 @@ _lftpget() _init_completion || return if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '-c -d -v' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-c -d -v' -- "$cur") ) fi } && complete -F _lftpget lftpget diff --git a/completions/lilo b/completions/lilo index 1ccca35c834..03e3ee29a7f 100644 --- a/completions/lilo +++ b/completions/lilo @@ -2,8 +2,8 @@ _lilo_labels() { - COMPREPLY=( $( compgen -W "$( awk -F'=' '/label/ {print $2}' \ - /etc/lilo.conf | command sed -e 's/\"//g' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(awk -F'=' '/label/ {print $2}' \ + /etc/lilo.conf | command sed -e 's/\"//g')" -- "$cur") ) } _lilo() @@ -33,16 +33,16 @@ _lilo() ;; -T) # topic completion - COMPREPLY=( $( compgen -W 'help ChRul EBDA geom geom= table= - video' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'help ChRul EBDA geom geom= table= + video' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then # relevant options completion - COMPREPLY=( $( compgen -W '-A -b -c -C -d -f -g -i -I -l -L -m -M -p -P - -q -r -R -s -S -t -T -u -U -v -V -w -x -z' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-A -b -c -C -d -f -g -i -I -l -L -m -M -p -P + -q -r -R -s -S -t -T -u -U -v -V -w -x -z' -- "$cur") ) fi } && complete -F _lilo lilo diff --git a/completions/links b/completions/links index 8bbc68f9254..6bfee6540d1 100644 --- a/completions/links +++ b/completions/links @@ -7,11 +7,11 @@ _links() case $prev in -html-t-text-color|-html-t-link-color) - COMPREPLY=( $( compgen -W '{0..15}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..15}' -- "$cur") ) return ;; -http.fake-firefox|-html-[gt]-ignore-document-color) - COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '0 1' -- "$cur") ) return ;; --help|-help|-mode|-display|-source|-dump|-width|-max-connections|\ @@ -27,10 +27,10 @@ _links() return ;; -driver) - local drivers=$( "$1" -driver foo 2>&1 | - command sed -ne '$!d' -e '/^[a-z0-9, ]\{1,\}$/s/,/ /gp' ) + local drivers=$("$1" -driver foo 2>&1 | + command sed -ne '$!d' -e '/^[a-z0-9, ]\{1,\}$/s/,/ /gp') [[ $drivers ]] || drivers='x svgalib fb directfb pmshell atheos' - COMPREPLY=( $( compgen -W "$drivers" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$drivers" -- "$cur") ) return ;; -codepage|-bookmarks-codepage|-http-assume-codepage) @@ -54,15 +54,15 @@ _links() -http-bugs.*|-http.do-not-track|-ftp.use-*|-ftp.fast|-ftp.set-iptos|\ -smb.allow-hyperlinks-to-smb|-save-url-history|-dither-letters|\ -dither-images|-overwrite-instead-of-scroll|-html-*) - COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '0 1' -- "$cur") ) return ;; -address-preference|-http.referer) - COMPREPLY=( $( compgen -W '{0..4}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..4}' -- "$cur") ) return ;; -ssl-certificates|-display-optimize|-gamma-correction) - COMPREPLY=( $( compgen -W '{0..2}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..2}' -- "$cur") ) return ;; -ssl.client-cert-key) @@ -80,15 +80,15 @@ _links() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" | - command grep -vF -- "->" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" | + command grep -vF -- "->")' -- "$cur") ) return fi local dir for dir in .links .links2; do if [[ -r ~/$dir/links.his ]]; then - COMPREPLY+=( $( compgen -W '$( cat ~/$dir/links.his )' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W '$(cat ~/$dir/links.his)' -- "$cur") ) __ltrim_colon_completions "$cur" fi done diff --git a/completions/lintian b/completions/lintian index e62a62654ff..fbf54f964b9 100644 --- a/completions/lintian +++ b/completions/lintian @@ -4,13 +4,13 @@ _lintian_tags() { local match search tags - tags=$( awk '/^Tag/ { print $2 }' /usr/share/lintian/checks/*.desc ) + tags=$(awk '/^Tag/ { print $2 }' /usr/share/lintian/checks/*.desc) if [[ "$cur" == *, ]]; then search=${cur//,/ } for item in $search; do - match=$( command grep -nE "^Tag: $item$" \ - /usr/share/lintian/checks/*.desc | cut -d: -f1 ) - tags=$( command sed -e "s/\<$item\>//g" <<<$tags ) + match=$(command grep -nE "^Tag: $item$" \ + /usr/share/lintian/checks/*.desc | cut -d: -f1) + tags=$(command sed -e "s/\<$item\>//g" <<<$tags) done COMPREPLY+=( $(compgen -W "$tags") ) elif [[ "$cur" == *,* ]]; then @@ -24,16 +24,16 @@ _lintian_checks() { local match search todisable checks - checks=$( awk '/^(Check-Script|Abbrev)/ { print $2 }' \ - /usr/share/lintian/checks/*.desc ) + checks=$(awk '/^(Check-Script|Abbrev)/ { print $2 }' \ + /usr/share/lintian/checks/*.desc) if [[ "$cur" == *, ]]; then search=${cur//,/ } for item in $search; do - match=$( command grep -nE "^(Check-Script|Abbrev): $item$" \ - /usr/share/lintian/checks/*.desc | cut -d: -f1 ) - todisable=$( awk '/^(Check-Script|Abbrev)/ { print $2 }' $match ) + match=$(command grep -nE "^(Check-Script|Abbrev): $item$" \ + /usr/share/lintian/checks/*.desc | cut -d: -f1) + todisable=$(awk '/^(Check-Script|Abbrev)/ { print $2 }' $match) for name in $todisable; do - checks=$( command sed -e "s/\<$name\>//g" <<<$checks ) + checks=$(command sed -e "s/\<$name\>//g" <<<$checks) done done COMPREPLY+=( $(compgen -W "$checks") ) @@ -48,14 +48,14 @@ _lintian_infos() { local match search infos - infos=$( awk '/^Collector/ { print $2 }' \ - /usr/share/lintian/collection/*.desc ) + infos=$(awk '/^Collector/ { print $2 }' \ + /usr/share/lintian/collection/*.desc) if [[ "$cur" == *, ]]; then search=${cur//,/ } for item in $search; do - match=$( command grep -nE "^Collector: $item$" \ - /usr/share/lintian/collection/*.desc | cut -d: -f1 ) - infos=$( command sed -e "s/\<$item\>//g" <<<$infos ) + match=$(command grep -nE "^Collector: $item$" \ + /usr/share/lintian/collection/*.desc | cut -d: -f1) + infos=$(command sed -e "s/\<$item\>//g" <<<$infos) done COMPREPLY+=( $(compgen -W "$infos") ) elif [[ "$cur" == *,* ]]; then diff --git a/completions/lisp b/completions/lisp index 279ffcdb03d..f9f68275d89 100644 --- a/completions/lisp +++ b/completions/lisp @@ -9,9 +9,9 @@ _lisp() # completing an option (may or may not be separated by a space) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-core -lib -batch -quit -edit -eval -init + COMPREPLY=( $(compgen -W '-core -lib -batch -quit -edit -eval -init -dynamic-space-size -hinit -noinit -nositeinit -load -slave' \ - -- "$cur" ) ) + -- "$cur") ) else _filedir fi diff --git a/completions/list_admins b/completions/list_admins index 06542f91c12..11f7414d42c 100644 --- a/completions/list_admins +++ b/completions/list_admins @@ -6,7 +6,7 @@ _list_admins() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--all-vhost --all --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--all-vhost --all --help' -- "$cur") ) else _xfunc list_lists _mailman_lists fi diff --git a/completions/list_lists b/completions/list_lists index 629e4c073f8..c08071784fb 100644 --- a/completions/list_lists +++ b/completions/list_lists @@ -2,7 +2,7 @@ _mailman_lists() { - COMPREPLY=( $( compgen -W '$( list_lists -b 2>/dev/null )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(list_lists -b 2>/dev/null)' -- "$cur") ) } _list_lists() @@ -11,8 +11,8 @@ _list_lists() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--advertised --virtual-host-overview --bare - --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--advertised --virtual-host-overview --bare + --help' -- "$cur") ) fi } && diff --git a/completions/list_members b/completions/list_members index e60f61da1d4..90db5cba07b 100644 --- a/completions/list_members +++ b/completions/list_members @@ -11,12 +11,12 @@ _list_members() return ;; -d|--digest) - COMPREPLY=( $( compgen -W 'mime plain' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'mime plain' -- "$cur") ) return ;; -n|--nomail) - COMPREPLY=( $( compgen -W 'byadmin byuser bybounce unknown' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'byadmin byuser bybounce unknown' \ + -- "$cur") ) return ;; esac @@ -24,8 +24,8 @@ _list_members() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--output --regular --digest --nomail - --fullnames --preserve --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--output --regular --digest --nomail + --fullnames --preserve --help' -- "$cur") ) else _xfunc list_lists _mailman_lists fi diff --git a/completions/list_owners b/completions/list_owners index 88b25bb3a49..18b524761e1 100644 --- a/completions/list_owners +++ b/completions/list_owners @@ -6,8 +6,8 @@ _list_owners() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--with-listnames --moderators --help' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--with-listnames --moderators --help' \ + -- "$cur") ) else _xfunc list_lists _mailman_lists fi diff --git a/completions/locale-gen b/completions/locale-gen index d3da9fa5a37..3dae76ff794 100644 --- a/completions/locale-gen +++ b/completions/locale-gen @@ -18,14 +18,14 @@ _locale_gen() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi - COMPREPLY=( $( compgen -W \ - '$( awk "{ print \$1 }" /usr/share/i18n/SUPPORTED 2>/dev/null )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$(awk "{ print \$1 }" /usr/share/i18n/SUPPORTED 2>/dev/null)' \ + -- "$cur") ) } && complete -F _locale_gen locale-gen diff --git a/completions/lpq b/completions/lpq index b02705af1c8..a1223268d30 100644 --- a/completions/lpq +++ b/completions/lpq @@ -7,17 +7,17 @@ _lpq() case $prev in -P) - COMPREPLY=( $( compgen -W "$( lpstat -a 2>/dev/null | cut -d' ' -f1 )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(lpstat -a 2>/dev/null | cut -d' ' -f1)" -- "$cur") ) return ;; -U) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; esac if [[ "$cur" == - ]]; then - COMPREPLY=( $( compgen -W '-E -P -U -a -h -l' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-E -P -U -a -h -l' -- "$cur") ) return fi diff --git a/completions/lpr b/completions/lpr index b1515bd5f4a..9a9e86391da 100644 --- a/completions/lpr +++ b/completions/lpr @@ -7,22 +7,22 @@ _lpr() case $prev in -P) - COMPREPLY=( $( compgen -W "$( lpstat -a 2>/dev/null | cut -d' ' -f1 )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(lpstat -a 2>/dev/null | cut -d' ' -f1)" -- "$cur") ) return ;; -U) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; -o) - COMPREPLY=( $( compgen -W "media= landscape orientation-requested= sides= fitplot number-up= scaling= cpi= lpi= page-bottom= page-top= page-left= page-right=" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "media= landscape orientation-requested= sides= fitplot number-up= scaling= cpi= lpi= page-bottom= page-top= page-left= page-right=" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return ;; esac if [[ "$cur" == - ]]; then - COMPREPLY=( $( compgen -W '-E -H -C -J -T -P -U -h -l -m -o -p -q -r' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-E -H -C -J -T -P -U -h -l -m -o -p -q -r' -- "$cur") ) return fi diff --git a/completions/lrzip b/completions/lrzip index d4e929faea9..5eb2445bc8a 100644 --- a/completions/lrzip +++ b/completions/lrzip @@ -23,21 +23,21 @@ _lrzip() return ;; -*L) - COMPREPLY=( $( compgen -W '{1..9}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{1..9}' -- "$cur") ) return ;; -*N) - COMPREPLY=( $( compgen -W '{-20..19}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{-20..19}' -- "$cur") ) return ;; -*p) - COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "{1..$(_ncpus)}" -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi @@ -45,8 +45,7 @@ _lrzip() local IFS=$'\n' compopt -o filenames - COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ - $( compgen -d -- "$cur" ) ) + COMPREPLY=( $(compgen -f -X "$xspec" -- "$cur") $(compgen -d -- "$cur") ) } && complete -F _lrzip lrzip diff --git a/completions/lsof b/completions/lsof index 329946d5af1..e904f406d73 100644 --- a/completions/lsof +++ b/completions/lsof @@ -18,11 +18,11 @@ _lsof() return ;; -D) - COMPREPLY=( $( compgen -W '? b i r u' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '? b i r u' -- "$cur") ) return ;; -f) - COMPREPLY=( $( compgen -W 'c f g G n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'c f g G n' -- "$cur") ) return ;; -g) @@ -37,15 +37,15 @@ _lsof() ;; -u) # TODO: handle ^foo exclusions, comma separated lists - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; esac if [[ "$cur" == [-+]* ]]; then - COMPREPLY=( $( compgen -W '-h -a -A -b -c +c -C +d -d +D -D +f -f -F -g + COMPREPLY=( $(compgen -W '-h -a -A -b -c +c -C +d -d +D -D +f -f -F -g -i -k -l +L -L +m -m +M -M -n -N -o -O -p -P +r -r -R -s -S -T -t - -u -U -v -V +w -w -x -X -z -Z' -- "$cur" ) ) + -u -U -v -V +w -w -x -X -z -Z' -- "$cur") ) return fi diff --git a/completions/lspci b/completions/lspci index 2f097e6975b..e31a5b570f6 100644 --- a/completions/lspci +++ b/completions/lspci @@ -18,12 +18,12 @@ _lspci() return ;; -*A) - COMPREPLY+=( $( compgen -W '$( $1 -A help | command grep -vF : )' \ + COMPREPLY+=( $(compgen -W '$($1 -A help | command grep -vF :)' \ -- "$cur") ) return ;; -*H) - COMPREPLY+=( $( compgen -W "1 2" -- "$cur" ) ) + COMPREPLY+=( $(compgen -W "1 2" -- "$cur") ) return ;; -*F) @@ -33,7 +33,7 @@ _lspci() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) fi } && complete -F _lspci lspci diff --git a/completions/lsscsi b/completions/lsscsi index b261adcb232..b401c8ab6a0 100644 --- a/completions/lsscsi +++ b/completions/lsscsi @@ -18,7 +18,7 @@ _lsscsi() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && diff --git a/completions/lsusb b/completions/lsusb index 8d28e3dc296..c315abd1770 100644 --- a/completions/lsusb +++ b/completions/lsusb @@ -12,7 +12,7 @@ _lsusb() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) fi } && complete -F _lsusb lsusb diff --git a/completions/lua b/completions/lua index 9413319e22d..775eae20a9c 100644 --- a/completions/lua +++ b/completions/lua @@ -12,7 +12,7 @@ _lua() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W "$( _parse_help "$1" )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(_parse_help "$1")" -- "$cur") ) return fi diff --git a/completions/luac b/completions/luac index 9c91f25a919..15b562ae1f8 100644 --- a/completions/luac +++ b/completions/luac @@ -16,7 +16,7 @@ _luac() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W "$( _parse_help "$1" )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(_parse_help "$1")" -- "$cur") ) return fi diff --git a/completions/luseradd b/completions/luseradd index 50f1637c0b1..2fa336db90f 100644 --- a/completions/luseradd +++ b/completions/luseradd @@ -28,12 +28,12 @@ _luseradd() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi - [[ ${1##*/} == luseradd ]] || COMPREPLY=( $( compgen -u -- "$cur" ) ) + [[ ${1##*/} == luseradd ]] || COMPREPLY=( $(compgen -u -- "$cur") ) } && complete -F _luseradd luseradd lusermod diff --git a/completions/luserdel b/completions/luserdel index 52c0d71e806..ee2b4fdbe76 100644 --- a/completions/luserdel +++ b/completions/luserdel @@ -12,11 +12,11 @@ _luserdel() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) } && complete -F _luserdel luserdel diff --git a/completions/lvm b/completions/lvm index 02bd8e5d7df..266a1e1e386 100644 --- a/completions/lvm +++ b/completions/lvm @@ -8,26 +8,26 @@ _lvm_filedir() _lvm_volumegroups() { - COMPREPLY=( $(compgen -W "$( vgscan 2>/dev/null | \ - command sed -n -e 's|.*Found.*"\(.*\)".*$|\1|p' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(vgscan 2>/dev/null | \ + command sed -n -e 's|.*Found.*"\(.*\)".*$|\1|p' )" -- "$cur") ) } _lvm_physicalvolumes_all() { - COMPREPLY=( $(compgen -W "$( pvscan 2>/dev/null | \ - command sed -n -e 's|^.*PV \([^ ]*\) .*|\1|p' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(pvscan 2>/dev/null | \ + command sed -n -e 's|^.*PV \([^ ]*\) .*|\1|p' )" -- "$cur") ) } _lvm_physicalvolumes() { - COMPREPLY=( $(compgen -W "$( pvscan 2>/dev/null | \ - command sed -n -e 's|^.*PV \(.*\) VG.*$|\1|p' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(pvscan 2>/dev/null | \ + command sed -n -e 's|^.*PV \(.*\) VG.*$|\1|p' )" -- "$cur") ) } _lvm_logicalvolumes() { - COMPREPLY=( $(compgen -W "$( lvscan 2>/dev/null | \ - command sed -n -e "s|^.*'\(.*\)'.*$|\1|p" )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(lvscan 2>/dev/null | \ + command sed -n -e "s|^.*'\(.*\)'.*$|\1|p" )" -- "$cur") ) if [[ $cur == /dev/mapper/* ]]; then _filedir local i @@ -39,12 +39,12 @@ _lvm_logicalvolumes() _lvm_units() { - COMPREPLY=( $( compgen -W 'h s b k m g t H K M G T' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'h s b k m g t H K M G T' -- "$cur") ) } _lvm_sizes() { - COMPREPLY=( $( compgen -W 'k K m M g G t T' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'k K m M g G t T' -- "$cur") ) } # @param $1 glob matching args known to take an argument @@ -70,7 +70,7 @@ _lvmdiskscan() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) fi } && complete -F _lvmdiskscan lvmdiskscan @@ -81,9 +81,9 @@ _pvscan() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--debug --exported --novolumegroup --help + COMPREPLY=( $(compgen -W '--debug --exported --novolumegroup --help --ignorelockingfailure --partial --short --uuid --verbose - --version' -- "$cur" ) ) + --version' -- "$cur") ) fi } && complete -F _pvscan pvscan @@ -95,8 +95,8 @@ _pvs() case $prev in --options|--sort|-!(-*)[oO]) - COMPREPLY=( $( compgen -W 'pv_fmt pv_uuid pv_size pv_free pv_used - pv_name pv_attr pv_pe_count pv_pe_alloc_count' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'pv_fmt pv_uuid pv_size pv_free pv_used + pv_name pv_attr pv_pe_count pv_pe_alloc_count' -- "$cur") ) return ;; --units) @@ -106,7 +106,7 @@ _pvs() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_physicalvolumes_all fi @@ -126,7 +126,7 @@ _pvdisplay() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_physicalvolumes_all fi @@ -140,13 +140,13 @@ _pvchange() case $prev in --autobackup|--allocatable|-!(-*)[Ax]) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_physicalvolumes_all fi @@ -164,11 +164,11 @@ _pvcreate() return ;; --metadatatype|-!(-*)M) - COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '1 2' -- "$cur") ) return ;; --metadatacopies) - COMPREPLY=( $( compgen -W '0 1 2' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '0 1 2' -- "$cur") ) return ;; --metadatasize|--setphysicalvolumesize) @@ -178,7 +178,7 @@ _pvcreate() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_filedir fi @@ -192,7 +192,7 @@ _pvmove() case $prev in --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; --name|-!(-*)n) @@ -201,9 +201,9 @@ _pvmove() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--abort --autobackup --background --debug + COMPREPLY=( $(compgen -W '--abort --autobackup --background --debug --force --help --interval --test --verbose --version --name' \ - -- "$cur" ) ) + -- "$cur") ) else _lvm_physicalvolumes fi @@ -216,7 +216,7 @@ _pvremove() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_physicalvolumes_all fi @@ -229,7 +229,7 @@ _vgscan() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) fi } && complete -F _vgscan vgscan @@ -241,10 +241,10 @@ _vgs() case $prev in --options|--sort|-!(-*)[oO]) - COMPREPLY=( $( compgen -W 'vg_fmt vg_uuid vg_name vg_attr vg_size + COMPREPLY=( $(compgen -W 'vg_fmt vg_uuid vg_name vg_attr vg_size vg_free vg_sysid vg_extent_size vg_extent_count vg_free_count max_lv max_pv pv_count lv_count snap_count vg_seqno' \ - -- "$cur" ) ) + -- "$cur") ) return ;; --units) @@ -254,7 +254,7 @@ _vgs() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_volumegroups fi @@ -274,7 +274,7 @@ _vgdisplay() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_volumegroups fi @@ -288,16 +288,16 @@ _vgchange() case $prev in --available|--autobackup|--resizeable|-!(-*)[aAx]) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--autobackup --alloc --partial --debug + COMPREPLY=( $(compgen -W '--autobackup --alloc --partial --debug --help --ignorelockingfailure --test --uuid --verbose --version --available --resizeable --logicalvolume --addtag --deltag' \ - -- "$cur" ) ) + -- "$cur") ) else _lvm_volumegroups fi @@ -311,11 +311,11 @@ _vgcreate() case $prev in --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; --metadatatype|-!(-*)M) - COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '1 2' -- "$cur") ) return ;; --physicalextentsize|-!(-*)s) @@ -325,9 +325,9 @@ _vgcreate() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--autobackup --addtag --alloc --debug --help + COMPREPLY=( $(compgen -W '--autobackup --addtag --alloc --debug --help --maxlogicalvolumes --metadatatype --maxphysicalvolumes - --physicalextentsize --test --verbose --version' -- "$cur" ) ) + --physicalextentsize --test --verbose --version' -- "$cur") ) else local args _lvm_count_args '@(-A|--autobackup|-M|--metadatatype|-s|--physicalextentsize)' @@ -346,7 +346,7 @@ _vgremove() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_volumegroups fi @@ -360,13 +360,13 @@ _vgrename() case $prev in --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_volumegroups fi @@ -380,13 +380,13 @@ _vgreduce() case $prev in --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else local args @@ -407,7 +407,7 @@ _vgextend() case $prev in --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; --size|-!(-*)L) @@ -417,7 +417,7 @@ _vgextend() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else local args _lvm_count_args '@(-A|--autobackup|-L|--size)' @@ -436,7 +436,7 @@ _vgport() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_volumegroups fi @@ -449,7 +449,7 @@ _vgck() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_volumegroups fi @@ -463,11 +463,11 @@ _vgconvert() case $prev in --metadatatype|-!(-*)M) - COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '1 2' -- "$cur") ) return ;; --metadatacopies) - COMPREPLY=( $( compgen -W '0 1 2' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '0 1 2' -- "$cur") ) return ;; --metadatasize) @@ -477,7 +477,7 @@ _vgconvert() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_volumegroups fi @@ -497,7 +497,7 @@ _vgcfgbackup() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_volumegroups fi @@ -515,7 +515,7 @@ _vgcfgrestore() return ;; --metadatatype|-!(-*)M) - COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '1 2' -- "$cur") ) return ;; --name|-!(-*)n) @@ -525,7 +525,7 @@ _vgcfgrestore() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_volumegroups fi @@ -539,13 +539,13 @@ _vgmerge() case $prev in --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_volumegroups fi @@ -559,18 +559,18 @@ _vgsplit() case $prev in --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; --metadatatype|-!(-*)M) - COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '1 2' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--autobackup --debug --help --list - --metadatatype --test --verbose --version' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--autobackup --debug --help --list + --metadatatype --test --verbose --version' -- "$cur") ) else local args _lvm_count_args '@(-A|--autobackup|-M|--metadatatype)' @@ -589,7 +589,7 @@ _vgmknodes() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_volumegroups fi @@ -602,7 +602,7 @@ _lvscan() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) fi } && complete -F _lvscan lvscan @@ -614,9 +614,9 @@ _lvs() case $prev in --options|--sort|-!(-*)[oO]) - COMPREPLY=( $( compgen -W 'lv_uuid lv_name lv_attr lv_minor lv_size + COMPREPLY=( $(compgen -W 'lv_uuid lv_name lv_attr lv_minor lv_size seg_count origin snap_percent segtype stripes stripesize - chunksize seg_start seg_size' -- "$cur" ) ) + chunksize seg_start seg_size' -- "$cur") ) return ;; --units) @@ -626,7 +626,7 @@ _lvs() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_logicalvolumes fi @@ -646,7 +646,7 @@ _lvdisplay() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_logicalvolumes fi @@ -660,17 +660,17 @@ _lvchange() case $prev in --available|--autobackup|--contiguous|--persistent|-!(-*)[aACM]) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; --permission|-!(-*)p) - COMPREPLY=( $( compgen -W 'r rw' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'r rw' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_logicalvolumes fi @@ -684,7 +684,7 @@ _lvcreate() case $prev in --autobackup|--contiguous|--persistent|--zero|-!(-*)[ACMZ]) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; --size|-!(-*)L) @@ -692,7 +692,7 @@ _lvcreate() return ;; --permission|-!(-*)p) - COMPREPLY=( $( compgen -W 'r rw' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'r rw' -- "$cur") ) return ;; --name|-!(-*)n) @@ -702,7 +702,7 @@ _lvcreate() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else local args _lvm_count_args '@(-A|-C|-M|-Z|--autobackup|--contiguous|--persistent|--zero|-L|--size|-p|--permission|-n|--name)' @@ -722,13 +722,13 @@ _lvremove() case $prev in --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_logicalvolumes fi @@ -742,13 +742,13 @@ _lvrename() case $prev in --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_logicalvolumes fi @@ -762,7 +762,7 @@ _lvreduce() case $prev in --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; --size|-!(-*)L) @@ -772,7 +772,7 @@ _lvreduce() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_logicalvolumes fi @@ -786,7 +786,7 @@ _lvresize() case $prev in --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; --size|-!(-*)L) @@ -796,7 +796,7 @@ _lvresize() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else local args _lvm_count_args '@(-A|--autobackup|-L|--size)' @@ -816,7 +816,7 @@ _lvextend() case $prev in --autobackup|-!(-*)A) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; --size|-!(-*)L) @@ -826,7 +826,7 @@ _lvextend() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else local args _lvm_count_args '@(-A|--autobackup|-L|--size)' @@ -845,13 +845,13 @@ _lvm() _init_completion || return if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'dumpconfig help lvchange lvcreate lvdisplay + COMPREPLY=( $(compgen -W 'dumpconfig help lvchange lvcreate lvdisplay lvextend lvmchange lvmdiskscan lvmsadc lvmsar lvreduce lvremove lvrename lvresize lvs lvscan pvchange pvcreate pvdata pvdisplay pvmove pvremove pvresize pvs pvscan vgcfgbackup vgcfgrestore vgchange vgck vgconvert vgcreate vgdisplay vgexport vgextend vgimport vgmerge vgmknodes vgreduce vgremove vgrename vgs vgscan - vgsplit version' -- "$cur" ) ) + vgsplit version' -- "$cur") ) else case "${words[1]}" in pvchange|pvcreate|pvdisplay|pvmove|pvremove|pvresize|pvs|pvscan|\ diff --git a/completions/lz4 b/completions/lz4 index 365fef9d6b7..f1490d6cc00 100644 --- a/completions/lz4 +++ b/completions/lz4 @@ -13,9 +13,9 @@ _lz4() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W \ - '$( _parse_help "$1" -h | command sed -e "/#/d" ) -B{4..7} -i{1..9}' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$(_parse_help "$1" -h | command sed -e "/#/d") -B{4..7} -i{1..9}' \ + -- "$cur") ) return fi @@ -46,8 +46,7 @@ _lz4() local IFS=$'\n' compopt -o filenames - COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ - $( compgen -d -- "$cur" ) ) + COMPREPLY=( $(compgen -f -X "$xspec" -- "$cur") $(compgen -d -- "$cur") ) } && complete -F _lz4 lz4 lz4c diff --git a/completions/lzip b/completions/lzip index 6611e26c62e..0f95722cf60 100644 --- a/completions/lzip +++ b/completions/lzip @@ -16,7 +16,7 @@ _lzip() decompress=true ;; --threads-!(-*)n) - COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "{1..$(_ncpus)}" -- "$cur") ) return ;; --output-!(-*)o) @@ -28,8 +28,7 @@ _lzip() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) {-1..-9}' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1") {-1..-9}' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi @@ -41,8 +40,7 @@ _lzip() local IFS=$'\n' compopt -o filenames - COMPREPLY=( $( compgen -f -X "*.lz" -- "$cur" ) \ - $( compgen -d -- "$cur" ) ) + COMPREPLY=( $(compgen -f -X "*.lz" -- "$cur") $(compgen -d -- "$cur") ) } && complete -F _lzip clzip lzip pdlzip plzip diff --git a/completions/lzma b/completions/lzma index 7b1df28f7fe..81a626f5d18 100644 --- a/completions/lzma +++ b/completions/lzma @@ -9,7 +9,7 @@ _lzma() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) -{1..9}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1") -{1..9}' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi @@ -27,8 +27,7 @@ _lzma() _tilde "$cur" || return compopt -o filenames - COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ - $( compgen -d -- "$cur" ) ) + COMPREPLY=( $(compgen -f -X "$xspec" -- "$cur") $(compgen -d -- "$cur") ) } && complete -F _lzma lzma diff --git a/completions/lzop b/completions/lzop index 689a9ae4553..bedc122ee1d 100644 --- a/completions/lzop +++ b/completions/lzop @@ -20,13 +20,13 @@ _lzop() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-1 -2 -3 -4 -5 -6 -7 -8 -9 -P + COMPREPLY=( $(compgen -W '-1 -2 -3 -4 -5 -6 -7 -8 -9 -P --fast --best --decompress --extract --test --list --ls --info --sysinfo --license --help --version --stdout --output --path --force --no-checksum --no-name --name --no-mode --no-time --suffix --keep --delete --crc32 --no-warn --ignore-warn --quiet --verbose --no-stdin --filter --checksum --no-color --mono --color' \ - -- "$cur" ) ) + -- "$cur") ) return fi @@ -52,8 +52,7 @@ _lzop() local IFS=$'\n' compopt -o filenames - COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ - $( compgen -d -- "$cur" ) ) + COMPREPLY=( $(compgen -f -X "$xspec" -- "$cur") $(compgen -d -- "$cur") ) } && complete -F _lzop lzop diff --git a/completions/macof b/completions/macof index dacae2fdc28..c92a3864f61 100644 --- a/completions/macof +++ b/completions/macof @@ -14,7 +14,7 @@ _macof() if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) fi } && diff --git a/completions/mailmanctl b/completions/mailmanctl index 717df7b9a47..dac1c5bf670 100644 --- a/completions/mailmanctl +++ b/completions/mailmanctl @@ -6,10 +6,10 @@ _mailmanctl() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--no-restart --run-as-user - --stale-lock-cleanup --quiet --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--no-restart --run-as-user + --stale-lock-cleanup --quiet --help' -- "$cur") ) else - COMPREPLY=( $( compgen -W 'start stop restart reopen' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'start stop restart reopen' -- "$cur") ) fi } && diff --git a/completions/make b/completions/make index 958aac90e28..d644df6c138 100644 --- a/completions/make +++ b/completions/make @@ -6,7 +6,7 @@ _make_target_extract_script() shift local prefix="$1" - local prefix_pat=$( command sed 's/[][\,.*^$(){}?+|/]/\\&/g' <<<"$prefix" ) + local prefix_pat=$(command sed 's/[][\,.*^$(){}?+|/]/\\&/g' <<<"$prefix") local basename=${prefix##*/} local dirname_len=$(( ${#prefix} - ${#basename} )) @@ -99,14 +99,14 @@ _make() return ;; -!(-*)E) - COMPREPLY=( $( compgen -v -- "$cur" ) ) + COMPREPLY=( $(compgen -v -- "$cur") ) return ;; --eval|-!(-*)[DVx]) return ;; --jobs|-!(-*)j) - COMPREPLY=( $( compgen -W "{1..$(( $(_ncpus)*2 ))}" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "{1..$(( $(_ncpus)*2 ))}" -- "$cur") ) return ;; esac @@ -114,9 +114,9 @@ _make() $split && return if [[ "$cur" == -* ]]; then - local opts="$( _parse_help "$1" )" - [[ $opts ]] || opts="$( _parse_usage "$1" )" - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + local opts="$(_parse_help "$1")" + [[ $opts ]] || opts="$(_parse_usage "$1")" + COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace elif [[ $cur == *=* ]]; then prev=${cur%%=*} @@ -152,11 +152,11 @@ _make() mode=-d # display-only mode fi - local IFS=$' \t\n' script=$( _make_target_extract_script $mode "$cur" ) - COMPREPLY=( $( LC_ALL=C \ + local IFS=$' \t\n' script=$(_make_target_extract_script $mode "$cur") + COMPREPLY=( $(LC_ALL=C \ $1 -npq __BASH_MAKE_COMPLETION__=1 \ "${makef[@]}" "${makef_dir[@]}" .DEFAULT 2>/dev/null | \ - command sed -ne "$script" ) ) + command sed -ne "$script") ) if [[ $mode != -d ]]; then # Completion will occur if there is only one suggestion diff --git a/completions/makepkg b/completions/makepkg index 4ce333b2034..4a81b463043 100644 --- a/completions/makepkg +++ b/completions/makepkg @@ -8,14 +8,14 @@ _makepkg_slackware() case "$prev" in -l|--linkadd|-c|--chown) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W \ - '$1 | sed -e "s/^options://" | _parse_help -' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$1 | sed -e "s/^options://" | _parse_help -' -- "$cur") ) return fi diff --git a/completions/man b/completions/man index 37af0817046..02bd4f704ab 100644 --- a/completions/man +++ b/completions/man @@ -24,11 +24,11 @@ _man() ;; --pager|-!(-*)P) compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=( $(compgen -c -- "$cur") ) return ;; --preprocessor|-!(-*)p) - COMPREPLY=( $( compgen -W 'e p t g r v' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'e p t g r v' -- "$cur") ) return ;; --locale|--systems|--extension|--prompt|--recode|--encoding|\ @@ -40,7 +40,7 @@ _man() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi @@ -51,7 +51,7 @@ _man() return fi - local manpath=$( manpath 2>/dev/null || command man -w 2>/dev/null ) + local manpath=$(manpath 2>/dev/null || command man -w 2>/dev/null) [[ -z $manpath ]] && manpath="/usr/share/man:/usr/local/share/man" # determine manual section to search @@ -67,16 +67,16 @@ _man() manpath="${manpath//://*man$sect/ } ${manpath//://*cat$sect/ }" fi - local IFS=$' \t\n' reset=$( shopt -p failglob ); shopt -u failglob + local IFS=$' \t\n' reset=$(shopt -p failglob); shopt -u failglob # redirect stderr for when path doesn't exist - COMPREPLY=( $( eval command ls "$manpath" 2>/dev/null ) ) + COMPREPLY=( $(eval command ls "$manpath" 2>/dev/null) ) $reset # weed out directory path names and paths to man pages COMPREPLY=( ${COMPREPLY[@]##*/?(:)} ) # strip suffix from man pages COMPREPLY=( ${COMPREPLY[@]%$comprsuffix} ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}") ) if [[ "$prev" != $mansect ]]; then # File based completion for the rest, prepending ./ if needed diff --git a/completions/mc b/completions/mc index 74d7e5f55e7..8e96dd97153 100644 --- a/completions/mc +++ b/completions/mc @@ -18,8 +18,7 @@ _mc() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" --help-all)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else _filedir -d diff --git a/completions/mcrypt b/completions/mcrypt index 6d6a898f631..f6094a22fb0 100644 --- a/completions/mcrypt +++ b/completions/mcrypt @@ -8,27 +8,27 @@ _mcrypt() case $prev in -g|--openpgp-z) - COMPREPLY=( $( compgen -W '{0..9}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..9}' -- "$cur") ) return ;; -o|--keymode) - COMPREPLY=( $( compgen -W '$( $1 --list-keymodes \ - 2>/dev/null )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$($1 --list-keymodes 2>/dev/null )' \ + -- "$cur") ) return ;; -m|--mode) - COMPREPLY=( $( compgen -W "$( $1 --list 2>/dev/null | \ - cut -d: -f2- )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 --list 2>/dev/null | cut -d: -f2-)" \ + -- "$cur") ) return ;; -a|--algorithm) - COMPREPLY=( $( compgen -W "$( $1 --list 2>/dev/null | \ - awk '{print $1}' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 --list 2>/dev/null | \ + awk '{print $1}')" -- "$cur") ) return ;; -h|--hash) - COMPREPLY=( $( compgen -W '$( $1 --list-hash 2>/dev/null | \ - command sed -e 1d )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$($1 --list-hash 2>/dev/null | \ + command sed -e 1d)' -- "$cur") ) return ;; -k|-s|--key|--keysize) @@ -45,7 +45,7 @@ _mcrypt() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) elif [[ ${words[0]} == mdecrypt ]]; then _filedir nc else diff --git a/completions/mdadm b/completions/mdadm index 7c7c467b16b..0986f5af977 100644 --- a/completions/mdadm +++ b/completions/mdadm @@ -19,13 +19,13 @@ _mdadm_raid_level() case $mode in create) - COMPREPLY=( $( compgen -W 'linear raid0 0 stripe raid1 1 mirror + COMPREPLY=( $(compgen -W 'linear raid0 0 stripe raid1 1 mirror raid4 4 raid5 5 raid6 6 raid10 10 multipath mp faulty' \ - -- "$cur" ) ) + -- "$cur") ) ;; build) - COMPREPLY=( $( compgen -W 'linear stripe raid0 0 raid1 multipath mp - faulty' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'linear stripe raid0 0 raid1 multipath mp + faulty' -- "$cur") ) ;; esac } @@ -42,29 +42,29 @@ _mdadm_raid_layout() case $level in raid5) - COMPREPLY=( $( compgen -W 'left-asymmetric left-symmetric - right-asymmetric right-symmetric la ra ls rs' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'left-asymmetric left-symmetric + right-asymmetric right-symmetric la ra ls rs' -- "$cur") ) ;; raid10) - COMPREPLY=( $( compgen -W 'n o p' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'n o p' -- "$cur") ) ;; faulty) - COMPREPLY=( $( compgen -W 'write-transient wt read-transient rt + COMPREPLY=( $(compgen -W 'write-transient wt read-transient rt write-persistent wp read-persistent rp write-all read-fixable - rf clear flush none' -- "$cur" ) ) + rf clear flush none' -- "$cur") ) ;; esac } _mdadm_auto_flag() { - COMPREPLY=( $( compgen -W 'no yes md mdp part p' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'no yes md mdp part p' -- "$cur") ) } _mdadm_update_flag() { - COMPREPLY=( $( compgen -W 'sparc2.2 summaries uuid name homehost resync - byteorder super-minor' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'sparc2.2 summaries uuid name homehost resync + byteorder super-minor' -- "$cur") ) } @@ -103,39 +103,39 @@ _mdadm() if [[ "$cur" == -* ]]; then if [[ $cword -eq 1 ]] ; then - COMPREPLY=( $( compgen -W "$options --assemble --build --create - --monitor --grow" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$options --assemble --build --create + --monitor --grow" -- "$cur") ) else case ${words[cword-1]} in --assemble|-!(-*)A*) - COMPREPLY=( $( compgen -W "$options --uuid= --super-minor= + COMPREPLY=( $(compgen -W "$options --uuid= --super-minor= --name= --force --run --no-degraded --auto= --bitmap= --backup-file= --update= --auto-update-homehost" \ - -- "$cur" ) ) + -- "$cur") ) ;; --build|--create|--grow|-!(-*)[BCG]*) - COMPREPLY=( $( compgen -W "$options --raid-devices= + COMPREPLY=( $(compgen -W "$options --raid-devices= --spare-devices= --size= --chunk= --rounding= --level= --layout= --parity= --bitmap= --bitmap-chunk= --write-mostly --write-behind= --assume-clean --backup-file= --name= --run --force --auto=" \ - -- "$cur" ) ) + -- "$cur") ) ;; --follow|--monitor|-!(-*)F) - COMPREPLY=( $( compgen -W "$options --mail --program + COMPREPLY=( $(compgen -W "$options --mail --program --alert --syslog --delay --daemonise --pid-file - --oneshot --test" -- "$cur" ) ) + --oneshot --test" -- "$cur") ) ;; /dev/*|--add|--fail|--remove) - COMPREPLY=( $( compgen -W "$options --add --re-add - --remove --fail --set-faulty" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$options --add --re-add + --remove --fail --set-faulty" -- "$cur") ) ;; *) - COMPREPLY=( $( compgen -W "$options --query --detail + COMPREPLY=( $(compgen -W "$options --query --detail --examine --sparc2.2 --examine-bitmap --run --stop --readonly --readwrite --zero-superblock --test" \ - -- "$cur" ) ) + -- "$cur") ) ;; esac fi diff --git a/completions/mdtool b/completions/mdtool index b4f36e563f1..67a3c7c3dd5 100644 --- a/completions/mdtool +++ b/completions/mdtool @@ -16,16 +16,16 @@ _mdtool() if [[ -n "$command" ]]; then case $command in "build") - COMPREPLY=( $( compgen -W '--f --buildfile --p --project' \ - -S":" -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--f --buildfile --p --project' \ + -S":" -- "$cur") ) # TODO: This does not work :( #if [[ "$prev" == *: ]]; then # case $prev in # @(--p:|--project:)) - # COMPREPLY=( $( compgen -f -G "*.mdp" -- "$cur" ) ) + # COMPREPLY=( $(compgen -f -G "*.mdp" -- "$cur") ) # ;; # @(--f:|--buildfile:)) - # COMPREPLY=( $( compgen -f -G "*.mdp" -G "*.mds" -- "$cur" ) ) + # COMPREPLY=( $(compgen -f -G "*.mdp" -G "*.mds" -- "$cur") ) # ;; # esac #fi @@ -33,27 +33,27 @@ _mdtool() ;; "generate-makefiles") compopt -o filenames - COMPREPLY=( $( compgen -o filenames -G"*.mds" -- "$cur" ) ) + COMPREPLY=( $(compgen -o filenames -G"*.mds" -- "$cur") ) if [[ "$prev" == *mds ]]; then - COMPREPLY=( $( compgen -W '--simple-makefiles --s --d:' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--simple-makefiles --s --d:' \ + -- "$cur") ) fi return ;; "setup") # TODO: at least return filenames after these options. - COMPREPLY=( $( compgen -W 'install i uninstall u check-install + COMPREPLY=( $(compgen -W 'install i uninstall u check-install ci update up list l list-av la list-update lu rep-add ra rep-remove rr rep-update ru rep-list rl reg-update reg-build rgu info rep-build rb pack p help h dump-file' \ - -- "$cur" ) ) + -- "$cur") ) return ;; esac fi - COMPREPLY=( $( compgen -W 'gsetup build dbgen project-export - generate-makefiles gettext-update setup -q' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'gsetup build dbgen project-export + generate-makefiles gettext-update setup -q' -- "$cur") ) } && complete -F _mdtool mdtool diff --git a/completions/medusa b/completions/medusa index a9f099c112b..f0ca7022faf 100644 --- a/completions/medusa +++ b/completions/medusa @@ -15,14 +15,14 @@ _medusa() return ;; -*M) - COMPREPLY=( $( compgen -W "$($1 -d | awk '/^ +\+/ {print $2}' \ - | command sed -e 's/\.mod$//')" ) ) + COMPREPLY=( $(compgen -W "$($1 -d | awk '/^ +\+/ {print $2}' \ + | command sed -e 's/\.mod$//')") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) fi } && complete -F _medusa medusa diff --git a/completions/mii-diag b/completions/mii-diag index 87f5d8d5989..b62174e7246 100644 --- a/completions/mii-diag +++ b/completions/mii-diag @@ -7,8 +7,8 @@ _mii_diag() case $prev in -F|-A|--advertise|--fixed-speed) - COMPREPLY=( $( compgen -W '100baseT4 100baseTx 100baseTx-FD - 100baseTx-HD 10baseT 10baseT-FD 10baseT-HD' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '100baseT4 100baseTx 100baseTx-FD + 100baseTx-HD 10baseT 10baseT-FD 10baseT-HD' -- "$cur") ) return ;; esac @@ -16,7 +16,7 @@ _mii_diag() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) else _available_interfaces -a fi diff --git a/completions/mii-tool b/completions/mii-tool index a87211b3ac2..9c88ba14aff 100644 --- a/completions/mii-tool +++ b/completions/mii-tool @@ -7,13 +7,13 @@ _mii_tool() case $prev in --force|-!(-*)F) - COMPREPLY=( $( compgen -W '100baseTx-FD 100baseTx-HD 10baseT-FD - 10baseT-HD' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '100baseTx-FD 100baseTx-HD 10baseT-FD + 10baseT-HD' -- "$cur") ) return ;; --advertise|-!(-*)A) - COMPREPLY=( $( compgen -W '100baseT4 100baseTx-FD 100baseTx-HD - 10baseT-FD 10baseT-HD' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '100baseT4 100baseTx-FD 100baseTx-HD + 10baseT-FD 10baseT-HD' -- "$cur") ) return ;; esac @@ -21,7 +21,7 @@ _mii_tool() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else _available_interfaces -a diff --git a/completions/minicom b/completions/minicom index d85317fdb9d..2e98229ad13 100644 --- a/completions/minicom +++ b/completions/minicom @@ -7,7 +7,7 @@ _minicom() case $prev in --attrib|--color|-!(-*)[ac]) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on off' -- "$cur") ) return ;; --script|--capturefile|-!(-*)[SC]) @@ -15,9 +15,9 @@ _minicom() return ;; --ptty|-!(-*)p) - COMPREPLY=( $( printf '%s\n' /dev/tty* ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]} ${COMPREPLY[@]#/dev/}' \ - -- "$cur" ) ) + COMPREPLY=( $(printf '%s\n' /dev/tty*) ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]} ${COMPREPLY[@]#/dev/}' \ + -- "$cur") ) return ;; esac @@ -25,15 +25,15 @@ _minicom() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi COMPREPLY=( - $( printf '%s\n' /etc/minirc.* /etc/minicom/minirc.* ~/.minirc.* \ + $(printf '%s\n' /etc/minirc.* /etc/minicom/minirc.* ~/.minirc.* \ | command sed -e '/\*$/d' -e 's/^.*minirc\.//' \ - | command grep "^${cur}" ) ) + | command grep "^${cur}") ) } && complete -F _minicom -o default minicom diff --git a/completions/mkinitrd b/completions/mkinitrd index f0efb294574..2e131227417 100644 --- a/completions/mkinitrd +++ b/completions/mkinitrd @@ -23,12 +23,12 @@ _mkinitrd() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version --help -v -f --preload \ + COMPREPLY=( $(compgen -W '--version --help -v -f --preload \ --force-scsi-probe --omit-scsi-modules \ --omit-ide-modules --image-version --force-raid-probe \ --omit-raid-modules --with= --force-lvm-probe \ --omit-lvm-modules --builtin --omit-dmraid --net-dev \ - --fstab --nocompress --dsdt --bootchart' -- "$cur" ) ) + --fstab --nocompress --dsdt --bootchart' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else local args diff --git a/completions/mktemp b/completions/mktemp index 6ee6c23f193..96c7a1184cd 100644 --- a/completions/mktemp +++ b/completions/mktemp @@ -18,9 +18,9 @@ _mktemp() $split && return if [[ "$cur" == -* ]]; then - local opts=$( _parse_help "$1" ) + local opts=$(_parse_help "$1") [[ $opts ]] || opts="-d -u -q -p -t" # non-GNU fallback - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && diff --git a/completions/mmsitepass b/completions/mmsitepass index db1cbf74520..fc938d8209b 100644 --- a/completions/mmsitepass +++ b/completions/mmsitepass @@ -6,7 +6,7 @@ _mmsitepass() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--listcreator --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--listcreator --help' -- "$cur") ) fi } && diff --git a/completions/modinfo b/completions/modinfo index a1f62e4d38f..6aa5e662d4e 100644 --- a/completions/modinfo +++ b/completions/modinfo @@ -7,9 +7,9 @@ _modinfo() case "$prev" in --field|-!(-*)F) - COMPREPLY=( $( compgen -W 'alias author depends description + COMPREPLY=( $(compgen -W 'alias author depends description filename firmware license parm srcversion staging vermagic - version' -- "${cur,,}" ) ) + version' -- "${cur,,}") ) return ;; --set-version|-!(-*)k) @@ -21,9 +21,9 @@ _modinfo() $split && return if [[ "$cur" == -* ]]; then - local opts=$( _parse_help "$1" ) - [[ $opts ]] || opts=$( _parse_usage "$1" ) - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + local opts=$(_parse_help "$1") + [[ $opts ]] || opts=$(_parse_usage "$1") + COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/modprobe b/completions/modprobe index 7d6924222d9..985a8fc5b8e 100644 --- a/completions/modprobe +++ b/completions/modprobe @@ -26,15 +26,15 @@ _modprobe() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) if [[ ! $COMPREPLY ]]; then - COMPREPLY=( $( compgen -W '-a --all -b --use-blacklist -C --config + COMPREPLY=( $(compgen -W '-a --all -b --use-blacklist -C --config -c --showconfig --dump-modversions -d --dirname --first-time --force-vermagic --force-modversion -f --force -i --ignore-install --ignore-remove -l --list -n --dry-run -q --quiet -R --resolve-alias -r --remove -S --set-version --show-depends -s --syslog -t --type -V --version -v - --verbose' -- "$cur" ) ) + --verbose' -- "$cur") ) fi [[ $COMPREPLY == *= ]] && compopt -o nospace return @@ -90,12 +90,12 @@ _modprobe() | command grep -q "^$prev:.*(bool)"; then local choices="on off" [[ $cur ]] && choices="1 0 y Y n N on off" - COMPREPLY=( $( compgen -W "$choices" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$choices" -- "$cur") ) fi else - COMPREPLY=( $( compgen -S = -W "$( PATH="$PATH:/sbin" \ + COMPREPLY=( $(compgen -S = -W "$(PATH="$PATH:/sbin" \ modinfo -p "$module" 2>/dev/null | \ - awk -F: '!/^[ \t]/ { print $1 }' )" -- "$cur" ) ) + awk -F: '!/^[ \t]/ { print $1 }')" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi else diff --git a/completions/monodevelop b/completions/monodevelop index 13685dfb506..4aa213b7b94 100644 --- a/completions/monodevelop +++ b/completions/monodevelop @@ -8,7 +8,7 @@ _monodevelop() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else _filedir diff --git a/completions/mplayer b/completions/mplayer index 24ae787fef9..f2d3532fdc8 100644 --- a/completions/mplayer +++ b/completions/mplayer @@ -3,9 +3,9 @@ _mplayer_options_list() { cur=${cur%\\} - COMPREPLY=( $( compgen -W "$( $1 -noconfig all $2 help 2>/dev/null | \ + COMPREPLY=( $(compgen -W "$($1 -noconfig all $2 help 2>/dev/null | \ command sed -e '/^Available/,/^$/!d' -e '/^Available/d' | awk '{print $1}' | \ - command sed -e 's/:$//' -e 's/^'${2#-}'$//' -e 's/<.*//' )" -- "$cur" ) ) + command sed -e 's/:$//' -e 's/^'${2#-}'$//' -e 's/<.*//')" -- "$cur") ) } _mplayer() @@ -36,7 +36,7 @@ _mplayer() _filedir ttf fi local IFS=$'\n' - COMPREPLY+=( $( compgen -W '$( fc-list 2>/dev/null )' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W '$(fc-list 2>/dev/null)' -- "$cur") ) return ;; -sub|-sub-file) @@ -46,22 +46,22 @@ _mplayer() -vobsub) _filedir '@(idx|ifo|sub)' local IFS=$'\n' - COMPREPLY=( $( for i in "${COMPREPLY[@]}"; do + COMPREPLY=( $(for i in "${COMPREPLY[@]}"; do if [[ -f $i && -r $i ]]; then printf '%s\n' ${i%.*} else printf '%s\n' $i fi - done ) ) + done) ) return ;; -subcp|-msgcharset) local cp - cp=( $( iconv --list 2>/dev/null | command sed -e "s@//@@;" 2>/dev/null ) ) + cp=( $(iconv --list 2>/dev/null | command sed -e "s@//@@;" 2>/dev/null) ) if [[ "$cur" == "${cur,,}" ]]; then - COMPREPLY=( $( compgen -W '${cp[@],,}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${cp[@],,}' -- "$cur") ) else - COMPREPLY=( $( compgen -W '${cp[@]^^}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${cp[@]^^}' -- "$cur") ) fi return ;; @@ -86,7 +86,7 @@ _mplayer() local IFS=$'\n' for i in ~/.mplayer/skins ${dirs[@]}; do if [[ -d $i && -r $i ]]; then - for j in $( compgen -d -- $i/$cur ); do + for j in $(compgen -d -- $i/$cur); do COMPREPLY[$k]=${j#$i/} k=$((++k)) done @@ -138,23 +138,23 @@ _mplayer() return ;; -channels) - COMPREPLY=( $( compgen -W '2 4 6 8' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '2 4 6 8' -- "$cur") ) return ;; -aspect|-monitoraspect) - COMPREPLY=( $( compgen -W '1:1 3:2 4:3 5:4 14:9 14:10 16:9 16:10 - 2.35:1' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '1:1 3:2 4:3 5:4 14:9 14:10 16:9 16:10 + 2.35:1' -- "$cur") ) __ltrim_colon_completions "$cur" return ;; -lavdopts) - COMPREPLY=( $( compgen -W 'bitexact bug= debug= ec= er= fast gray + COMPREPLY=( $(compgen -W 'bitexact bug= debug= ec= er= fast gray idct= lowres= sb= st= skiploopfilter= skipidct= skipframe= - threads= vismv= vstats' -- "$cur" ) ) + threads= vismv= vstats' -- "$cur") ) return ;; -lavcopts) - COMPREPLY=( $( compgen -W 'vcodec= vqmin= vqscale= vqmax= mbqmin= + COMPREPLY=( $(compgen -W 'vcodec= vqmin= vqscale= vqmax= mbqmin= mbqmax= vqdiff= vmax_b_frames= vme= vhq v4mv keyint= vb_strategy= vpass= aspect= vbitrate= vratetol= vrc_maxrate= vrc_minrate= vrc_buf_size= vb_qfactor= vi_qfactor= vb_qoffset= @@ -163,100 +163,99 @@ _mplayer() vpsize= gray vfdct= idct= lumi_mask= dark_mask= tcplx_mask= scplx_mask= naq ildct format= pred qpel precmp= cmp= subcmp= predia= dia= trell last_pred= preme= subq= psnr mpeg_quant aic - umv' -- "$cur" ) ) + umv' -- "$cur") ) return ;; -ssf) - COMPREPLY=( $( compgen -W 'lgb= cgb= ls= cs= chs= cvs=' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'lgb= cgb= ls= cs= chs= cvs=' -- "$cur") ) return ;; -jpeg) - COMPREPLY=( $( compgen -W 'noprogressive progressive nobaseline - baseline optimize= smooth= quality= outdir=' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'noprogressive progressive nobaseline + baseline optimize= smooth= quality= outdir=' -- "$cur") ) return ;; -xvidopts) - COMPREPLY=( $( compgen -W 'dr2 nodr2' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'dr2 nodr2' -- "$cur") ) return ;; -xvidencopts) - COMPREPLY=( $( compgen -W 'pass= bitrate= fixed_quant= me_quality= + COMPREPLY=( $(compgen -W 'pass= bitrate= fixed_quant= me_quality= 4mv rc_reaction_delay_factor= rc_averaging_period= rc_buffer= quant_range= min_key_interval= max_key_interval= mpeg_quant mod_quant lumi_mask hintedme hintfile debug keyframe_boost= - kfthreshold= kfreduction=' -- "$cur" ) ) + kfthreshold= kfreduction=' -- "$cur") ) return ;; -divx4opts) - COMPREPLY=( $( compgen -W 'br= key= deinterlace q= min_quant= + COMPREPLY=( $(compgen -W 'br= key= deinterlace q= min_quant= max_quant= rc_period= rc_reaction_period= crispness= - rc_reaction_ratio= pass= vbrpass= help' -- "$cur" ) ) + rc_reaction_ratio= pass= vbrpass= help' -- "$cur") ) return ;; -info) - COMPREPLY=( $( compgen -W 'name= artist= genre= subject= - copyright= srcform= comment= help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'name= artist= genre= subject= + copyright= srcform= comment= help' -- "$cur") ) return ;; -lameopts) - COMPREPLY=( $( compgen -W 'vbr= abr cbr br= q= aq= ratio= vol= - mode= padding= fast preset= help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'vbr= abr cbr br= q= aq= ratio= vol= + mode= padding= fast preset= help' -- "$cur") ) return ;; -rawaudio) - COMPREPLY=( $( compgen -W 'on channels= rate= samplesize= format=' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on channels= rate= samplesize= format=' \ + -- "$cur") ) return ;; -rawvideo) - COMPREPLY=( $( compgen -W 'on fps= sqcif qcif cif 4cif pal ntsc w= - h= y420 yv12 yuy2 y8 format= size=' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on fps= sqcif qcif cif 4cif pal ntsc w= + h= y420 yv12 yuy2 y8 format= size=' -- "$cur") ) return ;; -aop) - COMPREPLY=( $( compgen -W 'list= delay= format= fout= volume= mul= - softclip' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'list= delay= format= fout= volume= mul= + softclip' -- "$cur") ) return ;; -dxr2) - COMPREPLY=( $( compgen -W 'ar-mode= iec958-encoded iec958-decoded + COMPREPLY=( $(compgen -W 'ar-mode= iec958-encoded iec958-decoded mute ucode= 75ire bw color interlaced macrovision= norm= square-pixel ccir601-pixel cr-left= cr-right= cr-top= cr-bot= ck-rmin= ck-gmin= ck-bmin= ck-rmax= ck-gmax= ck-bmax= ck-r= ck-g= ck-b= ignore-cache= ol-osd= olh-cor= olw-cor= olx-cor= - oly-cor= overlay overlay-ratio= update-cache' -- "$cur" ) ) + oly-cor= overlay overlay-ratio= update-cache' -- "$cur") ) return ;; -tv) - COMPREPLY=( $( compgen -W 'on noaudio driver= device= input= freq= + COMPREPLY=( $(compgen -W 'on noaudio driver= device= input= freq= outfmt= width= height= buffersize= norm= channel= chanlist= audiorate= forceaudio alsa amode= forcechan= adevice= audioid= volume= bass= treble= balance= fps= channels= immediatemode=' \ - -- "$cur" ) ) + -- "$cur") ) return ;; -mf) - COMPREPLY=( $( compgen -W 'on w= h= fps= type=' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on w= h= fps= type=' -- "$cur") ) return ;; -cdda) - COMPREPLY=( $( compgen -W 'speed= paranoia= generic-dev= + COMPREPLY=( $(compgen -W 'speed= paranoia= generic-dev= sector-size= overlap= toc-bias toc-offset= skip noskip' \ - -- "$cur" ) ) + -- "$cur") ) return ;; -input) - COMPREPLY=( $( compgen -W 'conf= ar-delay ar-rate keylist cmdlist - js-dev file' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'conf= ar-delay ar-rate keylist cmdlist + js-dev file' -- "$cur") ) return ;; -af-adv) - COMPREPLY=( $( compgen -W 'force= list=' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'force= list=' -- "$cur") ) return ;; -noconfig) - COMPREPLY=( $( compgen -W 'all gui system user' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'all gui system user' -- "$cur") ) return ;; -*) @@ -274,10 +273,10 @@ _mplayer() case $cur in -*) - COMPREPLY=( $( compgen -W '$( $cmd -noconfig all -list-options 2>/dev/null | \ + COMPREPLY=( $(compgen -W '$($cmd -noconfig all -list-options 2>/dev/null | \ command sed -ne '1,/^[[:space:]]*Name/d' \ -e "s/^[[:space:]]*/-/" -e "s/[[:space:]:].*//" \ - -e "/^-\(Total\|.*\*\)\{0,1\}$/!p" )' -- "$cur" ) ) + -e "/^-\(Total\|.*\*\)\{0,1\}$/!p")' -- "$cur") ) ;; *) _filedir '@(m?(j)p?(e)g|M?(J)P?(E)G|wm[av]|WM[AV]|avi|AVI|asf|ASF|vob|VOB|bin|BIN|dat|DAT|vcd|VCD|ps|PS|pes|PES|fl[iv]|FL[IV]|fxm|FXM|viv|VIV|rm?(j)|RM?(J)|ra?(m)|RA?(M)|yuv|YUV|mov|MOV|qt|QT|mp[234]|MP[234]|m?(p)4[av]|M?(P)4[AV]|og[gmavx]|OG[GMAVX]|w?(a)v|W?(A)V|dump|DUMP|mk[av]|MK[AV]|aac|AAC|m2v|M2V|dv|DV|rmvb|RMVB|mid|MID|t[ps]|T[PS]|3g[p2]|3gpp?(2)|mpc|MPC|flac|FLAC|vro|VRO|divx|DIVX|aif?(f)|AIF?(F)|m2t?(s)|M2T?(S)|mts|MTS|vdr|VDR|xvid|XVID|ape|APE|gif|GIF|nut|NUT|bik|BIK|web[am]|WEB[AM]|amr|AMR|awb|AWB|iso|ISO|opus|OPUS|m[eo]d|M[EO]D|xm|XM|it|IT|s[t3]m|S[T3]M|mtm|MTM|w64|W64)?(.@(crdownload|part))' diff --git a/completions/mr b/completions/mr index 8693b38124d..15f634a3960 100644 --- a/completions/mr +++ b/completions/mr @@ -37,18 +37,18 @@ _mr() { ;; clean) if [[ "${cur}" == -* ]]; then - COMPREPLY=( $( compgen -W '-f' -- "${cur}" ) ) + COMPREPLY=( $(compgen -W '-f' -- "${cur}") ) fi return ;; commit|ci|record) if [[ "${cur}" == -* ]]; then - COMPREPLY=( $( compgen -W '-m' -- "${cur}" ) ) + COMPREPLY=( $(compgen -W '-m' -- "${cur}") ) fi return ;; run) - COMPREPLY=( $( compgen -c -- "${cur}" ) ) + COMPREPLY=( $(compgen -c -- "${cur}") ) return ;; *) @@ -76,9 +76,9 @@ _mr() { options="${options//-[a-z]$'\n'/}" # Remove deprecated options. options="${options//--path/}" - COMPREPLY=( $( compgen -W "${options}" -- "${cur}" ) ) + COMPREPLY=( $(compgen -W "${options}" -- "${cur}") ) else - COMPREPLY=( $( compgen -W "${commands}" -- "${cur}" ) ) + COMPREPLY=( $(compgen -W "${commands}" -- "${cur}") ) fi } && complete -F _mr mr diff --git a/completions/msynctool b/completions/msynctool index 3eae1dfad9e..c3600ce7513 100644 --- a/completions/msynctool +++ b/completions/msynctool @@ -7,35 +7,35 @@ _msynctool() case $words in --configure) - COMPREPLY=( $( compgen -W "$($1 --showgroup \ + COMPREPLY=( $(compgen -W "$($1 --showgroup \ $prev | awk '/^Member/ {print $2}' | command sed \ - -e 's/:$//' )" -- "$cur" ) ) + -e 's/:$//')" -- "$cur") ) return ;; --addmember) - COMPREPLY=( $( compgen -W '$($1 --listplugins \ - | command sed -e '1d' )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$($1 --listplugins \ + | command sed -e '1d')' -- "$cur") ) return ;; esac case $prev in --configure|--addgroup|--delgroup|--showgroup|--sync|--addmember) - COMPREPLY=( $( compgen -W '$($1 --listgroups \ - | command sed -e '1d' )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$($1 --listgroups \ + | command sed -e '1d')' -- "$cur") ) return ;; --showformats|--filter-objtype|--slow-sync) - COMPREPLY=( $( compgen -W '$($1 --listobjects \ - | command sed -e '1d' )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$($1 --listobjects \ + | command sed -e '1d')' -- "$cur") ) return ;; esac - COMPREPLY=( $( compgen -W '--listgroups --listplugins --listobjects + COMPREPLY=( $(compgen -W '--listgroups --listplugins --listobjects --showformats --showgroup --sync --filter-objtype --slow-sync --wait --multi --addgroup --delgroup --addmember --configure --manual - --configdir --conflict' -- "$cur" ) ) + --configdir --conflict' -- "$cur") ) } && complete -F _msynctool msynctool diff --git a/completions/mtx b/completions/mtx index c52c6173e65..9266687c441 100644 --- a/completions/mtx +++ b/completions/mtx @@ -23,10 +23,10 @@ _mtx() if [[ $cword -gt 1 ]]; then case $prev in load) - COMPREPLY=( $( compgen -W "$tapes" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$tapes" -- "$cur") ) ;; unload|first|last|next) - COMPREPLY=( $( compgen -W "$drives" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$drives" -- "$cur") ) ;; -f) true @@ -36,7 +36,7 @@ _mtx() ;; esac else - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$options" -- "$cur") ) fi } && complete -F _mtx mtx diff --git a/completions/munin-node-configure b/completions/munin-node-configure index a202172779b..1d564d3f403 100644 --- a/completions/munin-node-configure +++ b/completions/munin-node-configure @@ -19,13 +19,13 @@ _munin_node_configure() return ;; --snmpversion) - COMPREPLY=( $( compgen -W '1 2c 3' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '1 2c 3' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) fi } && complete -F _munin_node_configure munin-node-configure diff --git a/completions/munin-run b/completions/munin-run index 72228522a3b..6855e02d6b1 100644 --- a/completions/munin-run +++ b/completions/munin-run @@ -17,10 +17,10 @@ _munin_run() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) else - COMPREPLY=( $( compgen -W \ - '$( command ls /etc/munin/plugins 2>/dev/null )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$(command ls /etc/munin/plugins 2>/dev/null)' -- "$cur") ) fi } && complete -F _munin_run munin-run diff --git a/completions/munin-update b/completions/munin-update index ef8bf5b52cb..ac770a6b70d 100644 --- a/completions/munin-update +++ b/completions/munin-update @@ -17,9 +17,9 @@ _munin_update() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--force-root --noforce-root --service --host + COMPREPLY=( $(compgen -W '--force-root --noforce-root --service --host --config --help --debug --nodebug --fork --nofork --stdout - --nostdout --timeout' -- "$cur" ) ) + --nostdout --timeout' -- "$cur") ) fi } && complete -F _munin_update munin-update diff --git a/completions/munindoc b/completions/munindoc index f603d87b6a1..a08399ba3ed 100644 --- a/completions/munindoc +++ b/completions/munindoc @@ -5,8 +5,8 @@ _munindoc() local cur prev words cword _init_completion || return - COMPREPLY=( $( compgen -W \ - '$( command ls /usr/share/munin/plugins 2>/dev/null )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$(command ls /usr/share/munin/plugins 2>/dev/null)' -- "$cur") ) } && complete -F _munindoc munindoc diff --git a/completions/mussh b/completions/mussh index 185f9d30952..e76817c7758 100644 --- a/completions/mussh +++ b/completions/mussh @@ -10,11 +10,11 @@ _mussh() return ;; -d) - COMPREPLY=( $( compgen -W '{0..2}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..2}' -- "$cur") ) return ;; -v) - COMPREPLY=( $( compgen -W '{0..3}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..3}' -- "$cur") ) return ;; -i|-H|-C) @@ -26,7 +26,7 @@ _mussh() return ;; -l|-L) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; -s) @@ -39,13 +39,13 @@ _mussh() ;; -c) compopt -o filenames - COMPREPLY+=( $( compgen -c -- "$cur" ) ) + COMPREPLY+=( $(compgen -c -- "$cur") ) return ;; esac [[ $cur != -* ]] || \ - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) } && complete -F _mussh mussh diff --git a/completions/mutt b/completions/mutt index c16b5871c69..43a8842e1b2 100644 --- a/completions/mutt +++ b/completions/mutt @@ -9,7 +9,7 @@ _muttaddr() _muttaliases "$1" _muttquery "$1" - COMPREPLY+=( $( compgen -u -- "$1" ) ) + COMPREPLY+=( $(compgen -u -- "$1") ) } @@ -78,9 +78,9 @@ _muttaliases() [[ -z $muttrc ]] && return conffiles=( $(eval _muttconffiles $muttrc $muttrc) ) - aliases=( $( command sed -n 's|^alias[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*$|\1|p' \ - $(eval echo "${conffiles[@]}") ) ) - COMPREPLY+=( $( compgen -W "${aliases[*]}" -- "$cur" ) ) + aliases=( $(command sed -n 's|^alias[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*$|\1|p' \ + $(eval echo "${conffiles[@]}")) ) + COMPREPLY+=( $(compgen -W "${aliases[*]}" -- "$cur") ) } @@ -90,16 +90,16 @@ _muttquery() local cur=$1 querycmd muttcmd=${words[0]} local -a queryresults - querycmd="$( $muttcmd -Q query_command 2>/dev/null | command sed -e 's|^query_command=\"\(.*\)\"$|\1|' -e 's|%s|'$cur'|' )" + querycmd="$($muttcmd -Q query_command 2>/dev/null | command sed -e 's|^query_command=\"\(.*\)\"$|\1|' -e 's|%s|'$cur'|')" if [[ -z "$cur" || -z "$querycmd" ]]; then queryresults=() else __expand_tilde_by_ref querycmd - queryresults=( $( $querycmd | \ - command sed -n '2,$s|^\([^[:space:]]\{1,\}\).*|\1|p' ) ) + queryresults=( $($querycmd | \ + command sed -n '2,$s|^\([^[:space:]]\{1,\}\).*|\1|p') ) fi - COMPREPLY+=( $( compgen -W "${queryresults[*]}" -- "$cur" ) ) + COMPREPLY+=( $(compgen -W "${queryresults[*]}" -- "$cur") ) } @@ -110,18 +110,18 @@ _muttfiledir() muttrc=$(_muttrc) if [[ $cur == [=+]* ]]; then - folder="$( $muttcmd -F "$muttrc" -Q folder 2>/dev/null | command sed -e 's|^folder=\"\(.*\)\"$|\1|' )" + folder="$($muttcmd -F "$muttrc" -Q folder 2>/dev/null | command sed -e 's|^folder=\"\(.*\)\"$|\1|')" : folder:=~/Mail # Match any file in $folder beginning with $cur # (minus the leading '=' sign). compopt -o filenames - COMPREPLY=( $( compgen -f -- "$folder/${cur:1}" ) ) + COMPREPLY=( $(compgen -f -- "$folder/${cur:1}") ) COMPREPLY=( ${COMPREPLY[@]#$folder/} ) return elif [[ $cur == !* ]]; then - spoolfile="$( $muttcmd -F "$muttrc" -Q spoolfile 2>/dev/null | \ - command sed -e 's|^spoolfile=\"\(.*\)\"$|\1|' )" + spoolfile="$($muttcmd -F "$muttrc" -Q spoolfile 2>/dev/null | \ + command sed -e 's|^spoolfile=\"\(.*\)\"$|\1|')" [[ ! -z $spoolfile ]] && eval cur="${cur/^!/$spoolfile}" fi _filedir @@ -135,8 +135,8 @@ _mutt() case $cur in -*) - COMPREPLY=( $( compgen -W '-A -a -b -c -e -f -F -H -i -m -n -p -Q -R -s - -v -x -y -z -Z -h' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-A -a -b -c -e -f -F -H -i -m -n -p -Q -R -s + -v -x -y -z -Z -h' -- "$cur") ) return ;; *) diff --git a/completions/mypy b/completions/mypy index fa9cbff64c7..df16956cd3a 100644 --- a/completions/mypy +++ b/completions/mypy @@ -18,11 +18,11 @@ _mypy() return ;; --follow-imports) - COMPREPLY=( $( compgen -W 'normal silent skip error' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'normal silent skip error' -- "$cur") ) return ;; --python-executable) - COMPREPLY=( $( compgen -c -- "${cur:-py}" ) ) + COMPREPLY=( $(compgen -c -- "${cur:-py}") ) return ;; --*-dir|--*-report) @@ -44,7 +44,7 @@ _mypy() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi diff --git a/completions/mysql b/completions/mysql index 55fbb0593b2..fb1f67e5674 100644 --- a/completions/mysql +++ b/completions/mysql @@ -2,12 +2,12 @@ _mysql_character_sets() { - local IFS=$' \t\n' reset=$( shopt -p failglob ); shopt -u failglob + local IFS=$' \t\n' reset=$(shopt -p failglob); shopt -u failglob local -a charsets=( /usr/share/m{ariadb,ysql}/charsets/*.xml ) $reset charsets=( "${charsets[@]##*/}" ) charsets=( "${charsets[@]%%?(Index|\*).xml}" utf8 ) - COMPREPLY+=( $( compgen -W '${charsets[@]}' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W '${charsets[@]}' -- "$cur") ) } _mysql() @@ -17,11 +17,11 @@ _mysql() case $prev in --user|-!(-*)u) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; --database|-!(-*)D) - COMPREPLY=( $( compgen -W "$(mysqlshow 2>/dev/null | command sed -ne '2d' -e 's/^|.\([^|]*\)|.*/\1/p')" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(mysqlshow 2>/dev/null | command sed -ne '2d' -e 's/^|.\([^|]*\)|.*/\1/p')" -- "$cur") ) return ;; @@ -43,7 +43,7 @@ _mysql() return ;; --protocol) - COMPREPLY=( $( compgen -W 'tcp socket pipe memory' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'tcp socket pipe memory' -- "$cur") ) return ;; --defaults-file|--defaults-extra-file|--tee) @@ -74,7 +74,7 @@ _mysql() local help=$(_parse_help "$1") help+=" --skip-comments --skip-ssl" - COMPREPLY=( $( compgen -W "$help" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$help" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return ;; @@ -87,9 +87,9 @@ _mysql() ;; esac - COMPREPLY=( $( compgen -W \ + COMPREPLY=( $(compgen -W \ "$(mysqlshow 2>/dev/null | command sed -ne '2d' -e 's/^|.\([^|]*\)|.*/\1/p')" \ - -- "$cur" ) ) + -- "$cur") ) } && complete -F _mysql mysql diff --git a/completions/mysqladmin b/completions/mysqladmin index 438db84c498..1e34a34d263 100644 --- a/completions/mysqladmin +++ b/completions/mysqladmin @@ -7,7 +7,7 @@ _mysqladmin() case $prev in --user|-!(-*)u) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; --host|-!(-*)h) @@ -49,12 +49,12 @@ _mysqladmin() $split && return - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) - COMPREPLY+=( $( compgen -W 'create debug drop extended-status flush-hosts + COMPREPLY+=( $(compgen -W 'create debug drop extended-status flush-hosts flush-logs flush-status flush-tables flush-threads flush-privileges kill password old-password ping processlist reload refresh shutdown - status start-slave stop-slave variables version' -- "$cur" ) ) + status start-slave stop-slave variables version' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace } && diff --git a/completions/nc b/completions/nc index 55b356d35cf..4d5b79cadad 100644 --- a/completions/nc +++ b/completions/nc @@ -19,13 +19,13 @@ _nc() return ;; -*T) - COMPREPLY=( $( compgen -W 'critical inetcontrol lowcost lowdelay + COMPREPLY=( $(compgen -W 'critical inetcontrol lowcost lowdelay netcontrol throughput reliability ef af{11..43} cs{0..7}' \ - -- "$cur" ) ) + -- "$cur") ) return ;; -*X) - COMPREPLY=( $( compgen -W '4 5 connect' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '4 5 connect' -- "$cur") ) return ;; -*x) @@ -35,7 +35,7 @@ _nc() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) return fi diff --git a/completions/ncftp b/completions/ncftp index 4c073ce6b9c..35146f3cef9 100644 --- a/completions/ncftp +++ b/completions/ncftp @@ -12,13 +12,13 @@ _ncftp() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) return fi if [[ $cword -eq 1 && -f ~/.ncftp/bookmarks ]]; then - COMPREPLY=( $( compgen -W '$( command sed -ne "s/^\([^,]\{1,\}\),.*$/\1/p" \ - ~/.ncftp/bookmarks )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(command sed -ne "s/^\([^,]\{1,\}\),.*$/\1/p" \ + ~/.ncftp/bookmarks)' -- "$cur") ) fi } && diff --git a/completions/nethogs b/completions/nethogs index 8eeb4ff58c0..85fc1cb4252 100644 --- a/completions/nethogs +++ b/completions/nethogs @@ -8,14 +8,14 @@ _nethogs() case "$prev" in -d) # expect integer value - COMPREPLY+=( $( compgen -W '{0..9}' ) ) + COMPREPLY+=( $(compgen -W '{0..9}') ) compopt -o nospace return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" -h)' -- "$cur") ) return fi diff --git a/completions/newlist b/completions/newlist index 04bf17d1759..793928c30b9 100644 --- a/completions/newlist +++ b/completions/newlist @@ -14,7 +14,7 @@ _newlist() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else _xfunc list_lists _mailman_lists diff --git a/completions/newusers b/completions/newusers index 068b7a92819..b7792b54048 100644 --- a/completions/newusers +++ b/completions/newusers @@ -7,8 +7,7 @@ _newusers() case $prev in -c|--crypt) - COMPREPLY=( $( compgen -W 'DES MD5 NONE SHA256 SHA512' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'DES MD5 NONE SHA256 SHA512' -- "$cur") ) return ;; -s|--sha-rounds) @@ -19,7 +18,7 @@ _newusers() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/ngrep b/completions/ngrep index 5d51a0c9058..65f4dc6daf8 100644 --- a/completions/ngrep +++ b/completions/ngrep @@ -15,11 +15,11 @@ _ngrep() ;; -d) _available_interfaces -a - COMPREPLY+=( $( compgen -W 'any' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W 'any' -- "$cur") ) return ;; -W) - COMPREPLY=( $( compgen -W 'normal byline single none' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'normal byline single none' -- "$cur") ) return ;; -F) @@ -29,7 +29,7 @@ _ngrep() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) return fi } && diff --git a/completions/nmap b/completions/nmap index c56c7210894..b4e76baf92c 100644 --- a/completions/nmap +++ b/completions/nmap @@ -25,7 +25,7 @@ _nmap() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-iL -iR --exclude --excludefile -sL -sP -PN + COMPREPLY=( $(compgen -W '-iL -iR --exclude --excludefile -sL -sP -PN -PS -PA -PU -PY -PE -PP -PM -PO -n -R --dns-servers --system-dns --traceroute -sS -sT -sA -sW -sM -sU -sN -sF -sX --scanflags -sI -sY -sZ -sO -b -p -F -r --top-ports --port-ratio -sV @@ -40,7 +40,7 @@ _nmap() -oA -v -d --reason --open --packet-trace --iflist --log-errors --append-output --resume --stylesheet --webxml --no-stylesheet -6 -A --datadir --send-eth --send-ip --privilege--unprivileged -V - -h' -- "$cur" ) ) + -h' -- "$cur") ) else _known_hosts_real -- "$cur" fi diff --git a/completions/nproc b/completions/nproc index 8903940e921..28e0dea75c3 100644 --- a/completions/nproc +++ b/completions/nproc @@ -14,7 +14,7 @@ _nproc() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && diff --git a/completions/nslookup b/completions/nslookup index 6577062966d..267d0c30867 100644 --- a/completions/nslookup +++ b/completions/nslookup @@ -2,15 +2,15 @@ _bind_queryclass() { - COMPREPLY+=( $( compgen -W 'IN CH HS ANY' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W 'IN CH HS ANY' -- "$cur") ) } _bind_querytype() { # http://en.wikipedia.org/wiki/List_of_DNS_record_types - COMPREPLY+=( $( compgen -W 'A AAAA AFSDB APL CERT CNAME DHCID DLV DNAME + COMPREPLY+=( $(compgen -W 'A AAAA AFSDB APL CERT CNAME DHCID DLV DNAME DNSKEY DS HIP IPSECKEY KEY KX LOC MX NAPTR NS NSEC NSEC3 NSEC3PARAM PTR - RRSIG RP SIG SOA SPF SRV SSHFP TXT' -- "$cur" ) ) + RRSIG RP SIG SOA SPF SRV SSHFP TXT' -- "$cur") ) } _nslookup() @@ -35,9 +35,9 @@ _nslookup() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '-all -class= -debug -nodebug -d2 -nod2 + COMPREPLY=( $(compgen -W '-all -class= -debug -nodebug -d2 -nod2 -domain= -search -nosearch -port= -querytype= -recurse -norecurse - -retry= -timeout= -vc -novc -fail -nofail' -- "$cur" ) ) + -retry= -timeout= -vc -novc -fail -nofail' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi @@ -66,7 +66,7 @@ _host() return ;; -m) - COMPREPLY=( $( compgen -W 'trace record usage' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'trace record usage' -- "$cur") ) return ;; -N|-R|-W) @@ -75,7 +75,7 @@ _host() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) return fi diff --git a/completions/nsupdate b/completions/nsupdate index d021373d46a..ff3b9a475cd 100644 --- a/completions/nsupdate +++ b/completions/nsupdate @@ -20,8 +20,8 @@ _nsupdate() ;; -*y) if [[ $cur == h* ]]; then - COMPREPLY=( $( compgen -W "hmac-{md5,sha{1,224,256,384,512}}" \ - -S : -- "$cur" ) ) + COMPREPLY=( $(compgen -W "hmac-{md5,sha{1,224,256,384,512}}" \ + -S : -- "$cur") ) [[ $COMPREPLY == *: ]] && compopt -o nospace fi return @@ -29,7 +29,7 @@ _nsupdate() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) return fi diff --git a/completions/ntpdate b/completions/ntpdate index 4b09335b053..5291336c7c2 100644 --- a/completions/ntpdate +++ b/completions/ntpdate @@ -11,11 +11,11 @@ _ntpdate() return ;; -*U) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; -*p) - COMPREPLY=( $( compgen -W '{1..8}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{1..8}' -- "$cur") ) return ;; @@ -25,7 +25,7 @@ _ntpdate() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) else _known_hosts_real -- "$cur" fi diff --git a/completions/oggdec b/completions/oggdec index 5e0a881888d..9bdf5019a42 100644 --- a/completions/oggdec +++ b/completions/oggdec @@ -10,11 +10,11 @@ _oggdec() return ;; --bits|-!(-*)b) - COMPREPLY=( $( compgen -W "8 16" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "8 16" -- "$cur") ) return ;; --endianness|--sign|-!(-*)[es]) - COMPREPLY=( $( compgen -W "0 1" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "0 1" -- "$cur") ) return ;; --output|-!(-*)o) @@ -26,7 +26,7 @@ _oggdec() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/op b/completions/op index 15dedc05160..b99bd2ded34 100644 --- a/completions/op +++ b/completions/op @@ -13,9 +13,8 @@ _op_command_options() for i in "${!words[@]}"; do [[ ${words[i]} == -* || $i -eq 0 ]] && unset words[i] done - COMPREPLY=( $( compgen -W \ - '$( _parse_usage "$1" "${words[*]} --help" ) --help' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$(_parse_usage "$1" "${words[*]} --help") --help' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return 0 ;; @@ -38,7 +37,7 @@ _op() done if [[ -z $command && $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi @@ -46,8 +45,7 @@ _op() [[ $command ]] && _op_command_options "$1" && return if [[ -z $command || $command == $prev ]]; then - COMPREPLY=( $( compgen -W '$( _op_commands "$1" $command )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_op_commands "$1" $command)' -- "$cur") ) [[ $COMPREPLY ]] && return fi diff --git a/completions/openssl b/completions/openssl index 73e56a44d6d..50300a43ae0 100644 --- a/completions/openssl +++ b/completions/openssl @@ -22,8 +22,7 @@ _openssl_sections() [[ ! -f $config ]] && return - COMPREPLY=( $( compgen -W "$( awk '/\[.*\]/ {print $2}' $config )" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(awk '/\[.*\]/ {print $2}' $config)" -- "$cur") ) } _openssl_digests() @@ -53,7 +52,7 @@ _openssl() sha224 sha256 sha384 sha512 genpkey pkey pkeyparam pkeyutl' if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$commands" -- "$cur") ) else command=${words[1]} case $prev in @@ -87,7 +86,7 @@ _openssl() formats+=" ENGINE" ;; esac - COMPREPLY=( $( compgen -W "$formats" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$formats" -- "$cur") ) return ;; -connect) @@ -95,16 +94,15 @@ _openssl() return ;; -starttls) - COMPREPLY=( $( compgen -W 'smtp pop3 imap ftp' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'smtp pop3 imap ftp' -- "$cur") ) return ;; -cipher) - COMPREPLY=( $( IFS=: compgen -W "$( $1 ciphers )" \ - -- "$cur" ) ) + COMPREPLY=( $(IFS=: compgen -W "$($1 ciphers)" -- "$cur") ) return ;; -kdf) - COMPREPLY=( $( compgen -W 'TLS1-PRF HKDF' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'TLS1-PRF HKDF' -- "$cur") ) return ;; esac @@ -137,7 +135,7 @@ _openssl() ;; dgst) options="-c -d -hex -binary -out -sign -verify -prverify - -signature $( _openssl_digests $1 )" + -signature $(_openssl_digests $1)" ;; dsa) options='-inform -outform -in -passin -out -passout -des @@ -189,7 +187,7 @@ _openssl() req) options="-inform -outform -in -passin -out -passout -text -noout -verify -modulus -new -rand -newkey -newkey - -nodes -key -keyform -keyout $( _openssl_digests $1 ) + -nodes -key -keyform -keyout $(_openssl_digests $1) -config -x509 -days -asn1-kludge -newhdr -extensions -reqexts section" ;; @@ -248,19 +246,19 @@ _openssl() -clrtrust -clrreject -addtrust -addreject -setalias -days -set_serial -signkey -x509toreq -req -CA -CAkey -CAcreateserial -CAserial -text -C -clrext - -extfile -extensions -engine $( _openssl_digests $1 )" + -extfile -extensions -engine $(_openssl_digests $1)" ;; md*|sha*|ripemd160) options='-c -d' ;; esac - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$options" -- "$cur") ) else if [[ "$command" == speed ]]; then - COMPREPLY=( $( compgen -W 'md2 mdc2 md5 hmac sha1 rmd160 + COMPREPLY=( $(compgen -W 'md2 mdc2 md5 hmac sha1 rmd160 idea-cbc rc2-cbc rc5-cbc bf-cbc des-cbc des-ede3 rc4 rsa512 rsa1024 rsa2048 rsa4096 dsa512 dsa1024 dsa2048 idea - rc2 des rsa blowfish' -- "$cur" ) ) + rc2 des rsa blowfish' -- "$cur") ) else _filedir fi diff --git a/completions/opera b/completions/opera index 26343c6243e..dc0859ea5aa 100644 --- a/completions/opera +++ b/completions/opera @@ -16,14 +16,14 @@ _opera() return ;; ?(-)-remote) - COMPREPLY=( $( compgen -W 'openURL\\( openFile\\( openM2\\( + COMPREPLY=( $(compgen -W 'openURL\\( openFile\\( openM2\\( openComposer\\( addBookmark\\( raise\\(\\) lower\\(\\)' \ - -- "$cur" ) ) + -- "$cur") ) [[ $COMPREPLY == *\( ]] && compopt -o nospace return ;; ?(-)-windowname) - COMPREPLY=( $( compgen -W 'first last opera{1..9}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'first last opera{1..9}' -- "$cur") ) return ;; ?(-)-geometry|?(-)-window|?(-)-display|?(-)-urllistloadtimeout|\ @@ -35,7 +35,7 @@ _opera() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/optipng b/completions/optipng index 7c614abe3fd..22889bf42eb 100644 --- a/completions/optipng +++ b/completions/optipng @@ -10,7 +10,7 @@ _optipng() return ;; -o) - COMPREPLY=( $( compgen -W '{0..7}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..7}' -- "$cur") ) return ;; -out|-log) @@ -22,26 +22,26 @@ _optipng() return ;; -i) - COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '0 1' -- "$cur") ) return ;; -zc|-zm) - COMPREPLY=( $( compgen -W '{1..9}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{1..9}' -- "$cur") ) return ;; -zw) - COMPREPLY=( $( compgen -W '256 512 1k 2k 4k 8k 16k 32k' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '256 512 1k 2k 4k 8k 16k 32k' \ + -- "$cur") ) return ;; -strip) - COMPREPLY=( $( compgen -W 'all' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'all' -- "$cur") ) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi diff --git a/completions/p4 b/completions/p4 index beea4687ac8..e383c8cf78c 100644 --- a/completions/p4 +++ b/completions/p4 @@ -9,22 +9,22 @@ _p4() local p4commands p4filetypes # rename isn't really a command - p4commands="$( p4 help commands 2>/dev/null | awk 'NF>3 {print $1}' )" + p4commands="$(p4 help commands 2>/dev/null | awk 'NF>3 {print $1}')" p4filetypes="ctext cxtext ktext kxtext ltext tempobj ubinary \ uresource uxbinary xbinary xltext xtempobj xtext \ text binary resource" if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W "$p4commands" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$p4commands" -- "$cur") ) elif [[ $cword -eq 2 ]]; then case $prev in help) - COMPREPLY=( $( compgen -W "simple commands environment + COMPREPLY=( $(compgen -W "simple commands environment filetypes jobview revisions usage views $p4commands" \ - -- "$cur" ) ) + -- "$cur") ) ;; admin) - COMPREPLY=( $( compgen -W "checkpoint stop" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "checkpoint stop" -- "$cur") ) ;; *) ;; @@ -34,7 +34,7 @@ _p4() -t) case ${words[$cword-2]} in add|edit|reopen) - COMPREPLY=( $( compgen -W "$p4filetypes" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$p4filetypes" -- "$cur") ) ;; *) ;; diff --git a/completions/pack200 b/completions/pack200 index 37c57749b1f..3ccdf3a9135 100644 --- a/completions/pack200 +++ b/completions/pack200 @@ -12,19 +12,19 @@ _pack200() return ;; -E|--effort) - COMPREPLY=( $( compgen -W '{0..9}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..9}' -- "$cur") ) return ;; -H|--deflate-hint) - COMPREPLY=( $( compgen -W 'true false keep' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'true false keep' -- "$cur") ) return ;; -m|--modification-time) - COMPREPLY=( $( compgen -W 'latest keep' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'latest keep' -- "$cur") ) return ;; -U|--unknown-attribute) - COMPREPLY=( $( compgen -W 'error strip pass' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'error strip pass' -- "$cur") ) return ;; -f|--config-file) @@ -32,7 +32,7 @@ _pack200() return ;; -l|--log-file) - COMPREPLY=( $( compgen -W '-' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-' -- "$cur") ) _filedir log return ;; @@ -55,12 +55,12 @@ _pack200() if ! $pack ; then if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '--no-gzip --gzip --strip-debug + COMPREPLY=( $(compgen -W '--no-gzip --gzip --strip-debug --no-keep-file-order --segment-limit= --effort= --deflate-hint= --modification-time= --pass-file= --unknown-attribute= --class-attribute= --field-attribute= --method-attribute= --code-attribute= --config-file= --verbose --quiet --log-file= - --help --version -J --repack' -- "$cur" ) ) + --help --version -J --repack' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else _filedir 'pack?(.gz)' diff --git a/completions/passwd b/completions/passwd index e192a228512..1734a326571 100644 --- a/completions/passwd +++ b/completions/passwd @@ -12,9 +12,9 @@ _passwd() esac if [[ "$cur" == -* ]]; then - local opts=$( _parse_help "$1" ) - [[ $opts ]] || opts=$( _parse_usage "$1" ) - COMPREPLY=( $( compgen -W '$opts' -- "$cur" ) ) + local opts=$(_parse_help "$1") + [[ $opts ]] || opts=$(_parse_usage "$1") + COMPREPLY=( $(compgen -W '$opts' -- "$cur") ) return fi diff --git a/completions/patch b/completions/patch index 80c86922ca7..df85211d4f0 100644 --- a/completions/patch +++ b/completions/patch @@ -11,7 +11,7 @@ _patch() return ;; --fuzz|-!(-*)F) - COMPREPLY=( $( compgen -W '{0..3}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..3}' -- "$cur") ) return ;; --input|-!(-*)i) @@ -24,12 +24,12 @@ _patch() return ;; --quoting-style) - COMPREPLY=( $( compgen -W 'literal shell shell-always c escape' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'literal shell shell-always c escape' \ + -- "$cur") ) return ;; --version-control|-!(-*)V) - COMPREPLY=( $( compgen -W 'simple numbered existing' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'simple numbered existing' -- "$cur") ) return ;; --directory|-!(-*)d) @@ -37,11 +37,11 @@ _patch() return ;; --reject-format) - COMPREPLY=( $( compgen -W 'context unified' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'context unified' -- "$cur") ) return ;; --read-only) - COMPREPLY=( $( compgen -W 'ignore warn fail' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'ignore warn fail' -- "$cur") ) return ;; esac @@ -49,7 +49,7 @@ _patch() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/pdftotext b/completions/pdftotext index aed6b2c2734..79c837e0359 100644 --- a/completions/pdftotext +++ b/completions/pdftotext @@ -10,24 +10,24 @@ _pdftotext() return ;; -enc) - COMPREPLY=( $( compgen -W '$( "$1" -listenc 2>/dev/null | - command sed -e 1d )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$("$1" -listenc 2>/dev/null | + command sed -e 1d)' -- "$cur") ) return ;; -eol) - COMPREPLY=( $( compgen -W "unix dos mac" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "unix dos mac" -- "$cur") ) return ;; esac if [[ $cur == -* && ${prev,,} != *.pdf ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi case ${prev,,} in -|*.txt) ;; - *.pdf) COMPREPLY=( $( compgen -W '-' -- "$cur" ) ) ; _filedir txt ;; + *.pdf) COMPREPLY=( $(compgen -W '-' -- "$cur") ) ; _filedir txt ;; *) _filedir pdf ;; esac } && diff --git a/completions/perl b/completions/perl index 7b91d1b4e9c..98ddb9eb664 100644 --- a/completions/perl +++ b/completions/perl @@ -2,9 +2,9 @@ _perl_helper() { - COMPREPLY=( $( compgen -P "$prefix" -W \ - "$( ${2:-perl} ${BASH_SOURCE[0]%/*}/../helpers/perl $1 $cur )" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -P "$prefix" -W \ + "$(${2:-perl} ${BASH_SOURCE[0]%/*}/../helpers/perl $1 $cur)" \ + -- "$cur") ) [[ $1 == functions ]] || __ltrim_colon_completions "$prefix$cur" } @@ -36,7 +36,7 @@ _perl() -*[Ix]) local IFS=$'\n' compopt -o filenames - COMPREPLY=( $( compgen -d $optPrefix $optSuffix -- "$cur" ) ) + COMPREPLY=( $(compgen -d $optPrefix $optSuffix -- "$cur") ) return ;; -*[mM]) @@ -51,9 +51,9 @@ _perl() temp="${cur##+(:)}" prefix+="${cur%$temp}" local IFS=$'\n' - COMPREPLY=( $( compgen -P "$prefix" -W \ - '$( $1 -MConfig -e "print join \"\\n\", - keys %Config::Config" 2>/dev/null )' -- "$temp" ) ) + COMPREPLY=( $(compgen -P "$prefix" -W \ + '$($1 -MConfig -e "print join \"\\n\", + keys %Config::Config" 2>/dev/null)' -- "$temp") ) __ltrim_colon_completions "$prefix$temp" fi return @@ -69,8 +69,8 @@ _perl() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-C -s -T -u -U -W -X -h -v -V -c -w -d -D -p - -n -a -F -l -0 -I -m -M -P -S -x -i -e' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-C -s -T -u -U -W -X -h -v -V -c -w -d -D -p + -n -a -F -l -0 -I -m -M -P -S -x -i -e' -- "$cur") ) else _filedir fi @@ -110,17 +110,17 @@ _perldoc() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) else # return available modules (unless it is clearly a file) if [[ "$cur" != @(*/|[.~])* ]]; then _perl_helper perldocs $perl if [[ $cur == p* ]]; then - COMPREPLY+=( $( compgen -W \ - '$( PERLDOC_PAGER=cat "$1" -u perl | \ - command sed -ne "/perl.*Perl overview/,/perlwin32/p" | \ - awk "\$NF=2 && \$1 ~ /^perl/ { print \$1 }" )' \ - -- "$cur" ) ) + COMPREPLY+=( $(compgen -W \ + '$(PERLDOC_PAGER=cat "$1" -u perl | \ + command sed -ne "/perl.*Perl overview/,/perlwin32/p" | \ + awk "\$NF=2 && \$1 ~ /^perl/ { print \$1 }")' \ + -- "$cur") ) fi fi _filedir 'p@([lm]|od)' diff --git a/completions/perlcritic b/completions/perlcritic index b38ae991217..d9a4063da97 100644 --- a/completions/perlcritic +++ b/completions/perlcritic @@ -11,8 +11,8 @@ _perlcritic() return ;; --severity) - COMPREPLY=( $( compgen -W "{1..5} brutal cruel harsh stern gentle" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "{1..5} brutal cruel harsh stern gentle" \ + -- "$cur") ) return ;; --profile|-p) @@ -20,27 +20,27 @@ _perlcritic() return ;; --theme) - COMPREPLY=( $( compgen -W '$( "$1" --list-themes 2>/dev/null )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$("$1" --list-themes 2>/dev/null)' \ + -- "$cur") ) return ;; --profile-strictness) - COMPREPLY=( $( compgen -W 'warn fatal quiet' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'warn fatal quiet' -- "$cur") ) return ;; --verbose) - COMPREPLY=( $( compgen -W '{1..11}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{1..11}' -- "$cur") ) return ;; --pager) compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=( $(compgen -c -- "$cur") ) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) return fi diff --git a/completions/perltidy b/completions/perltidy index 10c49cab33d..993a1e2070a 100644 --- a/completions/perltidy +++ b/completions/perltidy @@ -22,20 +22,20 @@ _perltidy() return ;; -ole=*) - COMPREPLY=( $( compgen -W 'dos win mac unix' -- "${cur#*=}" ) ) + COMPREPLY=( $(compgen -W 'dos win mac unix' -- "${cur#*=}") ) return ;; -bt=*|-pt=*|-sbt=*|-bvt=*|-pvt=*|-sbvt=*|-bvtc=*|-pvtc=*|-sbvtc=*|\ -cti=*|-kbl=*|-vt=*) - COMPREPLY=( $( compgen -W '0 1 2' -- "${cur#*=}" ) ) + COMPREPLY=( $(compgen -W '0 1 2' -- "${cur#*=}") ) return ;; -vtc=*) - COMPREPLY=( $( compgen -W '0 1' -- "${cur#*=}" ) ) + COMPREPLY=( $(compgen -W '0 1' -- "${cur#*=}") ) return ;; -cab=*) - COMPREPLY=( $( compgen -W '0 1 2 3' -- "${cur#*=}" ) ) + COMPREPLY=( $(compgen -W '0 1 2 3' -- "${cur#*=}") ) return ;; -*=) @@ -44,7 +44,7 @@ _perltidy() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else _filedir 'p[lm]' diff --git a/completions/pgrep b/completions/pgrep index d1b6f18da19..e45d7d7fe01 100644 --- a/completions/pgrep +++ b/completions/pgrep @@ -22,7 +22,7 @@ _pgrep() return ;; -j) - COMPREPLY=( $( compgen -W 'any none' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'any none' -- "$cur") ) return ;; --parent|-!(-*)P) @@ -36,11 +36,11 @@ _pgrep() esac if [[ $cur == -* ]]; then - local help='$( _parse_help "$1" )' - [[ $help ]] || help='$( "$1" --usage 2>&1 | + local help='$(_parse_help "$1")' + [[ $help ]] || help='$("$1" --usage 2>&1 | command sed -e "s/\[-signal\]//" -e "s/\[-SIGNAL\]//" | - _parse_usage - )' - COMPREPLY=( $( compgen -W "$help" -- "$cur" ) ) + _parse_usage -)' + COMPREPLY=( $(compgen -W "$help" -- "$cur") ) [[ $cword -eq 1 && $1 == *pkill ]] && _signals - return fi diff --git a/completions/pidof b/completions/pidof index 0781cfacbc1..9e5c012b9fe 100644 --- a/completions/pidof +++ b/completions/pidof @@ -16,7 +16,7 @@ _pidof() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi diff --git a/completions/pine b/completions/pine index d99a3808b40..bf6056e004f 100644 --- a/completions/pine +++ b/completions/pine @@ -14,17 +14,17 @@ _pine() return ;; -sort) - COMPREPLY=( $( compgen -W 'arrival subject threaded orderedsubject + COMPREPLY=( $(compgen -W 'arrival subject threaded orderedsubject date from size score to cc' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) else - COMPREPLY=( $( compgen -W '$( awk "{print \$1}" ~/.addressbook \ - 2>/dev/null)' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(awk "{print \$1}" ~/.addressbook \ + 2>/dev/null)' -- "$cur") ) fi } && complete -F _pine pine alpine diff --git a/completions/ping b/completions/ping index c8bfd9fd725..d611ae87022 100644 --- a/completions/ping +++ b/completions/ping @@ -19,14 +19,14 @@ _ping() # Path MTU strategy in Linux, mask|time in FreeBSD local opts="do want dont" [[ $OSTYPE == *bsd* ]] && opts="mask time" - COMPREPLY=( $( compgen -W '$opts' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$opts' -- "$cur") ) return ;; -*N) if [[ $cur != *= ]]; then - COMPREPLY=( $( compgen -W 'name ipv6 ipv6-global ipv6-sitelocal + COMPREPLY=( $(compgen -W 'name ipv6 ipv6-global ipv6-sitelocal ipv6-linklocal ipv6-all ipv4 ipv4-all subject-ipv6= - subject-ipv4= subject-name= subject-fqdn=' -- "$cur" ) ) + subject-ipv4= subject-name= subject-fqdn=' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi return @@ -34,7 +34,7 @@ _ping() -*Q) # TOS in Linux, "somewhat quiet" (no args) in FreeBSD if [[ $OSTYPE != *bsd* ]]; then - COMPREPLY=( $( compgen -W '{0..7}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..7}' -- "$cur") ) return fi ;; @@ -46,7 +46,7 @@ _ping() -*T) # Timestamp option in Linux, TTL in FreeBSD [[ $OSTYPE == *bsd* ]] || \ - COMPREPLY=( $( compgen -W 'tsonly tsandaddr' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'tsonly tsandaddr' -- "$cur") ) return ;; -*4*) @@ -58,8 +58,8 @@ _ping() esac if [[ $cur == -* ]]; then - local opts=$( _parse_help "$1" ) - COMPREPLY=( $( compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur" ) ) + local opts=$(_parse_help "$1") + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) return fi diff --git a/completions/pkg-config b/completions/pkg-config index 5f4f26ae215..5719137069b 100644 --- a/completions/pkg-config +++ b/completions/pkg-config @@ -15,9 +15,9 @@ _pkg_config() local i for (( i=1; i < ${#words[@]}; i++ )); do if [[ ${words[i]} != -* ]]; then - COMPREPLY=( $( compgen -W \ - '$( "$1" ${words[i]} --print-variables 2>/dev/null )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$("$1" ${words[i]} --print-variables 2>/dev/null)' \ + -- "$cur") ) break fi done @@ -32,11 +32,11 @@ _pkg_config() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else - COMPREPLY=( $( compgen -W "$( $1 --list-all \ - 2>/dev/null | awk '{print $1}' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 --list-all \ + 2>/dev/null | awk '{print $1}')" -- "$cur") ) _filedir pc fi } && diff --git a/completions/pkg_delete b/completions/pkg_delete index 9125829d58c..b1a93c2049f 100644 --- a/completions/pkg_delete +++ b/completions/pkg_delete @@ -11,7 +11,7 @@ _pkg_delete() [[ "$prev" == -o || "$prev" == -p || "$prev" == -W ]] && return - COMPREPLY=( $( compgen -d -- "$pkgdir$cur" ) ) + COMPREPLY=( $(compgen -d -- "$pkgdir$cur") ) COMPREPLY=( ${COMPREPLY[@]#$pkgdir} ) } && diff --git a/completions/pkgtool b/completions/pkgtool index 95d42aaaab5..8bea9cdde63 100644 --- a/completions/pkgtool +++ b/completions/pkgtool @@ -15,7 +15,7 @@ _pkgtool() return ;; --source_device) - COMPREPLY=( $( compgen -f -d -- "${cur:-/dev/}" ) ) + COMPREPLY=( $(compgen -f -d -- "${cur:-/dev/}") ) return ;; --tagfile) @@ -25,9 +25,9 @@ _pkgtool() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--sets --ignore-tagfiles --tagfile + COMPREPLY=( $(compgen -W '--sets --ignore-tagfiles --tagfile --source-mounted --source_dir --target_dir --source_device' \ - -- "$cur" ) ) + -- "$cur") ) fi } && complete -F _pkgtool pkgtool diff --git a/completions/plague-client b/completions/plague-client index 6fd22f75188..d8b2140e342 100644 --- a/completions/plague-client +++ b/completions/plague-client @@ -6,8 +6,8 @@ _plague_client() _init_completion || return [[ $cword -eq 1 ]] && \ - COMPREPLY=( $( compgen -W 'build detail finish help is_paused kill list - list_builders pause requeue unpause update_builders' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'build detail finish help is_paused kill list + list_builders pause requeue unpause update_builders' -- "$cur") ) } && complete -F _plague_client plague-client diff --git a/completions/pm-hibernate b/completions/pm-hibernate index fcabbfaf83e..1deadd11df5 100644 --- a/completions/pm-hibernate +++ b/completions/pm-hibernate @@ -5,7 +5,7 @@ _pm_action() local cur prev words cword _init_completion || return - COMPREPLY=( $( compgen -W "--help $( _parse_help "$1" )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "--help $(_parse_help "$1")" -- "$cur") ) } && complete -F _pm_action pm-hibernate pm-suspend pm-suspend-hybrid diff --git a/completions/pm-is-supported b/completions/pm-is-supported index 2eeb634d6ff..6a112aeb4ef 100644 --- a/completions/pm-is-supported +++ b/completions/pm-is-supported @@ -5,8 +5,8 @@ _pm_is_supported() local cur prev words cword _init_completion || return - COMPREPLY=( $( compgen -W '--help --suspend --hibernate --suspend-hybrid' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--help --suspend --hibernate --suspend-hybrid' \ + -- "$cur") ) } && complete -F _pm_is_supported pm-is-supported diff --git a/completions/pm-powersave b/completions/pm-powersave index f61833cf180..06f93de0b76 100644 --- a/completions/pm-powersave +++ b/completions/pm-powersave @@ -5,7 +5,7 @@ _pm_powersave() local cur prev words cword _init_completion || return - COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "true false" -- "$cur") ) } && complete -F _pm_powersave pm-powersave diff --git a/completions/pngfix b/completions/pngfix index b1f630ed453..b4b58e830c1 100644 --- a/completions/pngfix +++ b/completions/pngfix @@ -14,8 +14,9 @@ _pngfix() return ;; --strip) - COMPREPLY=( $( IFS='|' compgen -W '$( "$1" --help 2>&1 | - command sed -ne "s/.*--strip=\[\([^]]*\)\].*/\1/p" )' -- "$cur" ) ) + COMPREPLY=( $(IFS='|' compgen -W '$("$1" --help 2>&1 | + command sed -ne "s/.*--strip=\[\([^]]*\)\].*/\1/p")' \ + -- "$cur") ) return ;; esac @@ -23,7 +24,7 @@ _pngfix() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/portinstall b/completions/portinstall index 314e936f136..fd1aa227a73 100644 --- a/completions/portinstall +++ b/completions/portinstall @@ -18,10 +18,10 @@ _portinstall() [[ "$prev" == -l || "$prev" == -L || "$prev" == -o ]] && return - COMPREPLY=( $( command grep -E "^$cur" 2>/dev/null < $indexfile | \ - cut -d'|' -f1 ) ) - COMPREPLY2=( $( command grep -E "^[^\|]+\|$portsdir$cur" 2>/dev/null \ - < $indexfile | cut -d'|' -f2 ) ) + COMPREPLY=( $(command grep -E "^$cur" 2>/dev/null < $indexfile | \ + cut -d'|' -f1) ) + COMPREPLY2=( $(command grep -E "^[^\|]+\|$portsdir$cur" 2>/dev/null \ + < $indexfile | cut -d'|' -f2) ) COMPREPLY2=( ${COMPREPLY2[@]#$portsdir} ) COMPREPLY+=( "${COMPREPLY2[@]}" ) diff --git a/completions/portupgrade b/completions/portupgrade index 64d983df080..425380775d9 100644 --- a/completions/portupgrade +++ b/completions/portupgrade @@ -9,7 +9,7 @@ _portupgrade() local pkgdir=${PKG_DBDIR:-/var/db/pkg}/ - COMPREPLY=( $( compgen -d -- "$pkgdir$cur" ) ) + COMPREPLY=( $(compgen -d -- "$pkgdir$cur") ) COMPREPLY=( ${COMPREPLY[@]#$pkgdir} ) COMPREPLY=( ${COMPREPLY[@]%-*} ) diff --git a/completions/postcat b/completions/postcat index 69214354e3b..68e95b7322d 100644 --- a/completions/postcat +++ b/completions/postcat @@ -13,7 +13,7 @@ _postcat() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) return fi @@ -24,8 +24,8 @@ _postcat() if [[ $qfile -eq 1 ]]; then local len=${#cur} pval idx=0 - for pval in $( mailq 2>/dev/null | \ - command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//' ); do + for pval in $(mailq 2>/dev/null | \ + command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//'); do if [[ "$cur" == "${pval:0:$len}" ]]; then COMPREPLY[$idx]=$pval idx=$(($idx+1)) diff --git a/completions/postconf b/completions/postconf index c1f17d9d34c..bb6cfbfa7db 100644 --- a/completions/postconf +++ b/completions/postconf @@ -23,12 +23,12 @@ _postconf() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) return fi local len=${#cur} idx=0 pval - for pval in $( /usr/sbin/postconf 2>/dev/null | cut -d ' ' -f 1 ); do + for pval in $(/usr/sbin/postconf 2>/dev/null | cut -d ' ' -f 1); do if [[ "$cur" == "${pval:0:$len}" ]]; then COMPREPLY[$idx]="$pval$eqext" idx=$(($idx+1)) diff --git a/completions/postfix b/completions/postfix index 9b116be1d4f..89ff4dd476f 100644 --- a/completions/postfix +++ b/completions/postfix @@ -11,18 +11,18 @@ _postfix() return ;; -D) - COMPREPLY=( $( compgen -W 'start' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'start' -- "$cur") ) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) return fi - COMPREPLY=( $( compgen -W 'check start stop abort flush reload status - set-permissions upgrade-configuration' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'check start stop abort flush reload status + set-permissions upgrade-configuration' -- "$cur") ) } && complete -F _postfix postfix diff --git a/completions/postmap b/completions/postmap index 1b415f69d61..051ddc86acc 100644 --- a/completions/postmap +++ b/completions/postmap @@ -16,16 +16,16 @@ _postmap() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) return fi if [[ "$cur" == *:* ]]; then compopt -o filenames - COMPREPLY=( $( compgen -f -- "${cur#*:}" ) ) + COMPREPLY=( $(compgen -f -- "${cur#*:}") ) else local len=${#cur} idx=0 pval - for pval in $( /usr/sbin/postconf -m 2>/dev/null ); do + for pval in $(/usr/sbin/postconf -m 2>/dev/null); do if [[ "$cur" == "${pval:0:$len}" ]]; then COMPREPLY[$idx]="$pval:" idx=$(($idx+1)) @@ -33,7 +33,7 @@ _postmap() done if [[ $idx -eq 0 ]]; then compopt -o filenames - COMPREPLY=( $( compgen -f -- "$cur" ) ) + COMPREPLY=( $(compgen -f -- "$cur") ) fi fi } && diff --git a/completions/postsuper b/completions/postsuper index e69cbea0ccc..633449033f6 100644 --- a/completions/postsuper +++ b/completions/postsuper @@ -15,8 +15,8 @@ _postsuper() -[dr]) len=${#cur} idx=0 - for pval in ALL $( mailq 2>/dev/null | \ - command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//' ); do + for pval in ALL $(mailq 2>/dev/null | \ + command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//'); do if [[ "$cur" == "${pval:0:$len}" ]]; then COMPREPLY[$idx]=$pval idx=$(($idx+1)) @@ -27,8 +27,8 @@ _postsuper() -h) len=${#cur} idx=0 - for pval in ALL $( mailq 2>/dev/null | \ - command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* ].*$//; /!$/d' ); do + for pval in ALL $(mailq 2>/dev/null | \ + command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* ].*$//; /!$/d'); do if [[ "$cur" == "${pval:0:$len}" ]]; then COMPREPLY[$idx]=$pval idx=$(($idx+1)) @@ -39,8 +39,8 @@ _postsuper() -H) len=${#cur} idx=0 - for pval in ALL $( mailq 2>/dev/null | \ - command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; /^[0-9A-Z]*[* ]/d; s/!.*$//' ); do + for pval in ALL $(mailq 2>/dev/null | \ + command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; /^[0-9A-Z]*[* ]/d; s/!.*$//'); do if [[ "$cur" == "${pval:0:$len}" ]]; then COMPREPLY[$idx]=$pval idx=$(($idx+1)) @@ -51,11 +51,11 @@ _postsuper() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi - COMPREPLY=( $( compgen -W 'hold incoming active deferred' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'hold incoming active deferred' -- "$cur") ) } && complete -F _postsuper postsuper diff --git a/completions/povray b/completions/povray index e90279b3caa..1050115c0b7 100644 --- a/completions/povray +++ b/completions/povray @@ -21,14 +21,14 @@ _povray() ;; [-+]O*) # guess what output file type user may want - case $( ( IFS=$'\n'; command grep '^[-+]F' <<<"${words[*]}" ) ) in + case $(IFS=$'\n'; command grep '^[-+]F' <<<"${words[*]}") in [-+]FN) oext=png ;; [-+]FP) oext=ppm ;; [-+]F[CT]) oext=tga ;; *) oext=$defoext ;; esac # complete filename corresponding to previously specified +I - COMPREPLY=( $( ( IFS=$'\n'; command grep '^[-+]I' <<<"${words[*]}" ) ) ) + COMPREPLY=( $(IFS=$'\n'; command grep '^[-+]I' <<<"${words[*]}") ) COMPREPLY=( ${COMPREPLY[@]#[-+]I} ) COMPREPLY=( ${COMPREPLY[@]/%.pov/.$oext} ) cur="${povcur#[-+]O}" # to confuse _filedir diff --git a/completions/prelink b/completions/prelink index 0db3140c954..62580a95f5e 100644 --- a/completions/prelink +++ b/completions/prelink @@ -30,7 +30,7 @@ _prelink() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/protoc b/completions/protoc index 1d4bef16775..7916803439a 100644 --- a/completions/protoc +++ b/completions/protoc @@ -18,13 +18,13 @@ _protoc() return ;; --error_format) - COMPREPLY=( $( compgen -W 'gcc msvs' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'gcc msvs' -- "$cur") ) return ;; --plugin) if [[ $cur != *=* ]]; then compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=( $(compgen -c -- "$cur") ) fi return ;; @@ -46,7 +46,7 @@ _protoc() return ;; -*) - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) local i for i in ${!COMPREPLY[@]}; do [[ ${COMPREPLY[i]} == -oFILE ]] && unset 'COMPREPLY[i]' diff --git a/completions/psql b/completions/psql index 8f5d1200f9a..ceedf07e1b0 100644 --- a/completions/psql +++ b/completions/psql @@ -4,16 +4,16 @@ _pg_databases() { # -w was introduced in 8.4, https://launchpad.net/bugs/164772 # "Access privileges" in output may contain linefeeds, hence the NF > 1 - COMPREPLY=( $( compgen -W "$( psql -XAtqwlF $'\t' 2>/dev/null | \ - awk 'NF > 1 { print $1 }' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(psql -XAtqwlF $'\t' 2>/dev/null | \ + awk 'NF > 1 { print $1 }')" -- "$cur") ) } _pg_users() { # -w was introduced in 8.4, https://launchpad.net/bugs/164772 - COMPREPLY=( $( compgen -W "$( psql -XAtqwc 'select usename from pg_user' \ - template1 2>/dev/null )" -- "$cur" ) ) - [[ ${#COMPREPLY[@]} -eq 0 ]] && COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(psql -XAtqwc 'select usename from pg_user' \ + template1 2>/dev/null)" -- "$cur") ) + [[ ${#COMPREPLY[@]} -eq 0 ]] && COMPREPLY=( $(compgen -u -- "$cur") ) } # createdb(1) completion @@ -40,7 +40,7 @@ _createdb() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else _pg_databases @@ -72,7 +72,7 @@ _createuser() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && @@ -102,7 +102,7 @@ _dropdb() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else _pg_databases @@ -134,7 +134,7 @@ _dropuser() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else _pg_users @@ -176,7 +176,7 @@ _psql() if [[ "$cur" == -* ]]; then # return list of available options - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else # return list of available databases diff --git a/completions/puppet b/completions/puppet index 59a477ed40d..b9e1bcd6b4f 100644 --- a/completions/puppet +++ b/completions/puppet @@ -3,16 +3,16 @@ _puppet_logdest() { if [[ -z $cur ]]; then - COMPREPLY=( $( compgen -W 'syslog console /' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'syslog console /' -- "$cur") ) else - COMPREPLY=( $( compgen -W 'syslog console' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'syslog console' -- "$cur") ) _filedir fi } _puppet_digest() { - COMPREPLY=( $( compgen -W 'MD5 MD2 SHA1 SHA256' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'MD5 MD2 SHA1 SHA256' -- "$cur") ) } _puppet_certs() @@ -22,17 +22,17 @@ _puppet_certs() && puppetca=puppetca if [[ "$1" == --all ]]; then - cert_list=$( $puppetca --list --all | command sed -e 's/^[+-]\{0,1\}\s*\(\S\+\)\s\+.*$/\1/' ) + cert_list=$($puppetca --list --all | command sed -e 's/^[+-]\{0,1\}\s*\(\S\+\)\s\+.*$/\1/') else - cert_list=$( $puppetca --list ) + cert_list=$($puppetca --list) fi - COMPREPLY+=( $( compgen -W "$cert_list" -- "$cur" ) ) + COMPREPLY+=( $(compgen -W "$cert_list" -- "$cur") ) } _puppet_types() { - puppet_types=$( puppet describe --list | command sed -e 's/^\(\S\{1,\}\).*$/\1/' ) - COMPREPLY+=( $( compgen -W "$puppet_types" -- "$cur" ) ) + puppet_types=$(puppet describe --list | command sed -e 's/^\(\S\{1,\}\).*$/\1/') + COMPREPLY+=( $(compgen -W "$puppet_types" -- "$cur") ) } _puppet_references() @@ -41,16 +41,16 @@ _puppet_references() PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type puppetdoc &>/dev/null \ && puppetdoc=puppetdoc - puppet_doc_list=$( $puppetdoc --list | command sed -e 's/^\(\S\{1,\}\).*$/\1/' ) - COMPREPLY+=( $( compgen -W "$puppet_doc_list" -- "$cur" ) ) + puppet_doc_list=$($puppetdoc --list | command sed -e 's/^\(\S\{1,\}\).*$/\1/') + COMPREPLY+=( $(compgen -W "$puppet_doc_list" -- "$cur") ) } _puppet_subcmd_opts() { # puppet cmd help is somewhat slow, avoid if possible [[ -z $cur || $cur == -* ]] && \ - COMPREPLY+=( $( compgen -W \ - '$( _parse_usage "$1" "help $2" )' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W \ + '$(_parse_usage "$1" "help $2")' -- "$cur") ) } _puppet() @@ -103,9 +103,9 @@ _puppet() subcommand=apply ;; *) - COMPREPLY=( $( compgen -W 'agent apply cert describe doc + COMPREPLY=( $(compgen -W 'agent apply cert describe doc filebucket kick master parser queue resource' \ - -- "$cur" ) ) + -- "$cur") ) return ;; esac @@ -131,24 +131,24 @@ _puppet() return ;; --masterport) - COMPREPLY=( $( compgen -W '8140' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '8140' -- "$cur") ) return ;; -w|--waitforcert) - COMPREPLY=( $( compgen -W '0 15 30 60 120' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '0 15 30 60 120' -- "$cur") ) return ;; *) _puppet_subcmd_opts "$1" $subcommand # _parse_usage doesn't grok [-D|--daemonize|--no-daemonize] - COMPREPLY+=( $( compgen -W '--no-daemonize' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W '--no-daemonize' -- "$cur") ) return esac ;; apply) case $prev in --catalog) - COMPREPLY=( $( compgen -W '-' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-' -- "$cur") ) _filedir json return ;; @@ -176,11 +176,11 @@ _puppet() ;; *) action=$prev - COMPREPLY=( $( compgen -W '--digest --debug --help --verbose --version' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--digest --debug --help --verbose --version' \ + -- "$cur") ) case $action in fingerprint|list|verify|--fingerprint|--list|--verify) - COMPREPLY+=( $( compgen -W '--all' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W '--all' -- "$cur") ) _puppet_certs --all return ;; @@ -193,13 +193,13 @@ _puppet() return ;; sign|--sign) - COMPREPLY+=( $( compgen -W '--all' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W '--all' -- "$cur") ) _puppet_certs return ;; *) - COMPREPLY+=( $( compgen -W 'clean fingerprint generate - list print revoke sign verify reinventory' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W 'clean fingerprint generate + list print revoke sign verify reinventory' -- "$cur") ) return esac esac @@ -218,7 +218,7 @@ _puppet() return ;; -m|--mode) - COMPREPLY=( $( compgen -W 'text trac pdf rdoc' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'text trac pdf rdoc' -- "$cur") ) return ;; -r|--reference) @@ -248,8 +248,8 @@ _puppet() if [[ "$cur" == -* ]]; then _puppet_subcmd_opts "$1" $subcommand else - COMPREPLY=( $( compgen -W 'backup get restore' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'backup get restore' \ + -- "$cur") ) _filedir fi return @@ -285,7 +285,7 @@ _puppet() *) _puppet_subcmd_opts "$1" $subcommand # _parse_usage doesn't grok [-D|--daemonize|--no-daemonize] - COMPREPLY+=( $( compgen -W '--no-daemonize' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W '--no-daemonize' -- "$cur") ) return esac ;; @@ -297,7 +297,7 @@ _puppet() return ;; *) - COMPREPLY=( $( compgen -W 'validate' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'validate' -- "$cur") ) return esac ;; diff --git a/completions/pv b/completions/pv index 72f9e7dd4dc..165dd7d9745 100644 --- a/completions/pv +++ b/completions/pv @@ -21,7 +21,7 @@ _pv() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) else _filedir fi diff --git a/completions/pwck b/completions/pwck index 468aa7c6f12..7723f66ddf0 100644 --- a/completions/pwck +++ b/completions/pwck @@ -6,7 +6,7 @@ _pwck() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) return fi diff --git a/completions/pwd b/completions/pwd index f4a558a25e9..5610017316b 100644 --- a/completions/pwd +++ b/completions/pwd @@ -11,9 +11,9 @@ _pwd() ;; esac - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY ]] || \ - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) } && complete -F _pwd pwd diff --git a/completions/pwdx b/completions/pwdx index ed8d3ec276d..675c41ffcf9 100644 --- a/completions/pwdx +++ b/completions/pwdx @@ -12,9 +12,9 @@ _pwdx() esac if [[ $cur == -* ]]; then - local help='$( _parse_help "$1" )' + local help='$(_parse_help "$1")' [[ $help ]] || help=-V - COMPREPLY=( $( compgen -W "$help" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$help" -- "$cur") ) else _pids fi diff --git a/completions/pwgen b/completions/pwgen index 4ec3b6cdeac..8781cb9a8de 100644 --- a/completions/pwgen +++ b/completions/pwgen @@ -18,7 +18,7 @@ _pwgen() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/pycodestyle b/completions/pycodestyle index 7a62ac075e7..2eac748c287 100644 --- a/completions/pycodestyle +++ b/completions/pycodestyle @@ -10,7 +10,7 @@ _pycodestyle() return ;; --format) - COMPREPLY=( $( compgen -W 'default pylint' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'default pylint' -- "$cur") ) return ;; --config) @@ -22,7 +22,7 @@ _pycodestyle() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/pydoc b/completions/pydoc index 727999f8574..1e90488556f 100644 --- a/completions/pydoc +++ b/completions/pydoc @@ -16,13 +16,13 @@ _pydoc() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W \ - '$( "$1" | command sed -e "s/^pydoc3\{0,1\} //" | _parse_help - )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$("$1" | command sed -e "s/^pydoc3\{0,1\} //" | _parse_help -)' \ + -- "$cur") ) return fi - COMPREPLY=( $( compgen -W 'keywords topics modules' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'keywords topics modules' -- "$cur") ) if [[ $cur != @(.|*/)* ]]; then local python=python; [[ ${1##*/} == *3* ]] && python=python3 @@ -31,8 +31,8 @@ _pydoc() # Note that we don't do "pydoc modules" as it is known to hang on # some systems; _python_modules tends to work better and faster. - COMPREPLY+=( $( compgen -W \ - '$( $1 keywords topics | command sed -e /^Here/d )' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W \ + '$($1 keywords topics | command sed -e /^Here/d)' -- "$cur") ) _filedir py } && diff --git a/completions/pydocstyle b/completions/pydocstyle index c68f3c9a1e5..eb8589015ee 100644 --- a/completions/pydocstyle +++ b/completions/pydocstyle @@ -15,7 +15,7 @@ _pydocstyle() return ;; --convention) - COMPREPLY=( $( compgen -W "pep257 numpy" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "pep257 numpy" -- "$cur") ) return ;; esac @@ -23,7 +23,7 @@ _pydocstyle() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/pyflakes b/completions/pyflakes index 05025263aa5..4a982784235 100644 --- a/completions/pyflakes +++ b/completions/pyflakes @@ -12,7 +12,7 @@ _pyflakes() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi diff --git a/completions/pylint b/completions/pylint index a55dcc93932..35655964f31 100644 --- a/completions/pylint +++ b/completions/pylint @@ -24,7 +24,7 @@ _pylint() return ;; --disable|-!(-*)d) - COMPREPLY=( $( compgen -W 'all' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'all' -- "$cur") ) return ;; --rcfile) @@ -35,7 +35,7 @@ _pylint() --comment|--ignore-comments|--ignore-docstrings|--ignore-imports|\ --init-import|--ignore-mixin-members|--zope|--suggestion-mode|\ -!(-*)[isr]) - COMPREPLY=( $( compgen -W 'yes no' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'yes no' -- "$cur") ) return ;; --load-plugins|--deprecated-modules) @@ -46,19 +46,19 @@ _pylint() return ;; --jobs|-!(-*)j) - COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "{1..$(_ncpus)}" -- "$cur") ) return ;; --confidence) local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," - COMPREPLY=( $( compgen -W "HIGH INFERENCE INFERENCE_FAILURE - UNDEFINED" -- "${cur##*,}" ) ) + COMPREPLY=( $(compgen -W "HIGH INFERENCE INFERENCE_FAILURE + UNDEFINED" -- "${cur##*,}") ) [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} ) return ;; --format|-!(-*)f) - COMPREPLY=( $( compgen -W 'text parseable colorized json msvs' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'text parseable colorized json msvs' \ + -- "$cur") ) return ;; --import-graph|--ext-import-graph|--int-import-graph) @@ -70,8 +70,8 @@ _pylint() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W \ - '$( _parse_help "$1" --long-help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$(_parse_help "$1" --long-help)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/pytest b/completions/pytest index a53dad6054c..9239766cffd 100644 --- a/completions/pytest +++ b/completions/pytest @@ -10,24 +10,24 @@ _pytest() return ;; --import-mode) - COMPREPLY=( $( compgen -W "prepend append" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "prepend append" -- "$cur") ) return ;; --capture) - COMPREPLY=( $( compgen -W "fd sys no" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "fd sys no" -- "$cur") ) return ;; --tb) - COMPREPLY=( $( compgen -W "auto long short line native no" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "auto long short line native no" \ + -- "$cur") ) return ;; --color) - COMPREPLY=( $( compgen -W "yes no auto" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "yes no auto" -- "$cur") ) return ;; --pastebin) - COMPREPLY=( $( compgen -W "failed all" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "failed all" -- "$cur") ) return ;; --junit-xml) @@ -47,7 +47,7 @@ _pytest() return ;; --assert) - COMPREPLY=( $( compgen -W "plain reinterp rewrite" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "plain reinterp rewrite" -- "$cur") ) return ;; --genscript) @@ -59,14 +59,14 @@ _pytest() return ;; --numprocesses|-!(-*)n) - COMPREPLY=( $( compgen -W "{1..$(_ncpus)} auto" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "{1..$(_ncpus)} auto" -- "$cur") ) return ;; --dist) - local modes=$( "$1" --dist=nonexistent-distmode 2>&1 | \ + local modes=$("$1" --dist=nonexistent-distmode 2>&1 | \ command sed -e 's/[^[:space:][:alnum:]-]\{1,\}//g' \ - -ne 's/.*choose from //p' ) - COMPREPLY=( $( compgen -W '$modes' -- "$cur" ) ) + -ne 's/.*choose from //p') + COMPREPLY=( $(compgen -W '$modes' -- "$cur") ) return ;; esac @@ -74,7 +74,7 @@ _pytest() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/python b/completions/python index 5307fbb2d68..c3690d825d3 100644 --- a/completions/python +++ b/completions/python @@ -2,15 +2,15 @@ _python_modules() { - COMPREPLY+=( $( compgen -W \ - "$( ${1:-python} ${BASH_SOURCE[0]%/*}/../helpers/python $cur \ - 2>/dev/null )" -- "$cur" ) ) + COMPREPLY+=( $(compgen -W \ + "$(${1:-python} ${BASH_SOURCE[0]%/*}/../helpers/python $cur \ + 2>/dev/null)" -- "$cur") ) } _python_warning_actions() { - COMPREPLY+=( $( compgen -W "ignore default all module once error" \ - ${prefix:+-P "$prefix"} -- "$cur" ) ) + COMPREPLY+=( $(compgen -W "ignore default all module once error" \ + ${prefix:+-P "$prefix"} -- "$cur") ) } _python() @@ -35,8 +35,8 @@ _python() return ;; -!(-*)Q) - COMPREPLY=( $( compgen -W "old new warn warnall" -P "$prefix" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "old new warn warnall" -P "$prefix" \ + -- "$cur") ) return ;; -!(-*)W) @@ -45,7 +45,7 @@ _python() ;; --jit) # TODO: quite a few others, parse from "--jit help" output? - COMPREPLY=( $( compgen -W "help off" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "help off" -- "$cur") ) return ;; !(?(*/)python*([0-9.])|?(*/)pypy*([0-9.])|-?)) @@ -60,7 +60,7 @@ _python() elif [[ "$cur" != -* ]]; then _filedir 'py?([cowz])' else - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) fi } && complete -F _python python python2 python3 pypy pypy3 micropython diff --git a/completions/qdbus b/completions/qdbus index dee0760a952..9a22e80007a 100644 --- a/completions/qdbus +++ b/completions/qdbus @@ -6,8 +6,8 @@ _qdbus() _init_completion || return [[ -n $cur ]] && unset "words[$((${#words[@]}-1))]" - COMPREPLY=( $( compgen -W '$( command ${words[@]} 2>/dev/null | \ - command sed "s/(.*)//" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(command ${words[@]} 2>/dev/null | \ + command sed "s/(.*)//")' -- "$cur") ) } && complete -F _qdbus qdbus dcop diff --git a/completions/qemu b/completions/qemu index 724e7a5f4d1..8602cebdc17 100644 --- a/completions/qemu +++ b/completions/qemu @@ -16,79 +16,78 @@ _qemu() return ;; -boot) - COMPREPLY=( $( compgen -W 'a c d n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'a c d n' -- "$cur") ) return ;; -k) - COMPREPLY=( $( compgen -W 'ar de-ch es fo fr-ca hu ja mk no pt-br + COMPREPLY=( $(compgen -W 'ar de-ch es fo fr-ca hu ja mk no pt-br sv da en-gb et fr fr-ch is lt nl pl ru th de en-us fi fr-be hr - it lv nl-be pt sl tr' -- "$cur" ) ) + it lv nl-be pt sl tr' -- "$cur") ) return ;; -soundhw) - COMPREPLY=( $( compgen -W "$( $1 -soundhw ? | awk \ - '/^[[:lower:]]/ {print $1}' ) all" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 -soundhw ? | awk \ + '/^[[:lower:]]/ {print $1}') all" -- "$cur") ) return ;; -M) - COMPREPLY=( $( compgen -W "$( $1 -M ? | awk \ - '/^[[:lower:]]/ {print $1}' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 -M ? | awk \ + '/^[[:lower:]]/ {print $1}')" -- "$cur") ) return ;; -cpu) - COMPREPLY=( $( compgen -W "$( $1 -cpu ? | awk \ - '{print $2}' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 -cpu ? | awk '{print $2}')" \ + -- "$cur") ) return ;; -usbdevice) - COMPREPLY=( $( compgen -W 'mouse tablet disk: host: serial: braille - net' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'mouse tablet disk: host: serial: braille + net' -- "$cur") ) return ;; -net) - COMPREPLY=( $( compgen -W 'nic user tap socket vde none dump' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'nic user tap socket vde none dump' \ + -- "$cur") ) return ;; -serial|-parallel|-monitor) - COMPREPLY=( $( compgen -W 'vc pty none null /dev/ file: stdio pipe: - COM udp: tcp: telnet: unix: mon: braille' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'vc pty none null /dev/ file: stdio pipe: + COM udp: tcp: telnet: unix: mon: braille' -- "$cur") ) return ;; -redir) - COMPREPLY=( $( compgen -S":" -W 'tcp udp' -- "$cur" ) ) + COMPREPLY=( $(compgen -S":" -W 'tcp udp' -- "$cur") ) return ;; -bt) - COMPREPLY=( $( compgen -W 'hci vhci device' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'hci vhci device' -- "$cur") ) return ;; -vga) - COMPREPLY=( $( compgen -W 'cirrus std vmware xenfb none' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'cirrus std vmware xenfb none' -- "$cur") ) return ;; -drive) - COMPREPLY=( $( compgen -S"=" -W 'file if bus unit index media cyls - snapshot cache format serial addr' -- "$cur" ) ) + COMPREPLY=( $(compgen -S"=" -W 'file if bus unit index media cyls + snapshot cache format serial addr' -- "$cur") ) return ;; -balloon) - COMPREPLY=( $( compgen -W 'none virtio' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'none virtio' -- "$cur") ) return ;; -smbios) - COMPREPLY=( $( compgen -W 'file type' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'file type' -- "$cur") ) return ;; -watchdog) - COMPREPLY=( $( compgen -W "$( $1 -watchdog ? 2>&1 | \ - awk '{print $1}' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 -watchdog ? 2>&1 | \ + awk '{print $1}')" -- "$cur") ) return ;; -watchdog-action) - COMPREPLY=( $( compgen -W 'reset shutdown poweroff pause debug - none' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'reset shutdown poweroff pause debug + none' -- "$cur") ) return ;; -runas) @@ -99,8 +98,8 @@ _qemu() if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help ) -fd{a,b} - -hd{a..d}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help) -fd{a,b} + -hd{a..d}' -- "$cur") ) else _filedir fi diff --git a/completions/qrunner b/completions/qrunner index 4e02a175da1..b0421a09747 100644 --- a/completions/qrunner +++ b/completions/qrunner @@ -8,8 +8,8 @@ _qrunner() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--runner --once --list --verbose --subproc - --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--runner --once --list --verbose --subproc + --help' -- "$cur") ) fi } && diff --git a/completions/querybts b/completions/querybts index 11ae4cea6b2..69c5aa08e85 100644 --- a/completions/querybts +++ b/completions/querybts @@ -7,17 +7,17 @@ _querybts() case $prev in --bts|-!(-*)B) - COMPREPLY=( $( compgen -W "debian guug kde mandrake help" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "debian guug kde mandrake help" \ + -- "$cur") ) return ;; --ui|--interface|-!(-*)u) - COMPREPLY=( $( compgen -W "newt text gnome" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "newt text gnome" -- "$cur") ) return ;; --mbox-reader-cmd) compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=( $(compgen -c -- "$cur") ) return ;; esac @@ -25,14 +25,14 @@ _querybts() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else - COMPREPLY=( $( compgen -W 'wnpp boot-floppies kernel bugs.debian.org + COMPREPLY=( $(compgen -W 'wnpp boot-floppies kernel bugs.debian.org cdimage.debian.org general installation-reports listarchives lists.debian.org mirrors nm.debian.org press project qa.debian.org release-notes security.debian.org tech-ctte upgrade-reports - www.debian.org $( apt-cache pkgnames 2>/dev/null )' -- "$cur" ) ) + www.debian.org $(apt-cache pkgnames 2>/dev/null)' -- "$cur") ) fi } && complete -F _querybts querybts diff --git a/completions/quota b/completions/quota index c1604f8e7f0..01e14509b12 100644 --- a/completions/quota +++ b/completions/quota @@ -7,34 +7,34 @@ _user_or_group() # complete on groups if -g was given for (( i=1; i < cword; i++ )); do if [[ "${words[i]}" == -@(g|-group) ]]; then - COMPREPLY=( $( compgen -g -- "$cur" ) ) + COMPREPLY=( $(compgen -g -- "$cur") ) return fi done # otherwise complete on users - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) } _quota_parse_help() { - local opts=$( _parse_help "$1" ) - [[ $opts ]] || opts=$( _parse_usage "$1" ) # non-GNU? - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + local opts=$(_parse_help "$1") + [[ $opts ]] || opts=$(_parse_usage "$1") # non-GNU? + COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace } _quota_formats() { - COMPREPLY=( $( compgen -W 'vfsold vfsv0 rpc xfs' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'vfsold vfsv0 rpc xfs' -- "$cur") ) } _filesystems() { # Only list filesystems starting with "/", otherwise we also get #+ "binfmt_misc", "proc", "tmpfs", ... - COMPREPLY=( $( compgen -W "$(awk '/^\// {print $1}' /etc/mtab)" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(awk '/^\// {print $1}' /etc/mtab)" \ + -- "$cur") ) } _quota() @@ -171,7 +171,7 @@ _quotaon() return ;; -x|--xfs-command) - COMPREPLY=( $( compgen -W 'delete enforce' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'delete enforce' -- "$cur") ) return ;; -h|--help|-V|--version) diff --git a/completions/radvdump b/completions/radvdump index 7280a7a1a96..469c8f12bec 100644 --- a/completions/radvdump +++ b/completions/radvdump @@ -10,12 +10,12 @@ _radvdump() return ;; -d|--debug) - COMPREPLY=( $( compgen -W '{1..4}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{1..4}' -- "$cur") ) return ;; esac - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) } && complete -F _radvdump radvdump diff --git a/completions/rcs b/completions/rcs index d63fe170c84..41b953df4c9 100644 --- a/completions/rcs +++ b/completions/rcs @@ -13,7 +13,7 @@ _rcs() # deal with relative directory [[ $file == $dir ]] && dir=. - COMPREPLY=( $( compgen -f -- "$dir/RCS/$file" ) ) + COMPREPLY=( $(compgen -f -- "$dir/RCS/$file") ) for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do file=${COMPREPLY[$i]##*/} @@ -21,7 +21,7 @@ _rcs() COMPREPLY[$i]=$dir$file done - COMPREPLY+=( $( compgen -G "$dir/$file*,v" ) ) + COMPREPLY+=( $(compgen -G "$dir/$file*,v") ) for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do COMPREPLY[$i]=${COMPREPLY[$i]%,v} diff --git a/completions/rdesktop b/completions/rdesktop index 7f567b290b5..5226a123b89 100644 --- a/completions/rdesktop +++ b/completions/rdesktop @@ -7,33 +7,33 @@ _rdesktop() case $prev in -*k) - COMPREPLY=( $( command ls \ + COMPREPLY=( $(command ls \ /usr/share/rdesktop/keymaps 2>/dev/null | \ - command grep -E -v '(common|modifiers)' ) ) - COMPREPLY+=( $( command ls $HOME/.rdesktop/keymaps 2>/dev/null ) ) - COMPREPLY+=( $( command ls ./keymaps 2>/dev/null ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) + command grep -E -v '(common|modifiers)') ) + COMPREPLY+=( $(command ls $HOME/.rdesktop/keymaps 2>/dev/null) ) + COMPREPLY+=( $(command ls ./keymaps 2>/dev/null) ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") ) return ;; -*a) - COMPREPLY=( $( compgen -W '8 15 16 24' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '8 15 16 24' -- "$cur") ) return ;; -*x) - COMPREPLY=( $( compgen -W 'broadband modem lan' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'broadband modem lan' -- "$cur") ) return ;; -*r) case $cur in sound:*) - COMPREPLY=( $( compgen -W 'local off remote' \ - -- "${cur#sound:}" ) ) + COMPREPLY=( $(compgen -W 'local off remote' \ + -- "${cur#sound:}") ) ;; *:*) ;; *) - COMPREPLY=( $( compgen -W 'comport: disk: lptport: - printer: sound: lspci scard' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'comport: disk: lptport: + printer: sound: lspci scard' -- "$cur") ) [[ $COMPREPLY == *: ]] && compopt -o nospace ;; esac @@ -45,8 +45,8 @@ _rdesktop() esac if [[ "$cur" == -* ]]; then - local opts=( $( _parse_help "$1" ) ) - COMPREPLY=( $( compgen -W '${opts[@]%:}' -- "$cur" ) ) + local opts=( $(_parse_help "$1") ) + COMPREPLY=( $(compgen -W '${opts[@]%:}' -- "$cur") ) else _known_hosts_real -- "$cur" fi diff --git a/completions/remove_members b/completions/remove_members index 66dbfda6770..c22286f106c 100644 --- a/completions/remove_members +++ b/completions/remove_members @@ -15,8 +15,8 @@ _remove_members() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--file --all --fromall --nouserack - --noadminack --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--file --all --fromall --nouserack + --noadminack --help' -- "$cur") ) else _xfunc list_lists _mailman_lists fi diff --git a/completions/removepkg b/completions/removepkg index eaeb70a7983..035efecb2e8 100644 --- a/completions/removepkg +++ b/completions/removepkg @@ -5,7 +5,7 @@ _removepkg() local cur prev words cword _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-copy -keep -preserve -warn' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-copy -keep -preserve -warn' -- "$cur") ) return fi @@ -15,8 +15,8 @@ _removepkg() fi local root=${ROOT:-/} - COMPREPLY=( $( cd "$root/var/log/packages" 2> /dev/null || return 1; \ - compgen -f -- "$cur" ) ) + COMPREPLY=( $(cd "$root/var/log/packages" 2> /dev/null || return 1; \ + compgen -f -- "$cur") ) } && complete -F _removepkg removepkg diff --git a/completions/reportbug b/completions/reportbug index 6a07e2a626e..f5eaadf3ba6 100644 --- a/completions/reportbug +++ b/completions/reportbug @@ -18,17 +18,17 @@ _reportbug() return ;; --keyid|-!(-*)K) - COMPREPLY=( $( compgen -W '$( IFS=: ; \ + COMPREPLY=( $(compgen -W '$(IFS=: ; \ gpg --list-keys --with-colons 2>/dev/null \ | while read -ra row ; do [[ "${row[0]}" == [ps]ub && ${row[11]} == *s* ]] && \ printf "%s\n" "${row[4]}" - done )' -- "$cur" ) ) + done)' -- "$cur") ) return ;; --bts|-!(-*)B) - COMPREPLY=( $( compgen -W "debian guug kde mandrake help" -- \ - "$cur" ) ) + COMPREPLY=( $(compgen -W "debian guug kde mandrake help" -- \ + "$cur") ) return ;; --editor|--mua|--mbox-reader-cmd|-!(-*)e) @@ -38,33 +38,33 @@ _reportbug() return ;; --mode) - COMPREPLY=( $( compgen -W "novice standard expert" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "novice standard expert" -- "$cur") ) return ;; --severity|-!(-*)S) - COMPREPLY=( $( compgen -W "grave serious important normal minor - wishlist" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "grave serious important normal minor + wishlist" -- "$cur") ) return ;; --ui|--interface|-!(-*)u) - COMPREPLY=( $( compgen -W "newt text gnome" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "newt text gnome" -- "$cur") ) return ;; --type|-!(-*)t) - COMPREPLY=( $( compgen -W "gnats debbugs" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "gnats debbugs" -- "$cur") ) return ;; --tag|-!(-*)T) - COMPREPLY=( $( compgen -W "none woody potato sarge sarge-ignore + COMPREPLY=( $(compgen -W "none woody potato sarge sarge-ignore etch etch-ignore lenny lenny-ignore sid experimental confirmed d-i fixed fixed-in-experimental fixed-upstream help l10n moreinfo patch pending security unreproducible upstream wontfix - ipv6 lfs" -- "$cur" ) ) + ipv6 lfs" -- "$cur") ) return ;; --from-buildd) - COMPREPLY=( $( compgen -S "_" -W '$( apt-cache dumpavail | \ - command grep "^Source: $cur" | sort -u | cut -f2 -d" " )' )) + COMPREPLY=( $(compgen -S "_" -W '$(apt-cache dumpavail | \ + command grep "^Source: $cur" | sort -u | cut -f2 -d" ")') ) return ;; --smtphost) @@ -80,16 +80,16 @@ _reportbug() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == -*= ]] && compopt -o nospace return fi - COMPREPLY=( $( compgen -W 'wnpp boot-floppies kernel bugs.debian.org + COMPREPLY=( $(compgen -W 'wnpp boot-floppies kernel bugs.debian.org cdimage.debian.org general installation-reports listarchives lists.debian.org mirrors nm.debian.org press project qa.debian.org release-notes security.debian.org tech-ctte upgrade-reports - www.debian.org $( apt-cache pkgnames 2>/dev/null )' -- "$cur" ) ) + www.debian.org $(apt-cache pkgnames 2>/dev/null)' -- "$cur") ) _filedir } && complete -F _reportbug reportbug diff --git a/completions/resolvconf b/completions/resolvconf index 1902e7d1384..b4659612b47 100644 --- a/completions/resolvconf +++ b/completions/resolvconf @@ -13,7 +13,7 @@ _resolvconf() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-a -d -u' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-a -d -u' -- "$cur") ) fi } && complete -F _resolvconf resolvconf diff --git a/completions/ri b/completions/ri index 50658932abc..60c6462a0de 100644 --- a/completions/ri +++ b/completions/ri @@ -15,20 +15,20 @@ _ri_get_methods() fi COMPREPLY+=( \ - "$( ri ${classes[@]} 2>/dev/null | ruby -ane \ + "$(ri ${classes[@]} 2>/dev/null | ruby -ane \ 'if /^'"$regex"' methods:/.../^------------------|^$/ and \ /^ / then print $_.split(/, |,$/).grep(/^[^\[]*$/).join("\n"); \ - end' 2>/dev/null | sort -u )" ) + end' 2>/dev/null | sort -u)" ) else # older versions of ri didn't distinguish between class/module and # instance methods COMPREPLY+=( \ - "$( ruby -W0 $ri_path ${classes[@]} | ruby -ane \ + "$(ruby -W0 $ri_path ${classes[@]} | ruby -ane \ 'if /^-/.../^-/ and ! /^-/ and ! /^ +(class|module): / then \ print $_.split(/, |,$| +/).grep(/^[^\[]*$/).join("\n"); \ - end' | sort -u )" ) + end' | sort -u)" ) fi - COMPREPLY=( $( compgen $prefix -W '${COMPREPLY[@]}' -- $method ) ) + COMPREPLY=( $(compgen $prefix -W '${COMPREPLY[@]}' -- $method) ) } # needs at least Ruby 1.8.0 in order to use -W0 @@ -42,7 +42,7 @@ _ri() return ;; --format|-!(-*)f) - COMPREPLY=( $( compgen -W 'ansi bs html rdoc' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'ansi bs html rdoc' -- "$cur") ) return ;; --doc-dir|-!(-*)d) @@ -58,7 +58,7 @@ _ri() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi @@ -89,21 +89,21 @@ _ri() if [[ $ri_version == integrated ]]; then # integrated ri from Ruby 1.9 - classes=( $( ri -c 2>/dev/null | ruby -ne 'if /^\s*$/..$stdin.eof then \ - if /^ +[A-Z]/ then print; end; end' 2>/dev/null ) ) + classes=( $(ri -c 2>/dev/null | ruby -ne 'if /^\s*$/..$stdin.eof then \ + if /^ +[A-Z]/ then print; end; end' 2>/dev/null) ) elif [[ $ri_major && $ri_major -ge 3 ]]; then - classes=( $( ri -l 2>/dev/null ) ) + classes=( $(ri -l 2>/dev/null) ) elif [[ $ri_version == "ri 1.8a" ]]; then - classes=( $( ruby -W0 $ri_path | \ + classes=( $(ruby -W0 $ri_path | \ ruby -ne 'if /^'"'"'ri'"'"' has/..$stdin.eof then \ - if /^ .*[A-Z]/ then print; end; end' )) + if /^ .*[A-Z]/ then print; end; end') ) else - classes=( $( ruby -W0 $ri_path | \ + classes=( $(ruby -W0 $ri_path | \ ruby -ne 'if /^I have/..$stdin.eof then \ - if /^ .*[A-Z]/ then print; end; end' )) + if /^ .*[A-Z]/ then print; end; end') ) fi - COMPREPLY=( $( compgen -W '${classes[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${classes[@]}' -- "$cur") ) __ltrim_colon_completions "$cur" if [[ "$cur" == [A-Z]* ]]; then diff --git a/completions/rmlist b/completions/rmlist index ff827473c0b..d096352cd6c 100644 --- a/completions/rmlist +++ b/completions/rmlist @@ -6,7 +6,7 @@ _rmlist() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--archives --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--archives --help' -- "$cur") ) else _xfunc list_lists _mailman_lists fi diff --git a/completions/rmmod b/completions/rmmod index 9868c79a0d9..12f2334e6b7 100644 --- a/completions/rmmod +++ b/completions/rmmod @@ -13,7 +13,7 @@ _rmmod() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi diff --git a/completions/route b/completions/route index 128ebc1690e..a7c06d6d75a 100644 --- a/completions/route +++ b/completions/route @@ -23,7 +23,7 @@ _route() $found || COMPREPLY[${#COMPREPLY[@]}]="$opt" done - COMPREPLY=( $( compgen -W '"${COMPREPLY[@]}"' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '"${COMPREPLY[@]}"' -- "$cur") ) } && complete -F _route route diff --git a/completions/rpcdebug b/completions/rpcdebug index e4358dc6941..ce4f937280b 100644 --- a/completions/rpcdebug +++ b/completions/rpcdebug @@ -12,8 +12,8 @@ _rpcdebug_flags() done if [[ -n $module ]]; then - COMPREPLY=( $( compgen -W "$( rpcdebug -vh 2>&1 | \ - command sed -ne 's/^'$module'[[:space:]]\{1,\}//p' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(rpcdebug -vh 2>&1 | \ + command sed -ne 's/^'$module'[[:space:]]\{1,\}//p')" -- "$cur") ) fi } @@ -32,14 +32,13 @@ _rpcdebug() return ;; -*m) - COMPREPLY=( $( compgen -W 'rpc nfs nfsd nlm' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'rpc nfs nfsd nlm' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" -h ) -s -c' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" -h) -s -c' -- "$cur") ) fi } && complete -F _rpcdebug rpcdebug diff --git a/completions/rpm b/completions/rpm index e42fbd720e6..7294b60661f 100644 --- a/completions/rpm +++ b/completions/rpm @@ -7,38 +7,38 @@ _rpm_installed_packages() if [[ -r /var/log/rpmpkgs && \ /var/log/rpmpkgs -nt /var/lib/rpm/Packages ]]; then # using RHL 7.2 or later - this is quicker than querying the DB - COMPREPLY=( $( compgen -W "$( command sed -ne \ + COMPREPLY=( $(compgen -W "$(command sed -ne \ 's|^\([^[:space:]]\{1,\}\)-[^[:space:]-]\{1,\}-[^[:space:]-]\{1,\}\.rpm$|\1|p' \ - /var/log/rpmpkgs )" -- "$cur" ) ) + /var/log/rpmpkgs)" -- "$cur") ) elif type rpmqpack &>/dev/null ; then # SUSE's rpmqpack is faster than rpm -qa - COMPREPLY=( $( compgen -W '$( rpmqpack )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(rpmqpack)' -- "$cur") ) else - COMPREPLY=( $( ${1:-rpm} -qa --nodigest --nosignature \ - --queryformat='%{NAME} ' "$cur*" 2>/dev/null ) ) + COMPREPLY=( $(${1:-rpm} -qa --nodigest --nosignature \ + --queryformat='%{NAME} ' "$cur*" 2>/dev/null) ) fi } _rpm_groups() { local IFS=$'\n' - COMPREPLY=( $( compgen -W "$( ${1:-rpm} -qa --nodigest --nosignature \ - --queryformat='%{GROUP}\n' 2>/dev/null )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(${1:-rpm} -qa --nodigest --nosignature \ + --queryformat='%{GROUP}\n' 2>/dev/null)" -- "$cur") ) } _rpm_macros() { # get a list of macros - COMPREPLY=( $( compgen -W "$( ${1:-rpm} --showrc | command sed -ne \ - 's/^-\{0,1\}[0-9]\{1,\}[:=][[:space:]]\{1,\}\([^[:space:](]\{3,\}\).*/%\1/p' )" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(${1:-rpm} --showrc | command sed -ne \ + 's/^-\{0,1\}[0-9]\{1,\}[:=][[:space:]]\{1,\}\([^[:space:](]\{3,\}\).*/%\1/p')" \ + -- "$cur") ) } _rpm_buildarchs() { - COMPREPLY=( $( compgen -W "$( ${1:-rpm} --showrc | command sed -ne \ - 's/^\s*compatible\s\s*build\s\s*archs\s*:\s*\(.*\)/\1/ p' )" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(${1:-rpm} --showrc | command sed -ne \ + 's/^\s*compatible\s\s*build\s\s*archs\s*:\s*\(.*\)/\1/ p')" \ + -- "$cur") ) } # rpm(8) completion @@ -52,15 +52,14 @@ _rpm() # first parameter on line case $cur in --*) - COMPREPLY=( $( compgen -W '--help --version --initdb + COMPREPLY=( $(compgen -W '--help --version --initdb --checksig --addsign --delsign --rebuilddb --showrc --setperms --setugids --eval --install --upgrade --query --freshen --erase --verify --querytags --import' \ - -- "$cur" ) ) + -- "$cur") ) ;; *) - COMPREPLY=( $( compgen -W '-e -E -F -i -q -t -U -V' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-e -E -F -i -q -t -U -V' -- "$cur") ) ;; esac return @@ -77,7 +76,7 @@ _rpm() ;; --pipe) compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=( $(compgen -c -- "$cur") ) return ;; --rcfile) @@ -104,9 +103,9 @@ _rpm() *suggests) fmt=SUGGESTNAME ;; *supplements) fmt=SUPPLEMENTNAME ;; esac - COMPREPLY=( $( compgen -W "$( $1 -qa --nodigest --nosignature \ + COMPREPLY=( $(compgen -W "$($1 -qa --nodigest --nosignature \ --queryformat=\"%{$fmt}\\n\" 2>/dev/null | - command grep -vF '(none)' )" -- "$cur" ) ) + command grep -vF '(none)')" -- "$cur") ) fi return ;; @@ -125,21 +124,21 @@ _rpm() case ${words[1]} in -[iFU]*|--install|--freshen|--upgrade) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --percent --force --test + COMPREPLY=( $(compgen -W "$opts --percent --force --test --replacepkgs --replacefiles --root --excludedocs --includedocs --noscripts --ignorearch --dbpath --prefix= --ignoreos --nodeps --allfiles --ftpproxy --ftpport --justdb --httpproxy --httpport --noorder --relocate= --badreloc --notriggers --excludepath= --ignoresize --oldpackage --queryformat --repackage - --nosuggests" -- "$cur" ) ) + --nosuggests" -- "$cur") ) else _filedir '[rs]pm' fi ;; -e|--erase) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --allmatches --noscripts - --notriggers --nodeps --test --repackage" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$opts --allmatches --noscripts + --notriggers --nodeps --test --repackage" -- "$cur") ) else _rpm_installed_packages $1 fi @@ -156,8 +155,8 @@ _rpm() if [[ ${words[@]} == *\ -@(*([^ -])f|-file )* ]]; then # -qf completion if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --dbpath --fscontext - --last --root --state" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$opts --dbpath --fscontext + --last --root --state" -- "$cur") ) else _filedir fi @@ -167,21 +166,21 @@ _rpm() elif [[ ${words[@]} == *\ -@(*([^ -])p|-package )* ]]; then # -qp; uninstalled package completion if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --ftpport --ftpproxy - --httpport --httpproxy --nomanifest" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$opts --ftpport --ftpproxy + --httpport --httpproxy --nomanifest" -- "$cur") ) else _filedir '[rs]pm' fi else # -q; installed package completion if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --all --file --fileid + COMPREPLY=( $(compgen -W "$opts --all --file --fileid --dbpath --fscontext --ftswalk --group --hdrid --last --package --pkgid --root= --specfile --state --triggeredby --whatenhances --whatprovides --whatrecommends --whatrequires --whatsuggests --whatsupplements" \ - -- "$cur" ) ) + -- "$cur") ) elif [[ ${words[@]} != *\ -@(*([^ -])a|-all )* ]]; then _rpm_installed_packages $1 fi @@ -189,20 +188,20 @@ _rpm() ;; -K*|--checksig) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --nopgp --nogpg --nomd5" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$opts --nopgp --nogpg --nomd5" \ + -- "$cur") ) else _filedir '[rs]pm' fi ;; -[Vy]*|--verify) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --root= --dbpath --nodeps + COMPREPLY=( $(compgen -W "$opts --root= --dbpath --nodeps --nogroup --nolinkto --nomode --nomtime --nordev --nouser --nofiles --noscripts --nomd5 --querytags --specfile --whatenhances --whatprovides --whatrecommends --whatrequires --whatsuggests --whatsupplements" \ - -- "$cur" ) ) + -- "$cur") ) # check whether we're doing file completion elif [[ ${words[@]} == *\ -@(*([^ -])f|-file )* ]]; then _filedir @@ -222,8 +221,8 @@ _rpm() ;; --import|--dbpath|--root) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--import --dbpath --root=' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--import --dbpath --root=' \ + -- "$cur") ) else _filedir fi @@ -259,10 +258,10 @@ _rpmbuild() return ;; --buildpolicy) - local cfgdir=$( $rpm --eval '%{_rpmconfigdir}' 2>/dev/null ) + local cfgdir=$($rpm --eval '%{_rpmconfigdir}' 2>/dev/null) if [[ $cfgdir ]]; then - COMPREPLY=( $( compgen -W "$( command ls $cfgdir 2>/dev/null \ - | command sed -ne 's/^brp-//p' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(command ls $cfgdir 2>/dev/null \ + | command sed -ne 's/^brp-//p')" -- "$cur") ) fi ;; --define|--with|--without|-!(-*)D) @@ -273,7 +272,7 @@ _rpmbuild() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W "$( _parse_help "$1" )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(_parse_help "$1")" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/rpm2tgz b/completions/rpm2tgz index abdf321bf22..da4b7e5e8d7 100644 --- a/completions/rpm2tgz +++ b/completions/rpm2tgz @@ -6,7 +6,7 @@ _rpm2tgz() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-s -S -n -r -d -c' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-s -S -n -r -d -c' -- "$cur") ) return fi diff --git a/completions/rpmcheck b/completions/rpmcheck index 565f1313b3b..f8577c4e2db 100644 --- a/completions/rpmcheck +++ b/completions/rpmcheck @@ -13,8 +13,8 @@ _rpmcheck() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-explain -failures -successes -dump - -dump-all -base -help -compressed-input' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-explain -failures -successes -dump + -dump-all -base -help -compressed-input' -- "$cur") ) else _filedir fi diff --git a/completions/rrdtool b/completions/rrdtool index 705be0d0dbb..c8214a49acf 100644 --- a/completions/rrdtool +++ b/completions/rrdtool @@ -6,8 +6,8 @@ _rrdtool () _init_completion || return if [[ ${#words[@]} -eq 2 ]]; then - COMPREPLY=( $( compgen -W 'create update updatev graph dump restore - last lastupdate first info fetch tune resize xport' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'create update updatev graph dump restore + last lastupdate first info fetch tune resize xport' -- "$cur") ) else _filedir rrd fi diff --git a/completions/rsync b/completions/rsync index 55a2a859a7f..03495244635 100644 --- a/completions/rsync +++ b/completions/rsync @@ -20,12 +20,12 @@ _rsync() ;; --rsh|-!(-*)e) compopt +o nospace - COMPREPLY=( $( compgen -W 'rsh ssh' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'rsh ssh' -- "$cur") ) return ;; --compress-level) compopt +o nospace - COMPREPLY=( $( compgen -W '{1..9}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{1..9}' -- "$cur") ) return ;; esac @@ -36,7 +36,7 @@ _rsync() case $cur in -*) - COMPREPLY=( $( compgen -W '--verbose --quiet --no-motd --checksum + COMPREPLY=( $(compgen -W '--verbose --quiet --no-motd --checksum --archive --recursive --relative --no-implied-dirs --backup --backup-dir= --suffix= --update --inplace --append --append-verify --dirs --old-dirs --links --copy-links @@ -61,7 +61,7 @@ _rsync() --out-format= --log-file= --log-file-format= --password-file= --list-only --bwlimit= --write-batch= --only-write-batch= --read-batch= --protocol= --iconv= --ipv4 --ipv6 --version - --help --daemon --config= --no-detach' -- "$cur" ) ) + --help --daemon --config= --no-detach' -- "$cur") ) [[ $COMPREPLY == *= ]] || compopt +o nospace ;; *:*) diff --git a/completions/sbcl b/completions/sbcl index 3db4a39ac1b..a8dd5345bee 100644 --- a/completions/sbcl +++ b/completions/sbcl @@ -9,9 +9,9 @@ _sbcl() # completing an option (may or may not be separated by a space) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--core --noinform --help --version + COMPREPLY=( $(compgen -W '--core --noinform --help --version --sysinit --userinit --eval --noprint --disable-debugger - --end-runtime-options --end-toplevel-options ' -- "$cur" ) ) + --end-runtime-options --end-toplevel-options ' -- "$cur") ) else _filedir fi diff --git a/completions/sbopkg b/completions/sbopkg index e5742af6bd4..1504a54e60c 100644 --- a/completions/sbopkg +++ b/completions/sbopkg @@ -6,13 +6,13 @@ _sbopkg() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) [[ $COMPREPLY ]] && return fi case "$prev" in -e) - COMPREPLY=( $( compgen -W 'ask continue stop' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'ask continue stop' -- "$cur") ) return ;; -f) @@ -24,8 +24,8 @@ _sbopkg() return ;; -V) - COMPREPLY=( $( compgen -W "? - $( sbopkg -V ? 2>&1 | cut -s -f1 )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "? + $(sbopkg -V ? 2>&1 | cut -s -f1)" -- "$cur") ) return ;; -i|-b) @@ -61,9 +61,9 @@ _sbopkg() done [[ -r $REPO_ROOT/$REPO_NAME/$REPO_BRANCH/SLACKBUILDS.TXT ]] || return - COMPREPLY=( $( command sed -ne "/^SLACKBUILD NAME: $cur/{s/^SLACKBUILD NAME: //;p}"\ - $REPO_ROOT/$REPO_NAME/$REPO_BRANCH/SLACKBUILDS.TXT ) - $( cd $QUEUEDIR; compgen -f -X "!*.sqf" -- "$cur" ) ) + COMPREPLY=( $(command sed -ne "/^SLACKBUILD NAME: $cur/{s/^SLACKBUILD NAME: //;p}"\ + $REPO_ROOT/$REPO_NAME/$REPO_BRANCH/SLACKBUILDS.TXT) + $(cd $QUEUEDIR; compgen -f -X "!*.sqf" -- "$cur") ) } && complete -F _sbopkg sbopkg diff --git a/completions/screen b/completions/screen index eb4b62394fe..09b72027efa 100644 --- a/completions/screen +++ b/completions/screen @@ -2,11 +2,11 @@ _screen_sessions() { - local sessions=( $( command screen -ls | command sed -ne \ - 's|^\t\{1,\}\([0-9]\{1,\}\.[^\t]\{1,\}\).*'"$1"'.*$|\1|p' ) ) + local sessions=( $(command screen -ls | command sed -ne \ + 's|^\t\{1,\}\([0-9]\{1,\}\.[^\t]\{1,\}\).*'"$1"'.*$|\1|p') ) if [[ $cur == +([0-9])?(.*) ]]; then # Complete sessions including pid prefixes - COMPREPLY=( $( compgen -W '${sessions[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${sessions[@]}' -- "$cur") ) else # Create unique completions, dropping pids where possible local -A res @@ -17,7 +17,7 @@ _screen_sessions() for i in ${!res[@]}; do [[ ${res[$i]} == \ *\ * ]] && tmp+=" ${res[$i]}" || tmp+=" $i" done - COMPREPLY=( $( compgen -W '$tmp' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$tmp' -- "$cur") ) fi } && _screen() @@ -84,9 +84,9 @@ _screen() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-a -A -c -d -D -e -f -fn -fa -h -i -ln -list + COMPREPLY=( $(compgen -W '-a -A -c -d -D -e -f -fn -fa -h -i -ln -list -L -m -O -p -q -r -R -s -S -t -T -U -v -wipe -x -X --help - --version' -- "$cur" ) ) + --version' -- "$cur") ) fi } && complete -F _screen screen diff --git a/completions/scrub b/completions/scrub index 06c694be007..7fca6077a62 100644 --- a/completions/scrub +++ b/completions/scrub @@ -10,9 +10,9 @@ _scrub() return ;; --pattern|-!(-*)p) - COMPREPLY=( $( compgen -W '$( "$1" --help 2>&1 | - awk "/^Available/{flag=1;next}/^ /&&flag{print \$1}" )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$("$1" --help 2>&1 | + awk "/^Available/{flag=1;next}/^ /&&flag{print \$1}")' \ + -- "$cur") ) return ;; --freespace|-!(-*)X) @@ -24,7 +24,7 @@ _scrub() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/sh b/completions/sh index 2b0bcd138ed..93f00952be0 100644 --- a/completions/sh +++ b/completions/sh @@ -10,19 +10,19 @@ _sh() return ;; -o|+o) - COMPREPLY=( $( compgen -W 'allexport errexit ignoreeof monitor + COMPREPLY=( $(compgen -W 'allexport errexit ignoreeof monitor noclobber noglob noexec nolog notify nounset verbose vi - xtrace' -- "$cur" ) ) + xtrace' -- "$cur") ) return ;; esac local opts="-a -b -C -e -f -h -i -m -n -o -u -v -x" if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts -c -s" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$opts -c -s" -- "$cur") ) return elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W "${opts//-/+}" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "${opts//-/+}" -- "$cur") ) return fi diff --git a/completions/shellcheck b/completions/shellcheck index 027c57681eb..197c1811fa4 100644 --- a/completions/shellcheck +++ b/completions/shellcheck @@ -2,9 +2,9 @@ _shellcheck_optarg() { - local args=$( "$1" --help 2>&1 | \ - command sed -e 's/,/ /g' -ne 's/^.*'$2'\>.*(\([^)]*\)).*/\1/p' ) - COMPREPLY+=( $( compgen -W '$args' -- "$cur" ) ) + local args=$("$1" --help 2>&1 | \ + command sed -e 's/,/ /g' -ne 's/^.*'$2'\>.*(\([^)]*\)).*/\1/p') + COMPREPLY+=( $(compgen -W '$args' -- "$cur") ) } _shellcheck() @@ -20,10 +20,10 @@ _shellcheck() return ;; --format|-!(-*)f) - local args=$( "$1" --format=nonexistent-format /dev/null 2>&1 | \ + local args=$("$1" --format=nonexistent-format /dev/null 2>&1 | \ command sed -ne '/^Supported formats/,//p' | \ - command sed -ne '/^[[:space:]]/p' ) - COMPREPLY=( $( compgen -W '$args' -- "$cur" ) ) + command sed -ne '/^[[:space:]]/p') + COMPREPLY=( $(compgen -W '$args' -- "$cur") ) return ;; --color|-!(-*)C) @@ -39,7 +39,7 @@ _shellcheck() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/sitecopy b/completions/sitecopy index 6aae8f20834..dae0548d37e 100644 --- a/completions/sitecopy +++ b/completions/sitecopy @@ -10,8 +10,8 @@ _sitecopy() case $prev in --debug|-!(-*)d) - COMPREPLY=( $( compgen -W "socket files rcfile ftp http httpbody - rsh sftp xml xmlparse cleartext" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "socket files rcfile ftp http httpbody + rsh sftp xml xmlparse cleartext" -- "$cur") ) compopt -o nospace return ;; @@ -27,7 +27,7 @@ _sitecopy() case $cur in --*) - COMPREPLY=( $( compgen -W "$(_parse_help $1)" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(_parse_help $1)" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return ;; @@ -41,8 +41,8 @@ _sitecopy() esac if [[ -r ~/.sitecopyrc ]]; then - COMPREPLY=( $( compgen -W "$($1 -v | \ - command sed -n '/^Site:/s/Site: //p')" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 -v | \ + command sed -n '/^Site:/s/Site: //p')" -- "$cur") ) fi } && complete -F _sitecopy -o default sitecopy diff --git a/completions/slackpkg b/completions/slackpkg index 83396a4e0e8..6fdfd09fe84 100644 --- a/completions/slackpkg +++ b/completions/slackpkg @@ -16,11 +16,11 @@ _slackpkg() case "$prev" in -delall|-checkmd5|-checkgpg|-checksize|-postinst|-onoff|-download_all|\ -dialog|-batch|-only_new_dotnew|-use_includes|-spinning) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on off' -- "$cur") ) return ;; -default_answer) - COMPREPLY=( $( compgen -W 'yes no' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'yes no' -- "$cur") ) return ;; -dialog_maxargs|-mirror) @@ -33,10 +33,10 @@ _slackpkg() if [[ "$cur" == -* ]]; then compopt -o nospace - COMPREPLY=( $( compgen -W '-delall= -checkmd5= -checkgpg= + COMPREPLY=( $(compgen -W '-delall= -checkmd5= -checkgpg= -checksize= -postinst= -onoff= -download_all= -dialog= -dialog_maxargs= -batch= -only_new_dotnew= -use_includes= - -spinning= -default_answer= -mirror=' -- "$cur" ) ) + -spinning= -default_answer= -mirror=' -- "$cur") ) return fi @@ -61,42 +61,42 @@ _slackpkg() ;; install-template|remove-template) if [[ -e $confdir/templates ]]; then - COMPREPLY=( $( cd "$confdir/templates"; \ - compgen -f -X "!*.template" -- "$cur" ) ) + COMPREPLY=( $(cd "$confdir/templates"; \ + compgen -f -X "!*.template" -- "$cur") ) COMPREPLY=( ${COMPREPLY[@]%.template} ) fi return ;; remove) _filedir - COMPREPLY+=( $( compgen -W 'a ap d e f k kde kdei l n t tcl x - xap xfce y' -- "$cur" ) ) - COMPREPLY+=( $( cd /var/log/packages; compgen -f -- "$cur" ) ) + COMPREPLY+=( $(compgen -W 'a ap d e f k kde kdei l n t tcl x + 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 xfce y' -- "$cur" ) ) - COMPREPLY+=( $( cut -f 6 -d\ "${WORKDIR}/pkglist" 2> /dev/null | \ - command grep "^$cur" ) ) + COMPREPLY+=( $(compgen -W 'a ap d e f k kde kdei l n t tcl x + xap xfce y' -- "$cur") ) + COMPREPLY+=( $(cut -f 6 -d\ "${WORKDIR}/pkglist" 2> /dev/null | \ + command grep "^$cur") ) return ;; info) - COMPREPLY=( $( cut -f 6 -d\ "${WORKDIR}/pkglist" 2> /dev/null | \ - command grep "^$cur" ) ) + COMPREPLY=( $(cut -f 6 -d\ "${WORKDIR}/pkglist" 2> /dev/null | \ + command grep "^$cur") ) return ;; update) # we should complete the same as the next `list` + "gpg" - COMPREPLY=( $( compgen -W 'gpg' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'gpg' -- "$cur") ) ;& *) - COMPREPLY+=( $( compgen -W 'install reinstall upgrade remove + COMPREPLY+=( $(compgen -W 'install reinstall upgrade remove blacklist download update install-new upgrade-all clean-system new-config check-updates help generate-template install-template remove-template search file-search info' -- \ - "$cur" ) ) + "$cur") ) return ;; esac diff --git a/completions/slapt-get b/completions/slapt-get index 512981b6201..22f5eef4cbc 100644 --- a/completions/slapt-get +++ b/completions/slapt-get @@ -17,7 +17,7 @@ _slapt_get() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" --help)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace [[ $COMPREPLY ]] && return fi @@ -56,22 +56,22 @@ _slapt_get() # slapt-get will fail to search for "^name-version" # it can search for names only local name=${cur%%-*} - COMPREPLY=( $( LC_ALL=C "$1" -c "$config" --search "^$name" 2> \ - /dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}" ) ) + COMPREPLY=( $(LC_ALL=C "$1" -c "$config" --search "^$name" 2> \ + /dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}") ) return ;; avl) # --install|-i| - COMPREPLY=( $( LC_ALL=C "$1" -c "$config" --available 2> \ - /dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}" ) ) + COMPREPLY=( $(LC_ALL=C "$1" -c "$config" --available 2> \ + /dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}") ) return ;; ins) # --remove|--filelist - COMPREPLY=( $( cd /var/log/packages; compgen -f -- "$cur" ) ) + COMPREPLY=( $(cd /var/log/packages; compgen -f -- "$cur") ) return ;; set) # --install-set - COMPREPLY=( $( compgen -W 'a ap d e f k kde kdei l n t tcl x - xap xfce y' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'a ap d e f k kde kdei l n t tcl x + xap xfce y' -- "$cur") ) return ;; esac diff --git a/completions/slapt-src b/completions/slapt-src index 2f65415f54d..69b643cc91d 100644 --- a/completions/slapt-src +++ b/completions/slapt-src @@ -19,7 +19,7 @@ _slapt_src() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" --help)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace [[ $COMPREPLY ]] && return fi @@ -54,12 +54,12 @@ _slapt_src() if [[ "$cur" == *:* ]]; then local name=${cur%:*} local version=${cur##*:} - COMPREPLY=( $( LC_ALL=C "$1" --config "$config" --search "^$name" 2> \ + COMPREPLY=( $(LC_ALL=C "$1" --config "$config" --search "^$name" 2> \ /dev/null | LC_ALL=C command sed -ne \ - "/^$cur/{s/^$name:\([^ ]*\) .*$/\1/;p}" ) ) + "/^$cur/{s/^$name:\([^ ]*\) .*$/\1/;p}") ) else - COMPREPLY=( $( LC_ALL=C "$1" --config "$config" --search "^$cur" 2> \ - /dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}" ) ) + COMPREPLY=( $(LC_ALL=C "$1" --config "$config" --search "^$cur" 2> \ + /dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}") ) fi } && complete -F _slapt_src slapt-src diff --git a/completions/smartctl b/completions/smartctl index e55bfa560db..24f85df9179 100644 --- a/completions/smartctl +++ b/completions/smartctl @@ -2,23 +2,23 @@ _smartctl_quietmode() { - COMPREPLY=( $( compgen -W 'errorsonly silent noserial' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'errorsonly silent noserial' -- "$cur") ) } _smartctl_device() { case $cur in areca*|3ware*|megaraid*|cciss*) COMPREPLY+=( ${cur%%,*},{0..31} ) - COMPREPLY=( $( compgen -W '"${COMPREPLY[@]}"' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '"${COMPREPLY[@]}"' -- "$cur") ) ;; hpt*) COMPREPLY+=( hpt,{1..4}/{1..8} hpt,{1..4}/{1..8}/{1..5} ) - COMPREPLY=( $( compgen -W '"${COMPREPLY[@]}"' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '"${COMPREPLY[@]}"' -- "$cur") ) ;; *) - COMPREPLY=( $( compgen -W "ata scsi sat usbcypress usbjmicron + COMPREPLY=( $(compgen -W "ata scsi sat usbcypress usbjmicron usbsunplus marvell areca 3ware hpt megaraid cciss auto test" \ - -- "$cur" ) ) + -- "$cur") ) case "${COMPREPLY[@]}" in areca|3ware|hpt|megaraid|cciss) compopt -o nospace @@ -29,53 +29,53 @@ _smartctl_device() } _smartctl_tolerance() { - COMPREPLY=( $( compgen -W 'normal conservative permissive verypermissive' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'normal conservative permissive verypermissive' \ + -- "$cur") ) } _smartctl_badsum() { - COMPREPLY=( $( compgen -W 'warn exit ignore' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'warn exit ignore' -- "$cur") ) } _smartctl_report() { - COMPREPLY=( $( compgen -W 'ioctl ataioctl scsiioctl' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'ioctl ataioctl scsiioctl' -- "$cur") ) } _smartctl_powermode() { - COMPREPLY=( $( compgen -W 'never sleep standby idle' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'never sleep standby idle' -- "$cur") ) } _smartctl_feature() { - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on off' -- "$cur") ) } _smartctl_log() { - COMPREPLY=( $( compgen -W 'error selftest selective directory background + COMPREPLY=( $(compgen -W 'error selftest selective directory background sasphy sasphy,reset sataphy sataphy,reset scttemp scttempsts - scttemphist scterc gplog smartlog xerror xselftest' -- "$cur" ) ) + scttemphist scterc gplog smartlog xerror xselftest' -- "$cur") ) } _smartctl_vendorattribute() { - COMPREPLY=( $( compgen -W 'help 9,minutes 9,seconds 9,halfminutes 9,temp + COMPREPLY=( $(compgen -W 'help 9,minutes 9,seconds 9,halfminutes 9,temp 192,emergencyretractcyclect 193,loadunload 194,10xCelsius 194,unknown 198,offlinescanuncsectorct 200,writeerrorcount 201,detectedtacount - 220,temp' -- "$cur" ) ) + 220,temp' -- "$cur") ) } _smartctl_firmwarebug() { - COMPREPLY=( $( compgen -W 'none samsung samsung2 samsung3 swapid' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'none samsung samsung2 samsung3 swapid' \ + -- "$cur") ) } _smartctl_presets() { - COMPREPLY=( $( compgen -W 'use ignore show showall' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'use ignore show showall' -- "$cur") ) } _smartctl_test() { [[ $cur == @(pending|scttempint|vendor), ]] && return - COMPREPLY=( $( compgen -W 'offline short long conveyance select, + COMPREPLY=( $(compgen -W 'offline short long conveyance select, select,redo select,next afterselect,on afterselect,off pending, - scttempint, vendor,' -- "$cur" ) ) + scttempint, vendor,' -- "$cur") ) [[ $COMPREPLY == *, ]] && compopt -o nospace } _smartctl_drivedb() @@ -151,12 +151,12 @@ _smartctl() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --version --info --all --xall + COMPREPLY=( $(compgen -W '--help --version --info --all --xall --scan --scan-open --quietmode= --device= --tolerance= --badsum= --report= --nocheck= --smart= --offlineauto= --saveauto= --health --capabilities --attributes --log= --vendorattribute= --firmwarebug= --presets= --drivedb= --test= --captive --abort' \ - -- "$cur" ) ) + -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else cur=${cur:=/dev/} diff --git a/completions/smbclient b/completions/smbclient index 3a64d65fe42..c896ce42f5d 100644 --- a/completions/smbclient +++ b/completions/smbclient @@ -2,40 +2,40 @@ _samba_resolve_order() { - COMPREPLY=( $( compgen -W 'lmhosts host wins bcast' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'lmhosts host wins bcast' -- "$cur") ) } _samba_domains() { if [[ -n ${COMP_SAMBA_SCAN:-} ]]; then - COMPREPLY=( $( compgen -W '$( smbtree -N -D )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(smbtree -N -D)' -- "$cur") ) fi } _samba_hosts() { if [[ -n ${COMP_SAMBA_SCAN:-} ]]; then - COMPREPLY=( $( compgen -W "$( smbtree -N -S | \ + COMPREPLY=( $(compgen -W "$(smbtree -N -S | \ command sed -ne 's/^[[:space:]]*\\\\*\([^[:space:]]*\).*/\1/p' \ - )" -- "$cur" ) ) + )" -- "$cur") ) fi } _samba_debuglevel() { - COMPREPLY=( $( compgen -W '{0..10}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..10}' -- "$cur") ) } _samba_sockopts() { - COMPREPLY=( $( compgen -W 'SO_KEEPALIVE SO_REUSEADDR SO_BROADCAST + COMPREPLY=( $(compgen -W 'SO_KEEPALIVE SO_REUSEADDR SO_BROADCAST TCP_NODELAY IPTOS_LOWDELAY IPTOS_THROUGHPUT SO_SNDBUF SO_RCVBUF - SO_SNDLOWAT SO_RCVLOWAT' -- "$cur" ) ) + SO_SNDLOWAT SO_RCVLOWAT' -- "$cur") ) } _samba_signing() { - COMPREPLY=( $( compgen -W 'on off required' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on off required' -- "$cur") ) } _smbclient() @@ -49,8 +49,8 @@ _smbclient() return ;; -!(-*)t) - COMPREPLY=( $( compgen -W 'SJIS EUC JIS7 JIS8 JUNET HEX CAP' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'SJIS EUC JIS7 JIS8 JUNET HEX CAP' \ + -- "$cur") ) return ;; --configfile|--authentication-file|-!(-*)[sA]) @@ -66,7 +66,7 @@ _smbclient() return ;; -!(-*)T) - COMPREPLY=( $( compgen -W 'c x I X F b g q r N a' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'c x I X F b g q r N a' -- "$cur") ) return ;; --workgroup|-!(-*)W) @@ -97,7 +97,7 @@ _smbclient() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && @@ -129,7 +129,7 @@ _smbget() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && @@ -174,7 +174,7 @@ _smbcacls() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && @@ -210,7 +210,7 @@ _smbcquotas() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && @@ -244,7 +244,7 @@ _smbpasswd() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) fi } && complete -F _smbpasswd smbpasswd @@ -277,7 +277,7 @@ _smbtar() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) fi } && complete -F _smbtar smbtar @@ -312,7 +312,7 @@ _smbtree() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && diff --git a/completions/snownews b/completions/snownews index b5b070da5b8..3938454f0ca 100644 --- a/completions/snownews +++ b/completions/snownews @@ -7,7 +7,7 @@ _snownews() if [[ "$cur" == -* ]]; then # return list of available options - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) fi } && complete -F _snownews snownews diff --git a/completions/sqlite3 b/completions/sqlite3 index 73cad6a60c2..a7005489af8 100644 --- a/completions/sqlite3 +++ b/completions/sqlite3 @@ -18,7 +18,7 @@ _sqlite3() ;; -cmd) compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=( $(compgen -c -- "$cur") ) return ;; esac @@ -27,7 +27,7 @@ _sqlite3() && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) return fi diff --git a/completions/ss b/completions/ss index af501a9bfa3..05e4e4b2a46 100644 --- a/completions/ss +++ b/completions/ss @@ -10,15 +10,15 @@ _ss() return ;; --family|-!(-*)f) - COMPREPLY=( $( compgen -W 'unix inet inet6 link netlink' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'unix inet inet6 link netlink' \ + -- "$cur") ) return ;; --query|-!(-*)A) local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," - COMPREPLY=( $( compgen -W '$( "$1" --help | \ - command sed -e "s/|/ /g" -ne "s/.*QUERY := {\([^}]*\)}.*/\1/p" )' \ - -- "${cur##*,}" ) ) + COMPREPLY=( $(compgen -W '$("$1" --help | \ + command sed -e "s/|/ /g" -ne "s/.*QUERY := {\([^}]*\)}.*/\1/p")' \ + -- "${cur##*,}") ) [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} ) return ;; @@ -31,7 +31,7 @@ _ss() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && diff --git a/completions/ssh b/completions/ssh index 3806d103d9e..ae8f78c34fa 100644 --- a/completions/ssh +++ b/completions/ssh @@ -2,9 +2,9 @@ _ssh_queries() { - COMPREPLY+=( $( compgen -W \ + COMPREPLY+=( $(compgen -W \ "cipher cipher-auth mac kex key key-cert key-plain protocol-version" \ - -- "$cur" ) ) + -- "$cur") ) } _ssh_query() @@ -14,25 +14,25 @@ _ssh_query() _ssh_ciphers() { - local ciphers='$( _ssh_query "$1" cipher )' + local ciphers='$(_ssh_query "$1" cipher)' [[ $ciphers ]] || ciphers="3des-cbc aes128-cbc aes192-cbc aes256-cbc aes128-ctr aes192-ctr aes256-ctr arcfour128 arcfour256 arcfour blowfish-cbc cast128-cbc" - COMPREPLY+=( $( compgen -W "$ciphers" -- "$cur" ) ) + COMPREPLY+=( $(compgen -W "$ciphers" -- "$cur") ) } _ssh_macs() { - local macs='$( _ssh_query "$1" mac )' + local macs='$(_ssh_query "$1" mac)' [[ $macs ]] || macs="hmac-md5 hmac-sha1 umac-64@openssh.com hmac-ripemd160 hmac-sha1-96 hmac-md5-96" - COMPREPLY+=( $( compgen -W "$macs" -- "$cur" ) ) + COMPREPLY+=( $(compgen -W "$macs" -- "$cur") ) } _ssh_options() { compopt -o nospace - COMPREPLY=( $( compgen -S = -W 'AddKeysToAgent AddressFamily BatchMode + COMPREPLY=( $(compgen -S = -W 'AddKeysToAgent AddressFamily BatchMode BindAddress CanonicalDomains CanonicalizeFallbackLocal CanonicalizeHostname CanonicalizeMaxDots CanonicalizePermittedCNAMEs CertificateFile ChallengeResponseAuthentication CheckHostIP Cipher @@ -58,7 +58,7 @@ _ssh_options() StrictHostKeyChecking SyslogFacility TCPKeepAlive Tunnel TunnelDevice UpdateHostKeys UsePrivilegedPort User UserKnownHostsFile VerifyHostKeyDNS VisualHostKey XAuthLocation' \ - -- "$cur" ) ) + -- "$cur") ) } # Complete a ssh suboption (like ForwardAgent=y) @@ -84,74 +84,73 @@ _ssh_suboption() ProxyUseFdpass|PubkeyAuthentication|RhostsRSAAuthentication|\ RSAAuthentication|StrictHostKeyChecking|StreamLocalBindUnlink|\ TCPKeepAlive|UsePrivilegedPort|VerifyHostKeyDNS|VisualHostKey) - COMPREPLY=( $( compgen -W 'yes no' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'yes no' -- "$cur") ) ;; AddKeysToAgent) - COMPREPLY=( $( compgen -W 'yes ask confirm no' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'yes ask confirm no' -- "$cur") ) ;; AddressFamily) - COMPREPLY=( $( compgen -W 'any inet inet6' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'any inet inet6' -- "$cur") ) ;; BindAddress) _ip_addresses ;; CanonicalizeHostname) - COMPREPLY=( $( compgen -W 'yes no always' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'yes no always' -- "$cur") ) ;; *File|IdentityAgent|Include) _filedir ;; Cipher) - COMPREPLY=( $( compgen -W 'blowfish des 3des' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'blowfish des 3des' -- "$cur") ) ;; Ciphers) _ssh_ciphers "$2" ;; CompressionLevel) - COMPREPLY=( $( compgen -W '{1..9}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{1..9}' -- "$cur") ) ;; FingerprintHash) - COMPREPLY=( $( compgen -W 'md5 sha256' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'md5 sha256' -- "$cur") ) ;; IPQoS) - COMPREPLY=( $( compgen -W 'af1{1..4} af2{2..3} af3{1..3} af4{1..3} - cs{0..7} ef lowdelay throughput reliability' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'af1{1..4} af2{2..3} af3{1..3} af4{1..3} + cs{0..7} ef lowdelay throughput reliability' -- "$cur") ) ;; HostbasedKeyTypes|HostKeyAlgorithms) - COMPREPLY=( $( compgen -W '$( _ssh_query "$2" key )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_ssh_query "$2" key)' -- "$cur") ) ;; KexAlgorithms) - COMPREPLY=( $( compgen -W '$( _ssh_query "$2" kex )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_ssh_query "$2" kex)' -- "$cur") ) ;; MACs) _ssh_macs "$2" ;; PreferredAuthentications) - COMPREPLY=( $( compgen -W 'gssapi-with-mic host-based publickey - keyboard-interactive password' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'gssapi-with-mic host-based publickey + keyboard-interactive password' -- "$cur") ) ;; Protocol) - COMPREPLY=( $( compgen -W '1 2 1,2 2,1' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '1 2 1,2 2,1' -- "$cur") ) ;; ProxyJump) _known_hosts_real -a -F "$configfile" -- "$cur" ;; PubkeyAcceptedKeyTypes) - COMPREPLY=( $( compgen -W '$( _ssh_query "$2" key )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_ssh_query "$2" key)' -- "$cur") ) ;; RequestTTY) - COMPREPLY=( $( compgen -W 'no yes force auto' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'no yes force auto' -- "$cur") ) ;; SyslogFacility) - COMPREPLY=( $( compgen -W 'DAEMON USER AUTH LOCAL{0..7}' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'DAEMON USER AUTH LOCAL{0..7}' -- "$cur") ) ;; Tunnel) - COMPREPLY=( $( compgen -W 'yes no point-to-point ethernet' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'yes no point-to-point ethernet' \ + -- "$cur") ) ;; UpdateHostKeys) - COMPREPLY=( $( compgen -W 'yes no ask' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'yes no ask' -- "$cur") ) ;; esac return 0 @@ -234,7 +233,7 @@ _ssh() return ;; -*l) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; -*m) @@ -242,7 +241,7 @@ _ssh() return ;; -*O) - COMPREPLY=( $( compgen -W 'check forward exit stop' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'check forward exit stop' -- "$cur") ) return ;; -*o) @@ -266,7 +265,7 @@ _ssh() COMPREPLY=( "${COMPREPLY[@]/#/-F}" ) cur=-F$cur # Restore cur elif [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) else _known_hosts_real $ipvx -a -F "$configfile" -- "$cur" @@ -274,7 +273,7 @@ _ssh() _count_args if [[ $args -gt 1 ]]; then compopt -o filenames - COMPREPLY+=( $( compgen -c -- "$cur" ) ) + COMPREPLY+=( $(compgen -c -- "$cur") ) fi fi } && @@ -329,7 +328,7 @@ _sftp() COMPREPLY=( "${COMPREPLY[@]/#/-F}" ) cur=-F$cur # Restore cur elif [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) else _known_hosts_real $ipvx -a -F "$configfile" -- "$cur" fi @@ -352,7 +351,7 @@ _scp_remote_files() local path=${cur#*:} # unescape (3 backslashes to 1 for chars we escaped) - path=$( command sed -e 's/\\\\\\\('$_scp_path_esc'\)/\\\1/g' <<<"$path" ) + path=$(command sed -e 's/\\\\\\\('$_scp_path_esc'\)/\\\1/g' <<<"$path") # default to home dir of specified user on remote host if [[ -z $path ]]; then @@ -362,16 +361,16 @@ _scp_remote_files() local files if [[ $1 == -d ]]; then # escape problematic characters; remove non-dirs - files=$( ssh -o 'Batchmode yes' $userhost \ + files=$(ssh -o 'Batchmode yes' $userhost \ command ls -aF1dL "$path*" 2>/dev/null | \ - command sed -e 's/'$_scp_path_esc'/\\\\\\&/g' -e '/[^\/]$/d' ) + command sed -e 's/'$_scp_path_esc'/\\\\\\&/g' -e '/[^\/]$/d') else # escape problematic characters; remove executables, aliases, pipes # and sockets; add space at end of file names - files=$( ssh -o 'Batchmode yes' $userhost \ + files=$(ssh -o 'Batchmode yes' $userhost \ command ls -aF1dL "$path*" 2>/dev/null | \ command sed -e 's/'$_scp_path_esc'/\\\\\\&/g' -e 's/[*@|=]$//g' \ - -e 's/[^\/]$/& /g' ) + -e 's/[^\/]$/& /g') fi COMPREPLY+=( $files ) } @@ -391,10 +390,10 @@ _scp_local_files() fi if $dirsonly ; then - COMPREPLY+=( $( command ls -aF1dL $cur* 2>/dev/null | \ + COMPREPLY+=( $(command ls -aF1dL $cur* 2>/dev/null | \ command sed -e "s/$_scp_path_esc/\\\\&/g" -e '/[^\/]$/d' -e "s/^/$1/") ) else - COMPREPLY+=( $( command ls -aF1dL $cur* 2>/dev/null | \ + COMPREPLY+=( $(command ls -aF1dL $cur* 2>/dev/null | \ command sed -e "s/$_scp_path_esc/\\\\&/g" -e 's/[*@|=]$//g' \ -e 's/[^\/]$/& /g' -e "s/^/$1/") ) fi @@ -463,8 +462,8 @@ _scp() else case $cur in -*) - COMPREPLY=( $( compgen -W '$( _parse_usage "${words[0]}" )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "${words[0]}")' \ + -- "$cur") ) COMPREPLY=( "${COMPREPLY[@]/%/ }" ) return ;; diff --git a/completions/ssh-add b/completions/ssh-add index dcfd2385906..d9157893a5d 100644 --- a/completions/ssh-add +++ b/completions/ssh-add @@ -16,7 +16,7 @@ _ssh_add() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" "-\?" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" "-\?")' -- "$cur") ) return fi diff --git a/completions/ssh-copy-id b/completions/ssh-copy-id index cb5731ca29e..cb4cf9204d2 100644 --- a/completions/ssh-copy-id +++ b/completions/ssh-copy-id @@ -22,7 +22,7 @@ _ssh_copy_id() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _known_hosts_real -a -- "$cur" fi diff --git a/completions/ssh-keygen b/completions/ssh-keygen index f13de384491..5c449fc01f8 100644 --- a/completions/ssh-keygen +++ b/completions/ssh-keygen @@ -10,7 +10,7 @@ _ssh_keygen() return ;; -*E) - COMPREPLY=( $( compgen -W 'md5 sha256' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'md5 sha256' -- "$cur") ) return ;; -*[FR]) @@ -27,30 +27,30 @@ _ssh_keygen() return ;; -*m) - COMPREPLY=( $( compgen -W 'PEM PKCS8 RFC4716' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'PEM PKCS8 RFC4716' -- "$cur") ) return ;; -*O) if [[ $cur != *=* ]]; then - COMPREPLY=( $( compgen -W 'clear force-command= + COMPREPLY=( $(compgen -W 'clear force-command= no-agent-forwarding no-port-forwarding no-pty no-user-rc no-x11-forwarding permit-agent-forwarding permit-port-forwarding permit-pty permit-user-rc - permit-x11-forwarding source-address=' -- "$cur" ) ) + permit-x11-forwarding source-address=' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi return ;; -*t) - COMPREPLY=( $( compgen -W 'dsa ecdsa ed25519 rsa rsa1' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'dsa ecdsa ed25519 rsa rsa1' -- "$cur") ) return ;; esac if [[ $cur == -* ]]; then - local opts=$( _parse_usage "$1" "-?" ) - [[ -z "$opts" ]] && opts=$( _parse_help "$1" "-?" ) # OpenSSH < 7 - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + local opts=$(_parse_usage "$1" "-?") + [[ -z "$opts" ]] && opts=$(_parse_help "$1" "-?") # OpenSSH < 7 + COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) fi } && complete -F _ssh_keygen ssh-keygen diff --git a/completions/sshmitm b/completions/sshmitm index 192835c0d30..8b320fa8d4d 100644 --- a/completions/sshmitm +++ b/completions/sshmitm @@ -6,7 +6,7 @@ _sshmitm() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) else _known_hosts_real -- "$cur" fi diff --git a/completions/sshow b/completions/sshow index 331349e1ec0..e9ea9c2d333 100644 --- a/completions/sshow +++ b/completions/sshow @@ -17,7 +17,7 @@ _sshow() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) fi } && diff --git a/completions/strace b/completions/strace index 47a5e884e6c..e96e9528449 100644 --- a/completions/strace +++ b/completions/strace @@ -43,7 +43,7 @@ _strace() syscalls[${BASH_REMATCH[1]}]=1 done 2>/dev/null < /usr/include/asm/unistd.h if [[ ! $syscalls ]]; then - local unistd arch=$( command uname -m ) + local unistd arch=$(command uname -m) if [[ "$arch" == *86 ]]; then unistd=/usr/include/asm/unistd_32.h else @@ -56,16 +56,16 @@ _strace() done 2>/dev/null < $unistd fi - COMPREPLY=( $( compgen -W '${!syscalls[@]} file + COMPREPLY=( $(compgen -W '${!syscalls[@]} file process network signal ipc desc all none' \ - -- "$cur" ) ) + -- "$cur") ) return ;; esac else compopt -o nospace - COMPREPLY=( $( compgen -S"=" -W 'trace abbrev verbose raw - signal read write' -- "$cur" ) ) + COMPREPLY=( $(compgen -S"=" -W 'trace abbrev verbose raw + signal read write' -- "$cur") ) fi return ;; @@ -78,8 +78,7 @@ _strace() return ;; -*S) - COMPREPLY=( $( compgen -W 'time calls name nothing' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'time calls name nothing' -- "$cur") ) return ;; -*u) @@ -89,9 +88,9 @@ _strace() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) else - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=( $(compgen -c -- "$cur") ) fi fi } && diff --git a/completions/strings b/completions/strings index 6069a248c63..b4e13ab6d32 100644 --- a/completions/strings +++ b/completions/strings @@ -10,16 +10,17 @@ _strings() return ;; --radix|-!(-*)t) - COMPREPLY=( $( compgen -W 'o d x' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'o d x' -- "$cur") ) return ;; --target|-!(-*)T) - COMPREPLY=( $( compgen -W '$( LC_ALL=C "$1" --help 2>/dev/null | \ - command sed -ne "s/: supported targets: \(.*\)/\1/p" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(LC_ALL=C "$1" --help 2>/dev/null | \ + command sed -ne "s/: supported targets: \(.*\)/\1/p")' \ + -- "$cur") ) return ;; --encoding|-!(-*)e) - COMPREPLY=( $( compgen -W 's S b l B L' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 's S b l B L' -- "$cur") ) return ;; esac @@ -27,7 +28,7 @@ _strings() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return elif [[ $cur == @* ]]; then diff --git a/completions/sudo b/completions/sudo index 17f28d33a12..994ec78b4c1 100644 --- a/completions/sudo +++ b/completions/sudo @@ -27,11 +27,11 @@ _sudo() case "$prev" in --user|--other-user|-!(-*)[uU]) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) return ;; --group|-!(-*)g) - COMPREPLY=( $( compgen -g -- "$cur" ) ) + COMPREPLY=( $(compgen -g -- "$cur") ) return ;; --close-from|--prompt|-!(-*)[Cp]) @@ -42,9 +42,9 @@ _sudo() $split && return if [[ "$cur" == -* ]]; then - local opts=$( _parse_help "$1" ) - [[ $opts ]] || opts=$( _parse_usage "$1" ) - COMPREPLY=( $( compgen -W '$opts' -- "$cur" ) ) + local opts=$(_parse_help "$1") + [[ $opts ]] || opts=$(_parse_usage "$1") + COMPREPLY=( $(compgen -W '$opts' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/svk b/completions/svk index d78d3557053..0c24fbdf8dd 100644 --- a/completions/svk +++ b/completions/svk @@ -16,9 +16,9 @@ _svk() if [[ $cword -eq 1 ]] ; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--version' -- "$cur") ) else - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$commands" -- "$cur") ) fi else case $prev in @@ -27,8 +27,8 @@ _svk() return ;; --encoding) - COMPREPLY=( $( compgen -W \ - '$( iconv --list | command sed -e "s@//@@;" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$(iconv --list | command sed -e "s@//@@;")' -- "$cur") ) return ;; esac @@ -173,26 +173,26 @@ _svk() esac options+=" --help -h" - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$options" -- "$cur") ) else case $command in help|h|\?) - COMPREPLY=( $( compgen -W "$commands environment commands - intro" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$commands environment commands + intro" -- "$cur") ) ;; admin) - COMPREPLY=( $( compgen -W 'help deltify dump hotcopy + COMPREPLY=( $(compgen -W 'help deltify dump hotcopy list-dblogs list-unused-dblogs load lstxns recover - rmtxns setlog verify rmcache' -- "$cur" ) ) + rmtxns setlog verify rmcache' -- "$cur") ) ;; patch) - COMPREPLY=( $( compgen -W '--ls --list --cat --view + COMPREPLY=( $(compgen -W '--ls --list --cat --view --regen --regenerate --up --update --apply --rm - --delete' -- "$cur" ) ) + --delete' -- "$cur") ) ;; sync) - COMPREPLY=( $( compgen -W "$( $1 mirror --list \ - 2>/dev/null | awk '/^\//{print $1}' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 mirror --list \ + 2>/dev/null | awk '/^\//{print $1}')" -- "$cur") ) ;; co|checkout|push|pull) if [[ "$cur" == //*/* ]]; then @@ -200,8 +200,8 @@ _svk() else path=// fi - COMPREPLY=( $( compgen -W "$( $1 list $path 2>/dev/null | \ - command sed -e 's|\(.*\)|'$path'\1|')" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 list $path 2>/dev/null | \ + command sed -e 's|\(.*\)|'$path'\1|')" -- "$cur") ) ;; *) _filedir diff --git a/completions/sync_members b/completions/sync_members index 2fe50eaf06e..653c0ea9b0c 100644 --- a/completions/sync_members +++ b/completions/sync_members @@ -7,7 +7,7 @@ _sync_members() case $prev in -w|-g|-d|--welcome-msg|--goodbye-msg|--digest) - COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'y n' -- "$cur") ) return ;; -d|--file) @@ -19,8 +19,8 @@ _sync_members() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--no-change --welcome-msg --goodbye-msg - --digest --notifyadmin --file --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--no-change --welcome-msg --goodbye-msg + --digest --notifyadmin --file --help' -- "$cur") ) else _xfunc list_lists _mailman_lists fi diff --git a/completions/synclient b/completions/synclient index b7ebf02607e..0c45068ff6a 100644 --- a/completions/synclient +++ b/completions/synclient @@ -12,10 +12,10 @@ _synclient() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) elif [[ $cur != *=?* ]]; then - COMPREPLY=( $( compgen -S = -W '$( $1 -l 2>/dev/null | \ - awk "/^[ \t]/ { print \$1 }" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -S = -W '$($1 -l 2>/dev/null | \ + awk "/^[ \t]/ { print \$1 }")' -- "$cur") ) compopt -o nospace fi } && diff --git a/completions/sysbench b/completions/sysbench index 3d2b7b1ebb3..fc9420482c0 100644 --- a/completions/sysbench +++ b/completions/sysbench @@ -11,80 +11,79 @@ _sysbench() return ;; --init-rng|--debug|--validate) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on off' -- "$cur") ) return ;; --test) - COMPREPLY=( $( compgen -W 'fileio cpu memory threads mutex oltp' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'fileio cpu memory threads mutex oltp' \ + -- "$cur") ) return ;; --cpu-max-prime) return ;; --file-test-mode) - COMPREPLY=( $( compgen -W 'seqwr seqrewr seqrd rndrd rndwr rndrw' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'seqwr seqrewr seqrd rndrd rndwr rndrw' \ + -- "$cur") ) return ;; --file-io-mode) - COMPREPLY=( $( compgen -W 'sync async fastmmap slowmmap' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'sync async fastmmap slowmmap' -- "$cur") ) return ;; --file-extra-flags) - COMPREPLY=( $( compgen -W 'sync dsync direct' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'sync dsync direct' -- "$cur") ) return ;; --file-fsync-all|--file-fsync-end) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on off' -- "$cur") ) return ;; --file-fsync-mode) - COMPREPLY=( $( compgen -W 'fsync fdatasync' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'fsync fdatasync' -- "$cur") ) return ;; --memory-scope) - COMPREPLY=( $( compgen -W 'global local' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'global local' -- "$cur") ) return ;; --memory-hugetlb) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on off' -- "$cur") ) return ;; --memory-oper) - COMPREPLY=( $( compgen -W 'read write none' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'read write none' -- "$cur") ) return ;; --memory-access-mode) - COMPREPLY=( $( compgen -W 'seq rnd' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'seq rnd' -- "$cur") ) return ;; --oltp-test-mode) - COMPREPLY=( $( compgen -W 'simple complex nontrx sp' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'simple complex nontrx sp' -- "$cur") ) return ;; --oltp-read-only|--oltp-skip-trx|--oltp-quto-inc|--mysql-ssl) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on off' -- "$cur") ) return ;; --oltp-nontrx-mode) - COMPREPLY=( $( compgen -W 'select update_key update_nokey insert - delete' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'select update_key update_nokey insert + delete' -- "$cur") ) return ;; --oltp-dist-type) - COMPREPLY=( $( compgen -W 'uniform gaussian special' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'uniform gaussian special' -- "$cur") ) return ;; --db-driver) - COMPREPLY=( $( compgen -W "$( $1 --test=oltp help 2>/dev/null | + COMPREPLY=( $(compgen -W "$($1 --test=oltp help 2>/dev/null | command sed -e '/^.*database drivers:/,/^$/!d' \ - -ne 's/^ *\([^ ]*\) .*/\1/p' )" -- "$cur" ) ) + -ne 's/^ *\([^ ]*\) .*/\1/p')" -- "$cur") ) return ;; --db-ps-mode) - COMPREPLY=( $( compgen -W 'auto disable' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'auto disable' -- "$cur") ) return ;; --mysql-socket) @@ -92,12 +91,12 @@ _sysbench() return ;; --mysql-table-engine) - COMPREPLY=( $( compgen -W 'myisam innodb bdb heap ndbcluster - federated' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'myisam innodb bdb heap ndbcluster + federated' -- "$cur") ) return ;; --mysql-engine-trx) - COMPREPLY=( $( compgen -W 'yes no auto' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'yes no auto' -- "$cur") ) return ;; --*) @@ -114,18 +113,17 @@ _sysbench() fi done - local opts=$( _parse_help "$1" ) + local opts=$(_parse_help "$1") if [[ $test ]]; then - local help=( $( _parse_help "$1" "--test=$test help" ) ) + local help=( $(_parse_help "$1" "--test=$test help") ) opts="${opts[@]/--test=/} ${help[@]} prepare run cleanup help version" fi if [[ "$cur" == -* || ! $test ]]; then - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else - COMPREPLY=( $( compgen -W "prepare run cleanup help version" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "prepare run cleanup help version" -- "$cur") ) fi } && complete -F _sysbench sysbench diff --git a/completions/sysctl b/completions/sysctl index a97f20905cd..dfd971d52d2 100644 --- a/completions/sysctl +++ b/completions/sysctl @@ -16,14 +16,14 @@ _sysctl() esac if [[ $cur == -* ]]; then - local opts="$( _parse_help "$1" )" - [[ $opts ]] || opts="$( _parse_usage "$1" )" - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + local opts="$(_parse_help "$1")" + [[ $opts ]] || opts="$(_parse_usage "$1")" + COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) else local suffix= [[ $prev == -w ]] && suffix== - COMPREPLY=( $( compgen -S "$suffix" -W \ - "$( PATH="$PATH:/sbin" sysctl -N -a 2>/dev/null )" -- "$cur" ) ) + COMPREPLY=( $(compgen -S "$suffix" -W \ + "$(PATH="$PATH:/sbin" sysctl -N -a 2>/dev/null)" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && diff --git a/completions/tar b/completions/tar index 6d04d46d818..3e161732b43 100644 --- a/completions/tar +++ b/completions/tar @@ -313,7 +313,7 @@ __tar_complete_mode() generated+=" $cur$c" done - COMPREPLY=( $( compgen -W "$generated" ) ) + COMPREPLY=( $(compgen -W "$generated") ) return 0 } @@ -322,7 +322,7 @@ __tar_complete_mode() __gtar_complete_lopts() { local rv - COMPREPLY=( $( compgen -W "$long_opts" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$long_opts" -- "$cur") ) rv=$? [[ $COMPREPLY == *= ]] && compopt -o nospace return $rv @@ -341,7 +341,7 @@ __gtar_complete_sopts() generated+=" $cur$c" done - COMPREPLY=( $( compgen -W "$generated" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$generated" -- "$cur") ) } @@ -517,21 +517,21 @@ _gtar() break ;; --atime-preserve) - COMPREPLY=( $( compgen -W 'replace system' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'replace system' -- "$cur") ) break ;; --group) - COMPREPLY=( $( compgen -g -- "$cur" ) ) + COMPREPLY=( $(compgen -g -- "$cur") ) break ;; --owner) - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) break ;; --info-script|--new-volume-script|--rmt-command|--rsh-command|\ --use-compress-program|-!(-*)[FI]) compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=( $(compgen -c -- "$cur") ) break ;; --volno-file|--add-file|--files-from|--exclude-from|\ @@ -540,22 +540,22 @@ _gtar() break ;; --format|-!(-*)H) - COMPREPLY=( $( compgen -W 'gnu oldgnu pax posix ustar v7' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'gnu oldgnu pax posix ustar v7' \ + -- "$cur") ) break ;; --quoting-style) - COMPREPLY=( $( compgen -W 'literal shell shell-always c c-maybe - escape locale clocale' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'literal shell shell-always c c-maybe + escape locale clocale' -- "$cur") ) break ;; --totals) - COMPREPLY=( $( compgen -W 'SIGHUP SIGQUIT SIGINT SIGUSR1 SIGUSR2' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'SIGHUP SIGQUIT SIGINT SIGUSR1 SIGUSR2' \ + -- "$cur") ) break ;; --warning) - COMPREPLY=( $( compgen -W "$(__gtar_parse_warnings)" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(__gtar_parse_warnings)" -- "$cur") ) break ;; --file|-!(-*)f) diff --git a/completions/tcpdump b/completions/tcpdump index a7d70d49960..d93c8795a5a 100644 --- a/completions/tcpdump +++ b/completions/tcpdump @@ -19,14 +19,14 @@ _tcpdump() return ;; -!(-*)T) - COMPREPLY=( $( compgen -W 'aodv carp cnfp lmp pgm pgm_zmtp1 radius + COMPREPLY=( $(compgen -W 'aodv carp cnfp lmp pgm pgm_zmtp1 radius resp rpc rtcp rtp rtcp snmp tftp vat vxlan wb zmtp1' \ - -- "$cur" ) ) + -- "$cur") ) return ;; -!(-*)z) compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=( $(compgen -c -- "$cur") ) return ;; --relinquish-privileges|-!(-*)Z) @@ -37,16 +37,16 @@ _tcpdump() return ;; --time-stamp-type|-!(-*)j) - COMPREPLY=( $( compgen -W 'host host_lowprec host_hiprec adapter - adapter_unsynced' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'host host_lowprec host_hiprec adapter + adapter_unsynced' -- "$cur") ) return ;; --direction|-!(-*)Q) - COMPREPLY=( $( compgen -W 'in out inout' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'in out inout' -- "$cur") ) return ;; --time-stamp-precision) - COMPREPLY=( $( compgen -W 'micro nano' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'micro nano' -- "$cur") ) return ;; esac @@ -54,7 +54,7 @@ _tcpdump() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi diff --git a/completions/tcpkill b/completions/tcpkill index 4477669b3ab..200cfc38b96 100644 --- a/completions/tcpkill +++ b/completions/tcpkill @@ -13,7 +13,7 @@ _tcpkill() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-i -1 -2 -3 -4 -5 -6 -7 -8 -9' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-i -1 -2 -3 -4 -5 -6 -7 -8 -9' -- "$cur") ) fi } && diff --git a/completions/tcpnice b/completions/tcpnice index 42251c08e99..0302d46d91c 100644 --- a/completions/tcpnice +++ b/completions/tcpnice @@ -13,7 +13,7 @@ _tcpnice() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) fi } && diff --git a/completions/timeout b/completions/timeout index 105e6d16642..b5851baae0f 100644 --- a/completions/timeout +++ b/completions/timeout @@ -29,7 +29,7 @@ _timeout() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && diff --git a/completions/tipc b/completions/tipc index 3523a2954c8..95d7f896579 100644 --- a/completions/tipc +++ b/completions/tipc @@ -4,10 +4,10 @@ _tipc_media() { local optind=$1 if [[ $cword -eq $optind ]]; then - COMPREPLY=( $( compgen -W 'media' -- $cur) ) + COMPREPLY=( $(compgen -W 'media' -- $cur) ) return 0 elif [[ $cword -eq $optind+1 ]]; then - COMPREPLY=( $( compgen -W 'udp eth ib' -- $cur) ) + COMPREPLY=( $(compgen -W 'udp eth ib' -- $cur) ) return 0 fi @@ -31,28 +31,28 @@ _tipc_bearer() { if [[ $cword -eq $optind+2 ]]; then case "$media" in "udp") - COMPREPLY=( $( compgen -W 'name' -- $cur) ) + COMPREPLY=( $(compgen -W 'name' -- $cur) ) ;; "eth" | "ib") - COMPREPLY=( $( compgen -W 'device' -- $cur) ) + COMPREPLY=( $(compgen -W 'device' -- $cur) ) ;; esac elif [[ $cword -eq $optind+3 ]]; then case "$media" in "udp") local names=$(tipc bearer list 2>/dev/null | awk -F: '/^udp:/ {print $2}') - COMPREPLY=( $( compgen -W '$names' -- $cur) ) + COMPREPLY=( $(compgen -W '$names' -- $cur) ) ;; "eth") local interfaces=$(command ls /sys/class/net/) - COMPREPLY=( $( compgen -W '$interfaces' -- $cur ) ) + COMPREPLY=( $(compgen -W '$interfaces' -- $cur) ) ;; esac fi } _tipc_link_opts() { - COMPREPLY=( $( compgen -W 'priority tolerance window' -- $cur) ) + COMPREPLY=( $(compgen -W 'priority tolerance window' -- $cur) ) } _tipc_link() { @@ -60,7 +60,7 @@ _tipc_link() { local filter=$2 if [[ $cword -eq $optind ]]; then - COMPREPLY=( $( compgen -W 'link' -- $cur) ) + COMPREPLY=( $(compgen -W 'link' -- $cur) ) elif [[ $cword -eq $optind+1 ]]; then # awk drops link state and last trailing : local links=$(tipc link list 2>/dev/null | \ @@ -68,7 +68,7 @@ _tipc_link() { if [[ $filter == "peers" ]]; then links=$(command sed '/broadcast-link/d' <<<"$links") fi - COMPREPLY=( $( compgen -W '$links' -- $cur ) ) + COMPREPLY=( $(compgen -W '$links' -- $cur) ) fi } @@ -83,13 +83,13 @@ _tipc() # Flags can be placed anywhere in the commandline case "$cur" in -*) - COMPREPLY=( $( compgen -W '-h --help' -- $cur ) ) + COMPREPLY=( $(compgen -W '-h --help' -- $cur) ) return ;; esac if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'bearer link media nametable node socket' -- $cur ) ) + COMPREPLY=( $(compgen -W 'bearer link media nametable node socket' -- $cur) ) return fi @@ -98,7 +98,7 @@ _tipc() let optind++ if [[ $cword -eq $optind ]]; then - COMPREPLY=( $( compgen -W 'enable disable set get list' -- $cur ) ) + COMPREPLY=( $(compgen -W 'enable disable set get list' -- $cur) ) return fi @@ -148,7 +148,7 @@ _tipc() done done - COMPREPLY=( $( compgen -W '${params[@]}' -- $cur) ) + COMPREPLY=( $(compgen -W '${params[@]}' -- $cur) ) ;; disable) let optind++ @@ -179,7 +179,7 @@ _tipc() let optind++ if [[ $cword -eq $optind ]]; then - COMPREPLY=( $( compgen -W 'get set list statistics' -- $cur ) ) + COMPREPLY=( $(compgen -W 'get set list statistics' -- $cur) ) return fi @@ -206,7 +206,7 @@ _tipc() let optind++ if [[ $cword -eq $optind ]]; then - COMPREPLY=( $( compgen -W 'show reset' -- $cur) ) + COMPREPLY=( $(compgen -W 'show reset' -- $cur) ) return fi @@ -222,7 +222,7 @@ _tipc() let optind++ if [[ $cword -eq $optind ]]; then - COMPREPLY=( $( compgen -W 'get set list' -- $cur ) ) + COMPREPLY=( $(compgen -W 'get set list' -- $cur) ) return fi @@ -251,14 +251,14 @@ _tipc() let optind++ if [[ $cword -eq $optind ]]; then - COMPREPLY=( $( compgen -W 'show' -- $cur ) ) + COMPREPLY=( $(compgen -W 'show' -- $cur) ) fi ;; node) let optind++ if [[ $cword -eq $optind ]]; then - COMPREPLY=( $( compgen -W 'list get set' -- $cur ) ) + COMPREPLY=( $(compgen -W 'list get set' -- $cur) ) return fi @@ -267,7 +267,7 @@ _tipc() let optind++ if [[ $cword -eq $optind ]]; then - COMPREPLY=( $( compgen -W 'address netid' -- $cur ) ) + COMPREPLY=( $(compgen -W 'address netid' -- $cur) ) fi esac ;; @@ -275,7 +275,7 @@ _tipc() let optind++ if [[ $cword -eq $optind ]]; then - COMPREPLY=( $( compgen -W 'list' -- $cur ) ) + COMPREPLY=( $(compgen -W 'list' -- $cur) ) fi ;; esac diff --git a/completions/tox b/completions/tox index 5d21d0594ee..d0ec2cdcd66 100644 --- a/completions/tox +++ b/completions/tox @@ -21,14 +21,14 @@ _tox() local envs=$( { "$1" --listenvs-all || "$1" --listenvs; } 2>/dev/null ) local prefix=""; [[ $cur == *,* ]] && prefix="${cur%,*}," - COMPREPLY=( $( compgen -W "$envs ALL" -- "${cur##*,}" ) ) + COMPREPLY=( $(compgen -W "$envs ALL" -- "${cur##*,}") ) [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} ) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi } && diff --git a/completions/tracepath b/completions/tracepath index 11798f4bf2b..29dec3e80d8 100644 --- a/completions/tracepath +++ b/completions/tracepath @@ -12,8 +12,8 @@ _tracepath() esac if [[ $cur == -* ]]; then - local opts=$( _parse_help "$1" ) - COMPREPLY=( $( compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur" ) ) + local opts=$(_parse_help "$1") + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) return fi diff --git a/completions/tshark b/completions/tshark index d359ecce240..4864d4b1a0b 100644 --- a/completions/tshark +++ b/completions/tshark @@ -24,11 +24,11 @@ _tshark() _filedir else [ -n "$_tshark_prefs" ] || - _tshark_prefs="$( "$1" -G defaultprefs | command \ + _tshark_prefs="$("$1" -G defaultprefs | command \ sed -ne 's/^#\{0,1\}\([a-z0-9_.-]\{1,\}:\).*/\1/p' | - tr '\n' ' ' )" - COMPREPLY=( $( compgen -P "$prefix" -W "$_tshark_prefs" \ - -- "${cur:${#prefix}}" ) ) + tr '\n' ' ')" + COMPREPLY=( $(compgen -P "$prefix" -W "$_tshark_prefs" \ + -- "${cur:${#prefix}}") ) [[ $COMPREPLY == *: ]] && compopt -o nospace fi return @@ -37,8 +37,8 @@ _tshark() return ;; -*i) - COMPREPLY=( $( compgen -W \ - "$( "$1" -D 2>/dev/null | awk '{print $2}' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + "$("$1" -D 2>/dev/null | awk '{print $2}')" -- "$cur") ) return ;; -*y) @@ -49,13 +49,12 @@ _tshark() break fi done - COMPREPLY=( $( compgen -W "$( "$1" $opts -L 2>&1 | \ - awk '/^ / { print $1 }' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$("$1" $opts -L 2>&1 | \ + awk '/^ / { print $1 }')" -- "$cur") ) return ;; -*[ab]) - COMPREPLY=( $( compgen -W 'duration: filesize: files:' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'duration: filesize: files:' -- "$cur") ) [[ $COMPREPLY == *: ]] && compopt -o nospace return ;; @@ -73,36 +72,36 @@ _tshark() return ;; -*F) - COMPREPLY=( $( compgen -W "$( "$1" -F 2>&1 | \ - awk '/^ / { print $1 }' )" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$("$1" -F 2>&1 | \ + awk '/^ / { print $1 }')" -- "$cur") ) return ;; -*O) local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," - COMPREPLY=( $( compgen -W "$( "$1" -G protocols 2>&1 | cut -f 3 )" \ - -- "${cur##*,}" ) ) + COMPREPLY=( $(compgen -W "$("$1" -G protocols 2>&1 | cut -f 3)" \ + -- "${cur##*,}") ) [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} ) return ;; -*T) # Parse from: tshark -T . 2>&1 | awk -F \" '/^\t*"/ { print $2 }' - COMPREPLY=( $( compgen -W \ - 'pdml ps psml json jsonraw ek tabs text fields' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + 'pdml ps psml json jsonraw ek tabs text fields' -- "$cur") ) return ;; -*t) # Parse from: tshark -t . 2>&1 | awk -F \" '/^\t*"/ { print $2 }' - COMPREPLY=( $( compgen -W \ - 'a ad adoy d dd e r u ud udoy' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + 'a ad adoy d dd e r u ud udoy' -- "$cur") ) return ;; -*u) # TODO: could be parsed from "-u ." output - COMPREPLY=( $( compgen -W 's hms' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 's hms' -- "$cur") ) return ;; -*W) - COMPREPLY=( $( compgen -W 'n' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'n' -- "$cur") ) return ;; -*X) @@ -110,24 +109,24 @@ _tshark() cur=${cur#*:} _filedir lua else - COMPREPLY=( $( compgen -P "$prefix" -W 'lua_script:' -- \ - "${cur:${#prefix}}" ) ) + COMPREPLY=( $(compgen -P "$prefix" -W 'lua_script:' -- \ + "${cur:${#prefix}}") ) [[ $COMPREPLY == *: ]] && compopt -o nospace fi return ;; -*G) - COMPREPLY=( $( compgen -W "$( "$1" -G \? 2>/dev/null | \ + COMPREPLY=( $(compgen -W "$("$1" -G \? 2>/dev/null | \ awk '/^[ \t]*-G / \ - { sub("^[[]","",$2); sub("[]]$","",$2); print $2 }' )" \ - -- "$cur" ) ) + { sub("^[[]","",$2); sub("[]]$","",$2); print $2 }')" \ + -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) return fi } && diff --git a/completions/tune2fs b/completions/tune2fs index e34ef9221e2..ab79cd512df 100644 --- a/completions/tune2fs +++ b/completions/tune2fs @@ -10,12 +10,12 @@ _tune2fs() return ;; -*e) - COMPREPLY=( $( compgen -W 'continue remount-ro panic' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'continue remount-ro panic' -- "$cur") ) return ;; -*g) _gids - COMPREPLY=( $( compgen -g -W '${COMPREPLY[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -g -W '${COMPREPLY[@]}' -- "$cur") ) return ;; -*M) @@ -26,7 +26,7 @@ _tune2fs() local -a opts=(^debug ^bsdgroups ^user_xattr ^acl ^uid16 ^journal_data ^journal_data_ordered ^journal_data_writeback ^nobarrier ^block_validity ^discard ^nodelalloc) - COMPREPLY=( $( compgen -W '${opts[@]} ${opts[@]#^}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${opts[@]} ${opts[@]#^}' -- "$cur") ) return ;; -*O) @@ -34,22 +34,22 @@ _tune2fs() ^filetype ^flex_bg ^has_journal ^huge_file ^large_file ^metadata_csum ^mmp ^project ^quota ^read-only ^resize_inode ^sparse_super ^uninit_bg) - COMPREPLY=( $( compgen -W '${opts[@]} ${opts[@]#^}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${opts[@]} ${opts[@]#^}' -- "$cur") ) return ;; -*u) _uids - COMPREPLY=( $( compgen -u -W '${COMPREPLY[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -u -W '${COMPREPLY[@]}' -- "$cur") ) return ;; -*U) - COMPREPLY=( $( compgen -W 'clear random time' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'clear random time' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) return fi diff --git a/completions/ulimit b/completions/ulimit index 158cb365733..3887cdf5715 100644 --- a/completions/ulimit +++ b/completions/ulimit @@ -10,7 +10,7 @@ _ulimit() local mode case $prev in -a) - COMPREPLY=( $( compgen -W "-S -H" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "-S -H" -- "$cur") ) return ;; -[SH]) @@ -27,7 +27,7 @@ _ulimit() done if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) return fi fi @@ -35,7 +35,7 @@ _ulimit() local args _count_args [[ $args -eq 1 ]] && \ - COMPREPLY=( $( compgen -W "soft hard unlimited" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "soft hard unlimited" -- "$cur") ) } && complete -F _ulimit ulimit diff --git a/completions/unace b/completions/unace index 0f8963e0c67..a58bd6f0a3b 100644 --- a/completions/unace +++ b/completions/unace @@ -6,10 +6,10 @@ _unace() _init_completion || return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '-c -c- -f -f- -o -o- -p -y -y-' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-c -c- -f -f- -o -o- -p -y -y-' -- "$cur") ) else if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'e l t v x' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'e l t v x' -- "$cur") ) else _filedir ace fi diff --git a/completions/unpack200 b/completions/unpack200 index 20c1d17521a..0e1957e9158 100644 --- a/completions/unpack200 +++ b/completions/unpack200 @@ -10,11 +10,11 @@ _unpack200() return ;; --deflate-hint|-!(-*)H) - COMPREPLY=( $( compgen -W 'true false keep' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'true false keep' -- "$cur") ) return ;; --log-file|-!(-*)l) - COMPREPLY=( $( compgen -W '-' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-' -- "$cur") ) _filedir log return ;; @@ -33,8 +33,8 @@ _unpack200() if ! $pack ; then if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '--deflate-hint= --remove-pack-file - --verbose --quiet --log-file= --help --version' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--deflate-hint= --remove-pack-file + --verbose --quiet --log-file= --help --version' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else _filedir 'pack?(.gz)' diff --git a/completions/unrar b/completions/unrar index 3340d24c605..5381876fbf5 100644 --- a/completions/unrar +++ b/completions/unrar @@ -6,12 +6,12 @@ _unrar() _init_completion || return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '-ad -ap -av- -c- -cfg- -cl -cu -dh -ep -f + COMPREPLY=( $(compgen -W '-ad -ap -av- -c- -cfg- -cl -cu -dh -ep -f -idp -ierr -inul -kb -o+ -o- -ow -p -p- -r -ta -tb -tn -to -u -v - -ver -vp -x -x@ -y' -- "$cur" ) ) + -ver -vp -x -x@ -y' -- "$cur") ) else if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'e l lb lt p t v vb vt x' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'e l lb lt p t v vb vt x' -- "$cur") ) else _filedir rar fi diff --git a/completions/unshunt b/completions/unshunt index 8815f843ca3..214fa42393b 100644 --- a/completions/unshunt +++ b/completions/unshunt @@ -6,7 +6,7 @@ _unshunt() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) else _filedir -d fi diff --git a/completions/update-alternatives b/completions/update-alternatives index 43cc3229aa9..e9ba476b903 100644 --- a/completions/update-alternatives +++ b/completions/update-alternatives @@ -13,7 +13,7 @@ _installed_alternatives() break fi done - COMPREPLY=( $( compgen -W '$( command ls $admindir )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(command ls $admindir)' -- "$cur") ) } _update_alternatives() @@ -60,7 +60,7 @@ _update_alternatives() _filedir ;; 1) - COMPREPLY=( $( compgen -W '--slave' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--slave' -- "$cur") ) ;; 3) _installed_alternatives @@ -82,9 +82,9 @@ _update_alternatives() _installed_alternatives ;; *) - COMPREPLY=( $( compgen -W '--verbose --quiet --help --version + COMPREPLY=( $(compgen -W '--verbose --quiet --help --version --altdir --admindir --install --remove --auto --display - --config --set' -- "$cur" ) ) + --config --set' -- "$cur") ) esac } && complete -F _update_alternatives update-alternatives alternatives diff --git a/completions/update-rc.d b/completions/update-rc.d index 85c9a5a4b68..91adbed64e9 100644 --- a/completions/update-rc.d +++ b/completions/update-rc.d @@ -17,15 +17,15 @@ _update_rc_d() options=( -f -n ) if [[ $cword -eq 1 || "$prev" == -* ]]; then - valid_options=( $( \ + valid_options=( $(\ tr " " "\n" <<<"${words[@]} ${options[@]}" \ - | command sed -ne "/$( command sed "s/ /\\|/g" <<<"${options[@]}" )/p" \ + | command sed -ne "/$(command sed "s/ /\\|/g" <<<"${options[@]}")/p" \ | sort | uniq -u \ ) ) - COMPREPLY=( $( compgen -W '${options[@]} ${services[@]}' \ - -X '$( tr " " "|" <<<${words[@]} )' -- "$cur" ) ) - elif [[ "$prev" == ?($( tr " " "|" <<<${services[@]} )) ]]; then - COMPREPLY=( $( compgen -W 'remove defaults start stop' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${options[@]} ${services[@]}' \ + -X '$(tr " " "|" <<<${words[@]})' -- "$cur") ) + elif [[ "$prev" == ?($(tr " " "|" <<<${services[@]})) ]]; then + COMPREPLY=( $(compgen -W 'remove defaults start stop' -- "$cur") ) elif [[ "$prev" == defaults && "$cur" == [0-9] ]]; then COMPREPLY=( 0 1 2 3 4 5 6 7 8 9 ) elif [[ "$prev" == defaults && "$cur" == [sk]?([0-9]) ]]; then @@ -53,7 +53,7 @@ _update_rc_d() COMPREPLY=() fi elif [[ "$prev" == "." ]]; then - COMPREPLY=( $( compgen -W "start stop" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "start stop" -- "$cur") ) else COMPREPLY=() fi diff --git a/completions/upgradepkg b/completions/upgradepkg index 2a4b98450b5..7b7757691cb 100644 --- a/completions/upgradepkg +++ b/completions/upgradepkg @@ -6,8 +6,8 @@ _upgradepkg() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--dry-run --install-new --reinstall - --verbose' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--dry-run --install-new --reinstall + --verbose' -- "$cur") ) return fi @@ -16,9 +16,9 @@ _upgradepkg() cur="${cur#*%}" local nofiles IFS=$'\n' compopt -o filenames - COMPREPLY=( $( compgen -P "$prev%" -f -X "!*.@(t[bgxl]z)" -- "$cur" ) ) + COMPREPLY=( $(compgen -P "$prev%" -f -X "!*.@(t[bgxl]z)" -- "$cur") ) [[ $COMPREPLY ]] || nofiles=1 - COMPREPLY+=( $( compgen -P "$prev%" -S '/' -d -- "$cur" ) ) + COMPREPLY+=( $(compgen -P "$prev%" -S '/' -d -- "$cur") ) [[ $nofiles ]] && compopt -o nospace return fi diff --git a/completions/urlsnarf b/completions/urlsnarf index 03355db58c0..d3581c5f661 100644 --- a/completions/urlsnarf +++ b/completions/urlsnarf @@ -17,7 +17,7 @@ _urlsnarf() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) fi } && diff --git a/completions/uscan b/completions/uscan index 7ca754aec2f..de0e71740ab 100644 --- a/completions/uscan +++ b/completions/uscan @@ -7,7 +7,7 @@ _uscan() case $prev in --package) - COMPREPLY=( $( _xfunc apt-cache _apt_cache_src_packages )) + COMPREPLY=( $(_xfunc apt-cache _apt_cache_src_packages)) return ;; --watchfile) @@ -26,7 +26,7 @@ _uscan() $split && return - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) } && complete -F _uscan uscan diff --git a/completions/useradd b/completions/useradd index e48626869f0..8e095441e60 100644 --- a/completions/useradd +++ b/completions/useradd @@ -19,13 +19,13 @@ _useradd() ;; --gid|-!(-*)g) _gids - COMPREPLY=( $( compgen -W '${COMPREPLY[@]} $( compgen -g )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]} $(compgen -g)' \ + -- "$cur") ) return ;; --groups|-!(-*)G) local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," - COMPREPLY=( $( compgen -g -- "${cur##*,}" ) ) + COMPREPLY=( $(compgen -g -- "${cur##*,}") ) [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} ) return ;; @@ -38,7 +38,7 @@ _useradd() $split && return [[ "$cur" == -* ]] && \ - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) } && complete -F _useradd useradd diff --git a/completions/userdel b/completions/userdel index e2511a7321e..7d637d2eac5 100644 --- a/completions/userdel +++ b/completions/userdel @@ -16,11 +16,11 @@ _userdel() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) } && complete -F _userdel userdel diff --git a/completions/usermod b/completions/usermod index 36a173b13a1..3d0efdbddfd 100644 --- a/completions/usermod +++ b/completions/usermod @@ -15,13 +15,13 @@ _usermod() ;; --gid|-!(-*)g) _gids - COMPREPLY=( $( compgen -W '${COMPREPLY[@]} $( compgen -g )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]} $(compgen -g)' \ + -- "$cur") ) return ;; --groups|-!(-*)G) local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," - COMPREPLY=( $( compgen -g -- "${cur##*,}" ) ) + COMPREPLY=( $(compgen -g -- "${cur##*,}") ) [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} ) return ;; @@ -39,11 +39,11 @@ _usermod() if [[ "$cur" == -* ]]; then # TODO: -U/--unlock, -p/--password, -L/--lock mutually exclusive - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi - COMPREPLY=( $( compgen -u -- "$cur" ) ) + COMPREPLY=( $(compgen -u -- "$cur") ) } && complete -F _usermod usermod diff --git a/completions/valgrind b/completions/valgrind index 97e4cc5949b..6aef409b9e7 100644 --- a/completions/valgrind +++ b/completions/valgrind @@ -31,24 +31,24 @@ _valgrind() --tool) # Tools seem to be named e.g. like memcheck-amd64-linux from which # we want to grab memcheck. - COMPREPLY=( $( compgen -W '$( + COMPREPLY=( $(compgen -W '$( for f in /usr{,/local}/lib{,64}/valgrind/*; do [[ $f != *.so && -x $f ]] && command sed -ne "s/^.*\/\(.*\)-\([^-]*\)-\([^-]*\)/\1/p" <<<$f - done )' -- "$cur" ) ) + done)' -- "$cur") ) return ;; --sim-hints) - COMPREPLY=( $( compgen -W 'lax-ioctls enable-outer' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'lax-ioctls enable-outer' -- "$cur") ) return ;; --soname-synonyms) - COMPREPLY=( $( compgen -W 'somalloc' -S = -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'somalloc' -S = -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return ;; --kernel-variant) - COMPREPLY=( $( compgen -W 'bproc' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'bproc' -- "$cur") ) return ;; # callgrind: @@ -58,19 +58,19 @@ _valgrind() ;; # exp-dhat: --sort-by) - COMPREPLY=( $( compgen -W 'max-bytes-live tot-bytes-allocd - max-blocks-live' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'max-bytes-live tot-bytes-allocd + max-blocks-live' -- "$cur") ) return ;; # massif: --time-unit) - COMPREPLY=( $( compgen -W 'i ms B' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'i ms B' -- "$cur") ) return ;; # generic cases parsed from --help output --+([-A-Za-z0-9_])) - local value=$( $1 --help-debug $tool 2>/dev/null | \ - command sed -ne "s|^[[:blank:]]*$prev=\([^[:blank:]]\{1,\}\).*|\1|p" ) + local value=$($1 --help-debug $tool 2>/dev/null | \ + command sed -ne "s|^[[:blank:]]*$prev=\([^[:blank:]]\{1,\}\).*|\1|p") case $value in \) _filedir @@ -78,18 +78,18 @@ _valgrind() ;; \) compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=( $(compgen -c -- "$cur") ) return ;; \<+([0-9])..+([0-9])\>) - COMPREPLY=( $( compgen -W "{${value:1:((${#value}-2))}}" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "{${value:1:((${#value}-2))}}" \ + -- "$cur") ) return ;; # "yes", "yes|no", etc (but not "string", "STR", # "hint1,hint2,...") yes|+([-a-z0-9])\|+([-a-z0-9\|])) - COMPREPLY=( $( IFS='|' compgen -W '$value' -- "$cur" ) ) + COMPREPLY=( $(IFS='|' compgen -W '$value' -- "$cur") ) return ;; esac @@ -99,8 +99,8 @@ _valgrind() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" "--help $tool" )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" "--help $tool")' \ + -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/vipw b/completions/vipw index 44516b9571d..46771a0ac04 100644 --- a/completions/vipw +++ b/completions/vipw @@ -15,7 +15,7 @@ _vipw() ;; esac - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) } && complete -F _vipw vipw vigr diff --git a/completions/vmstat b/completions/vmstat index 4f3bf342b88..f15d4089884 100644 --- a/completions/vmstat +++ b/completions/vmstat @@ -11,15 +11,15 @@ _vmstat() ;; --unit|-!(-*)S) [[ $OSTYPE == *linux* ]] && \ - COMPREPLY=( $( compgen -W 'k K m M' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'k K m M' -- "$cur") ) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY ]] || \ - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) fi } && complete -F _vmstat vmstat diff --git a/completions/vncviewer b/completions/vncviewer index 9b307331d6f..07799120b9a 100644 --- a/completions/vncviewer +++ b/completions/vncviewer @@ -27,8 +27,8 @@ _tightvncviewer() return ;; -encodings) - COMPREPLY=( $( compgen -W 'copyrect tight hextile zlib corre rre - raw' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'copyrect tight hextile zlib corre rre + raw' -- "$cur") ) return ;; -via) @@ -39,10 +39,10 @@ _tightvncviewer() if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-help -listen -via -shared -noshared + COMPREPLY=( $(compgen -W '-help -listen -via -shared -noshared -viewonly -fullscreen -noraiseonbeep -passwd -encodings -bgr233 -owncmap -truecolour -truecolor -depth -compresslevel -quality - -nojpeg -nocursorshape -x11cursor' -- "$cur" ) ) + -nojpeg -nocursorshape -x11cursor' -- "$cur") ) else _known_hosts_real -- "$cur" fi @@ -67,7 +67,7 @@ _xvnc4viewer() ;; # -PreferredEncoding -[pP][rR][eE][fF][eE][rR][rR][eE][dD][eE][nN][cC][oO][dD][iI][nN][gG]) - COMPREPLY=( $( compgen -W 'zrle hextile raw' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'zrle hextile raw' -- "$cur") ) return ;; # -via @@ -87,11 +87,11 @@ _xvnc4viewer() WMDecorationWidth ZlibLevel ) [[ "$cur" == --* ]] && dash=-- || dash=- - local IFS=$' \t\n' reset=$( shopt -p nocasematch ); shopt -s nocasematch + local IFS=$' \t\n' reset=$(shopt -p nocasematch); shopt -s nocasematch local option - COMPREPLY=( $( for option in "${options[@]}"; do + COMPREPLY=( $(for option in "${options[@]}"; do [[ $dash$option == "$cur"* ]] && printf '%s\n' $dash$option - done ) ) + done) ) $reset else _known_hosts_real -- "$cur" diff --git a/completions/vpnc b/completions/vpnc index b7b8c14a1e0..5eb5be71714 100644 --- a/completions/vpnc +++ b/completions/vpnc @@ -16,12 +16,12 @@ _vpnc() return ;; --vendor) - COMPREPLY=( $( compgen -W 'cisco netscreen' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'cisco netscreen' -- "$cur") ) return ;; --natt-mode) - COMPREPLY=( $( compgen -W 'natt none force-natt cisco-udp' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'natt none force-natt cisco-udp' \ + -- "$cur") ) return ;; --script|--pid-file|--ca-file) @@ -29,23 +29,23 @@ _vpnc() return ;; --dh) - COMPREPLY=( $( compgen -W 'dh1 dh2 dh5' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'dh1 dh2 dh5' -- "$cur") ) return ;; --pfs) - COMPREPLY=( $( compgen -W 'nopfs dh1 dh2 dh5 server' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'nopfs dh1 dh2 dh5 server' -- "$cur") ) return ;; --ifmode) - COMPREPLY=( $( compgen -W 'tun tap' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'tun tap' -- "$cur") ) return ;; --debug) - COMPREPLY=( $( compgen -W '0 1 2 3 99' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '0 1 2 3 99' -- "$cur") ) return ;; --auth-mode) - COMPREPLY=( $( compgen -W 'psk cert hybrid' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'psk cert hybrid' -- "$cur") ) return ;; --ca-dir) @@ -54,14 +54,13 @@ _vpnc() ;; --password-helper) compopt -o filenames - COMPREPLY=( $( compgen -c -- "$cur" ) ) + COMPREPLY=( $(compgen -c -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --long-help )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" --long-help)' -- "$cur") ) elif [[ "$cur" == */* ]]; then # explicit filename _filedir conf @@ -74,7 +73,7 @@ _vpnc() $reset IFS=$'\n' compopt -o filenames - COMPREPLY=( $( compgen -W '${configs[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${configs[@]}' -- "$cur") ) fi } && complete -F _vpnc vpnc diff --git a/completions/watch b/completions/watch index 49c2cde308a..eb04df89372 100644 --- a/completions/watch +++ b/completions/watch @@ -33,7 +33,7 @@ _watch() case $prev in --differences|-!(-*)d) [[ $cur != -* ]] && \ - COMPREPLY=( $( compgen -W 'cumulative' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'cumulative' -- "$cur") ) return ;; --interval|-!(-*)n) @@ -44,7 +44,7 @@ _watch() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/webmitm b/completions/webmitm index 308f22810bc..d50bc3e3ffd 100644 --- a/completions/webmitm +++ b/completions/webmitm @@ -6,7 +6,7 @@ _webmitm() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) else _known_hosts_real -- "$cur" fi diff --git a/completions/wget b/completions/wget index 71089c3b2c4..7994a4a10bc 100644 --- a/completions/wget +++ b/completions/wget @@ -10,7 +10,7 @@ _wget() return ;; --progress) - COMPREPLY=( $( compgen -W 'bar dot' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'bar dot' -- "$cur") ) return ;; --bind-address) @@ -37,24 +37,24 @@ _wget() excludes+=( ascii ) ;; esac - local excludes_str=$( export IFS='|'; echo "${excludes[*]}"; ) + local excludes_str=$(export IFS='|'; echo "${excludes[*]}";) # prevopt is the previous options string used as a prefix # to avoid COMPREPLY replacing them with the $lastopt completion local lastopt=${cur/*,} prevopt= [[ $cur == *,* ]] && prevopt=${cur%,*}, - COMPREPLY=( $( compgen -P "$prevopt" -X "@($excludes_str)" \ + COMPREPLY=( $(compgen -P "$prevopt" -X "@($excludes_str)" \ -W 'unix windows nocontrol ascii lowercase uppercase' \ - -- "$lastopt" ) ) + -- "$lastopt") ) # +o nospace when no more valid option is possible (= append a space) - local opt_as_arr=( $( echo ${COMPREPLY[0]//,/ } ) ) + local opt_as_arr=( $(echo ${COMPREPLY[0]//,/ }) ) [[ ${#opt_as_arr[@]} -lt 4 ]] && compopt -o nospace return ;; --prefer-family) - COMPREPLY=( $( compgen -W 'IPv4 IPv6 none' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'IPv4 IPv6 none' -- "$cur") ) return ;; --directory-prefix|--ca-directory|--warc-tempdir|-!(-*)P) @@ -72,18 +72,18 @@ _wget() return ;; --secure-protocol) - COMPREPLY=( $( compgen -W 'auto SSLv2 SSLv3 TLSv1' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'auto SSLv2 SSLv3 TLSv1' -- "$cur") ) return ;; --certificate-type|--private-key-type) - COMPREPLY=( $( compgen -W 'PEM DER' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'PEM DER' -- "$cur") ) return ;; --follow-tags|--ignore-tags) local lastopt=${cur/*,} prevopt= [[ $cur == *,* ]] && prevopt=${cur%,*}, - COMPREPLY=( $( compgen -P "$prevopt" -W 'a abbr acronym address + COMPREPLY=( $(compgen -P "$prevopt" -W 'a abbr acronym address applet area b base basefont bdo big blockquote body br button caption center cite code col colgroup dd del dir div dfn dl dt em fieldset font form frame frameset h6 head hr html i iframe @@ -91,37 +91,37 @@ _wget() noframes noscript object ol optgroup option p param pre q s samp script select small span strike strong style sub sup table tbody td textarea tfoot th thead title tr tt u ul var xmp' \ - -- "$lastopt" ) ) + -- "$lastopt") ) return ;; --tries|--timeout|--dns-timeout|--connect-timeout|--read-timeout|\ --wait|--waitretry|--cut-dirs|--max-redirect|--level|-!(-*)[tTwl]) # expect integer number - COMPREPLY+=( $( compgen -P "$cur" -W "{0..9}" ) ) + COMPREPLY+=( $(compgen -P "$cur" -W "{0..9}") ) compopt -o nospace return ;; --quota|--limit-rate|--warc-max-size|-!(-*)Q) # expect size if [[ $cur == *[km] ]]; then - COMPREPLY=( $( compgen -W "$cur" ) ) + COMPREPLY=( $(compgen -W "$cur") ) elif [[ $cur ]]; then - COMPREPLY=( $( compgen -P "$cur" -W "{0..9} k m" ) ) + COMPREPLY=( $(compgen -P "$cur" -W "{0..9} k m") ) compopt -o nospace else - COMPREPLY=( $( compgen -W "{0..9}" ) ) + COMPREPLY=( $(compgen -W "{0..9}") ) compopt -o nospace fi return ;; --user|--http-user|--proxy-user|--ftp-user) - COMPREPLY=( $( compgen -W "$( command sed -n \ + COMPREPLY=( $(compgen -W "$(command sed -n \ '/^login/s/^[[:blank:]]*login[[:blank:]]//p' ~/.netrc \ - 2>/dev/null )" -- "$cur" ) ) + 2>/dev/null)" -- "$cur") ) return ;; --header) - COMPREPLY=( $( compgen -W 'Accept Accept-Charset Accept-Encoding + COMPREPLY=( $(compgen -W 'Accept Accept-Charset Accept-Encoding Accept-Language Accept-Ranges Age Allow Authorization Cache-Control Connection Content-Encoding Content-Language Content-Length Content-Location Content-MD5 Content-Range @@ -130,25 +130,26 @@ _wget() Last-Modified Location Max-Forwards Pragma Proxy-Authenticate Proxy-Authorization Range Referer Retry-After Server TE Trailer Transfer-Encoding Upgrade User-Agent Vary Via Warning - WWW-Authenticate' -- "$cur" ) ) + WWW-Authenticate' -- "$cur") ) compopt -o nospace return ;; --local-encoding|--remote-encoding) type -P xauth &>/dev/null && \ - COMPREPLY=( $( compgen -W '$( iconv -l 2>/dev/null | \ - command sed -e "s@/*\$@@" -e "s/[,()]//g" 2>/dev/null )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(iconv -l 2>/dev/null | \ + command sed -e "s@/*\$@@" -e "s/[,()]//g" 2>/dev/null)' \ + -- "$cur" ) ) return ;; --execute|-!(-*)e) return # TODO base=STR ;; --report-speed) - COMPREPLY=( $( compgen -W 'bits' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'bits' -- "$cur") ) return ;; --regex-type) - COMPREPLY=( $( compgen -W 'posix' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'posix' -- "$cur") ) return ;; --base|--password|--ftp-password|--http-password|--proxy-password|\ @@ -163,7 +164,7 @@ _wget() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi diff --git a/completions/wine b/completions/wine index be29975574f..f871e74407c 100644 --- a/completions/wine +++ b/completions/wine @@ -7,7 +7,7 @@ _wine() if [[ $cword -eq 1 ]]; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --version' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--help --version' -- "$cur") ) [[ $COMPREPLY ]] && return fi _filedir '@([eE][xX][eE]?(.[sS][oO])|[cC][oO][mM]|[sS][cC][rR]|[mM][sS][iI])' diff --git a/completions/withlist b/completions/withlist index 913e410bf84..cd030a2763a 100644 --- a/completions/withlist +++ b/completions/withlist @@ -6,8 +6,8 @@ _withlist() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--lock --interactive --run --all --quiet - --help' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--lock --interactive --run --all --quiet + --help' -- "$cur") ) else _xfunc list_lists _mailman_lists fi diff --git a/completions/wodim b/completions/wodim index 7380166b02e..ac1dc5a9bbc 100644 --- a/completions/wodim +++ b/completions/wodim @@ -16,8 +16,8 @@ _cdrecord() _filedir ;; blank) - COMPREPLY=( $( compgen -W 'help all fast track unreserve trtail - unclose session' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'help all fast track unreserve trtail + unclose session' -- "$cur") ) ;; driveropts) if [[ $cur == *=* ]]; then @@ -25,31 +25,30 @@ _cdrecord() cur=${cur#*=} case $prev in varirec) - COMPREPLY=( $( compgen -W "-2 -1 0 1 2" \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W "-2 -1 0 1 2" -- "$cur") ) ;; gigarec) - COMPREPLY=( $( compgen -W "0.6 0.7 0.8 1.0 1.2 1.3 - 1.4" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "0.6 0.7 0.8 1.0 1.2 1.3 + 1.4" -- "$cur") ) ;; tattoofile) _filedir ;; esac else - COMPREPLY=( $( compgen -W 'burnfree noburnfree varirec= + COMPREPLY=( $(compgen -W 'burnfree noburnfree varirec= gigarec= audiomaster forcespeed noforcespeed speedread nospeedread singlesession nosinglesession hidecdr - nohidecdr tattooinfo tattoofile=' -- "$cur" ) ) + nohidecdr tattooinfo tattoofile=' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi ;; driver) - COMPREPLY=( $( compgen -W "$( $1 driver=help 2>&1 | \ - awk 'NR > 1 { print $1 }' ) help" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$($1 driver=help 2>&1 | \ + awk 'NR > 1 { print $1 }') help" -- "$cur") ) ;; minbuf) - COMPREPLY=( $( compgen -W '{25..95}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{25..95}' -- "$cur") ) ;; esac return @@ -83,10 +82,10 @@ _cdrecord() # files are always eligible completion _filedir # track options are always available - COMPREPLY+=( $( compgen -W '${track_options[@]}' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W '${track_options[@]}' -- "$cur") ) # general options are no more available after file or track option if [[ $track_mode -eq 0 ]]; then - COMPREPLY+=( $( compgen -W '${generic_options[@]}' -- "$cur" ) ) + COMPREPLY+=( $(compgen -W '${generic_options[@]}' -- "$cur") ) fi [[ $COMPREPLY == *= ]] && compopt -o nospace } && diff --git a/completions/wol b/completions/wol index bd40978c76c..0222b24d8f6 100644 --- a/completions/wol +++ b/completions/wol @@ -12,10 +12,10 @@ _wol() --host|--ipaddr|-!(-*)[hi]) # Broadcast addresses local PATH=$PATH:/sbin - COMPREPLY=( $( { ip addr show || ifconfig -a; } 2>/dev/null | \ + COMPREPLY=( $({ ip addr show || ifconfig -a; } 2>/dev/null | \ command sed -ne 's/.*[[:space:]]Bcast:\([^[:space:]]*\).*/\1/p' -ne \ 's/.*inet.*[[:space:]]brd[[:space:]]\([^[:space:]]*\).*/\1/p' -ne \ - 's/.*[[:space:]]broadcast[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' ) ) + 's/.*[[:space:]]broadcast[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p') ) _known_hosts_real -- "$cur" return ;; @@ -28,7 +28,7 @@ _wol() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/wsimport b/completions/wsimport index a7f591e711e..406a47d7dd5 100644 --- a/completions/wsimport +++ b/completions/wsimport @@ -22,7 +22,7 @@ _wsimport() return ;; -target) - COMPREPLY=( $( compgen -W '2.0 2.1 2.2' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '2.0 2.1 2.2' -- "$cur") ) return ;; -clientjar) @@ -35,8 +35,7 @@ _wsimport() _known_hosts_real -- "${cur#-httpproxy:}" return elif [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) [[ $COMPREPLY == *: ]] && compopt -o nospace __ltrim_colon_completions "$cur" return diff --git a/completions/wtf b/completions/wtf index 26a0d4b870b..b21e6e1933a 100644 --- a/completions/wtf +++ b/completions/wtf @@ -32,8 +32,8 @@ _wtf() [[ -z "$db" ]] && return fi - COMPREPLY=( $( compgen -W "$( cut -f 1 -s $db* 2>/dev/null ) $addf" \ - -- "${cur^^}" ) ) + COMPREPLY=( $(compgen -W "$(cut -f 1 -s $db* 2>/dev/null) $addf" \ + -- "${cur^^}") ) } && complete -F _wtf wtf diff --git a/completions/wvdial b/completions/wvdial index e456f1b160a..e03166172c1 100644 --- a/completions/wvdial +++ b/completions/wvdial @@ -18,7 +18,7 @@ _wvdial() case $cur in -*) - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace ;; *) @@ -33,7 +33,7 @@ _wvdial() done # parse config files for sections and # remove default section - COMPREPLY=( $( command sed -ne "s|^\[Dialer \($cur.*\)\]$|\1|p" $config \ + COMPREPLY=( $(command sed -ne "s|^\[Dialer \($cur.*\)\]$|\1|p" $config \ 2>/dev/null | command grep -v '^Defaults$')) # escape spaces COMPREPLY=${COMPREPLY// /\\ } diff --git a/completions/xdg-mime b/completions/xdg-mime index 92d5b838199..dede3d57a9e 100644 --- a/completions/xdg-mime +++ b/completions/xdg-mime @@ -2,8 +2,8 @@ _xdg_mime_mimetype() { - COMPREPLY+=( $( compgen -S / -W 'application audio font image message model - multipart text video' -- "$cur" ) ) + COMPREPLY+=( $(compgen -S / -W 'application audio font image message model + multipart text video' -- "$cur") ) [[ $COMPREPLY == */ ]] && compopt -o nospace } @@ -17,18 +17,18 @@ _xdg_mime() if [[ $args -eq 1 ]]; then if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '--help --manual --version' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--help --manual --version' -- "$cur") ) return fi - COMPREPLY=( $( compgen -W \ - 'query default install uninstall' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + 'query default install uninstall' -- "$cur") ) return fi case ${words[1]} in query) if [[ $args -eq 2 ]]; then - COMPREPLY=( $( compgen -W 'filetype default' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'filetype default' -- "$cur") ) return fi case ${words[2]} in # TODO and $args -eq 3 (takes only one arg!) @@ -43,25 +43,25 @@ _xdg_mime() desktops=( "${desktops[@]##*/}" ) $reset IFS=$'\n' - COMPREPLY=( $( compgen -W '${desktops[@]}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '${desktops[@]}' -- "$cur") ) else _xdg_mime_mimetype fi ;; install) if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '--mode --novendor' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--mode --novendor' -- "$cur") ) elif [[ $prev == --mode ]]; then - COMPREPLY=( $( compgen -W 'user system' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'user system' -- "$cur") ) else _filedir xml fi ;; uninstall) if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '--mode' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--mode' -- "$cur") ) elif [[ $prev == --mode ]]; then - COMPREPLY=( $( compgen -W 'user system' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'user system' -- "$cur") ) else _filedir xml fi diff --git a/completions/xdg-settings b/completions/xdg-settings index e46f6405081..4ee743aca77 100644 --- a/completions/xdg-settings +++ b/completions/xdg-settings @@ -12,18 +12,18 @@ _xdg_settings() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( "$1" --help | - tr "{|" "\n" | _parse_help - )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$("$1" --help | + tr "{|" "\n" | _parse_help -)' -- "$cur") ) return fi local args _count_args if [[ $args -eq 1 ]]; then - COMPREPLY=( $( compgen -W "get check set" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "get check set" -- "$cur") ) elif [[ $args -eq 2 ]]; then - COMPREPLY=( $( compgen -W \ - '$( "$1" --list | awk "!/^Known/ { print \$1 }" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$("$1" --list | awk "!/^Known/ { print \$1 }")' -- "$cur") ) fi } && complete -F _xdg_settings xdg-settings diff --git a/completions/xfreerdp b/completions/xfreerdp index df0cebf3fab..f025cfcef43 100644 --- a/completions/xfreerdp +++ b/completions/xfreerdp @@ -7,32 +7,32 @@ _xfreerdp() case $prev in # old/dash syntax -k) - COMPREPLY=( $( compgen -W '$( "$1" --kbd-list | - awk "/^0x/ { print \$1 }" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$("$1" --kbd-list | + awk "/^0x/ { print \$1 }")' -- "$cur") ) return ;; -a) - COMPREPLY=( $( compgen -W '8 15 16 24 32' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '8 15 16 24 32' -- "$cur") ) return ;; -x) - COMPREPLY=( $( compgen -W 'broadband modem lan' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'broadband modem lan' -- "$cur") ) return ;; --plugin) - COMPREPLY=( $( compgen -W 'cliprdr rdpsnd rdpdr' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'cliprdr rdpsnd rdpdr' -- "$cur") ) return ;; esac case $cur in # new/slash syntax /kbd:*) - COMPREPLY=( $( compgen -W '$( "$1" /kbd-list | - awk "/^0x/ { print \$1 }" )' -- "${cur#/kbd:}" ) ) + COMPREPLY=( $(compgen -W '$("$1" /kbd-list | + awk "/^0x/ { print \$1 }")' -- "${cur#/kbd:}") ) return ;; /bpp:*) - COMPREPLY=( $( compgen -W '8 15 16 24 32' -- "${cur#/bpp:}" ) ) + COMPREPLY=( $(compgen -W '8 15 16 24 32' -- "${cur#/bpp:}") ) return ;; /*:*|/help|/version|-h|--help|--version) @@ -41,24 +41,24 @@ _xfreerdp() esac if [[ "$cur" == /* ]]; then - COMPREPLY=( $( compgen -W '$( "$1" --help | - awk "\$1 ~ /^\\// && \$1 !~ /^.(flag\$|option:)/ { sub(\":.*\",\":\",\$1); print \$1 }" )' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$("$1" --help | + awk "\$1 ~ /^\\// && \$1 !~ /^.(flag\$|option:)/ { sub(\":.*\",\":\",\$1); print \$1 }")' \ + -- "$cur") ) [[ $COMPREPLY == *: ]] && compopt -o nospace elif [[ "$cur" == [+-]* ]]; then local char=${cur:0:1} - local help="$( $1 --help )" + local help="$($1 --help)" if [[ "$help" == */help* ]]; then # new/slash syntax - COMPREPLY=( $( compgen -W '$( awk " + COMPREPLY=( $(compgen -W '$(awk " \$1 ~ /^[+-]/ && \$1 !~ /^.toggle\$/ { sub(\"^.\",\"$char\",\$1); print \$1 } - " <<<"$help" )' -- "$cur" ) ) + " <<<"$help")' -- "$cur") ) else # old/dash syntax - COMPREPLY=( $( _parse_help - <<<"$help" ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]%:}' -- "$cur" ) ) + COMPREPLY=( $(_parse_help - <<<"$help") ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]%:}' -- "$cur") ) fi else - COMPREPLY=( $( compgen -W "$(awk '{print $1}' ~/.freerdp/known_hosts \ - 2>/dev/null)" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(awk '{print $1}' ~/.freerdp/known_hosts \ + 2>/dev/null)" -- "$cur") ) fi } && diff --git a/completions/xgamma b/completions/xgamma index 9fb6687e520..005928d2241 100644 --- a/completions/xgamma +++ b/completions/xgamma @@ -7,9 +7,9 @@ _xgamma() case "$prev" in -screen) - local screens=$( xrandr --query 2>/dev/null | command sed -n \ - '/^Screen /s|^Screen \{1,\}\(.*\):.*$|\1|p' 2>/dev/null ) - COMPREPLY=( $( compgen -W "$screens" -- "$cur" ) ) + local screens=$(xrandr --query 2>/dev/null | command sed -n \ + '/^Screen /s|^Screen \{1,\}\(.*\):.*$|\1|p' 2>/dev/null) + COMPREPLY=( $(compgen -W "$screens" -- "$cur") ) return ;; -gamma|-rgamma|-ggamma|-bgamma) @@ -17,7 +17,7 @@ _xgamma() if [[ $cur && "$cur" != *.* ]]; then COMPREPLY=( . ) fi - COMPREPLY+=( $( compgen -W "{0..9}" ) ) + COMPREPLY+=( $(compgen -W "{0..9}") ) compopt -o nospace return ;; @@ -26,15 +26,15 @@ _xgamma() if [[ "$cur" == :* && "$cur" != :*.* ]]; then # FIXME: where to get local display numbers? local display=${cur#:} - COMPREPLY=( $( compgen -W "${display:-0}." ) ) + COMPREPLY=( $(compgen -W "${display:-0}.") ) compopt -o nospace elif [[ "$cur" == :*.* ]]; then # local screen numbers - local t screens=$( xrandr --query 2>/dev/null | command sed -ne \ - '/^Screen /s|^Screen \{1,\}\(.*\):.*$|\1|p' 2>/dev/null ) + local t screens=$(xrandr --query 2>/dev/null | command sed -ne \ + '/^Screen /s|^Screen \{1,\}\(.*\):.*$|\1|p' 2>/dev/null) t="${cur#:}" - COMPREPLY=( $( compgen -P "${t%.*}." -W "$screens" -- \ - "${cur##*.}" ) ) + COMPREPLY=( $(compgen -P "${t%.*}." -W "$screens" -- \ + "${cur##*.}") ) elif [[ "$cur" != *:* ]]; then # complete hostnames _known_hosts_real -c -- "$cur" @@ -49,7 +49,7 @@ _xgamma() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace [[ $COMPREPLY ]] && return fi diff --git a/completions/xmllint b/completions/xmllint index 6d2ace0b1b3..f5865b398ba 100644 --- a/completions/xmllint +++ b/completions/xmllint @@ -35,13 +35,13 @@ _xmllint() return ;; --pretty) - COMPREPLY=( $( compgen -W '{0..2}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..2}' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) COMPREPLY=( "${COMPREPLY[@]%:}" ) return fi diff --git a/completions/xmlwf b/completions/xmlwf index e0dd0b67d24..9cd0e195fa2 100644 --- a/completions/xmlwf +++ b/completions/xmlwf @@ -11,8 +11,8 @@ _xmlwf() return ;; -*e) - COMPREPLY=( $( compgen -W 'US-ASCII UTF-8 UTF-16 ISO-8859-1' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'US-ASCII UTF-8 UTF-16 ISO-8859-1' \ + -- "$cur") ) return ;; -*v) @@ -21,7 +21,7 @@ _xmlwf() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) return fi diff --git a/completions/xmms b/completions/xmms index 7c3aff455fb..324f7677405 100644 --- a/completions/xmms +++ b/completions/xmms @@ -10,13 +10,13 @@ _xmms() return ;; --toggle-shuffle|--toggle-repeat|--toggle-advance|-!(-*)[SRA]) - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'on off' -- "$cur") ) return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) else _filedir '@(mp[23]|ogg|wav|pls|m3u|xm|mod|s[3t]m|it|mtm|ult|flac)' fi diff --git a/completions/xmodmap b/completions/xmodmap index e355a9593e6..38bc6391654 100644 --- a/completions/xmodmap +++ b/completions/xmodmap @@ -12,7 +12,7 @@ _xmodmap() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -help)' -- "$cur") ) return fi diff --git a/completions/xrandr b/completions/xrandr index b2b85cce14e..9b5b6a59fa7 100644 --- a/completions/xrandr +++ b/completions/xrandr @@ -12,8 +12,8 @@ _xrandr() return ;; --output|--left-of|--right-of|--above|--below|--same-as) - local outputs=$( "$1" | awk '/connected/ {print $1}' ) - COMPREPLY=( $( compgen -W "$outputs" -- "$cur" ) ) + local outputs=$("$1" | awk '/connected/ {print $1}') + COMPREPLY=( $(compgen -W "$outputs" -- "$cur") ) return ;; --mode) @@ -25,37 +25,38 @@ _xrandr() fi done if [[ $output ]]; then - local modes=$( "$1" | command sed -e "1,/^$output / d" \ + local modes=$("$1" | command sed -e "1,/^$output / d" \ -e "/connected/,$ d" \ - -e "s/\([^[:space:]]\)[[:space:]].*/\1/" ) - COMPREPLY=( $( compgen -W "$modes" -- "$cur" ) ) + -e "s/\([^[:space:]]\)[[:space:]].*/\1/") + COMPREPLY=( $(compgen -W "$modes" -- "$cur") ) fi return ;; -o|--orientation) - COMPREPLY=( $( compgen -W 'normal inverted left right 0 1 2 3' -- \ - "$cur" ) ) + COMPREPLY=( $(compgen -W 'normal inverted left right 0 1 2 3' -- \ + "$cur") ) return ;; --reflect) - COMPREPLY=( $( compgen -W 'normal x y xy' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'normal x y xy' -- "$cur") ) return ;; --rotate) - COMPREPLY=( $( compgen -W 'normal inverted left right' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'normal inverted left right' -- "$cur") ) return ;; --setprovideroutputsource|--setprovideroffloadsink) - local providers=$( "$1" --listproviders 2>/dev/null | - command sed -ne 's/.* name:\([^ ]*\).*/\1/p' ) - COMPREPLY=( $( compgen -W "$providers" -- "$cur" ) ) + local providers=$("$1" --listproviders 2>/dev/null | + command sed -ne 's/.* name:\([^ ]*\).*/\1/p') + COMPREPLY=( $(compgen -W "$providers" -- "$cur") ) # TODO 2nd arg needed, is that a provider as well? return ;; esac - COMPREPLY=( $( compgen -W '$( "$1" -help 2>&1 | - command sed -e "s/ or / /g" -e "s/<[^>]*>]//g" | _parse_help - )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$("$1" -help 2>&1 | + command sed -e "s/ or / /g" -e "s/<[^>]*>]//g" | _parse_help -)' \ + -- "$cur") ) } && complete -F _xrandr xrandr diff --git a/completions/xrdb b/completions/xrdb index 1f517cb3842..d9f1143952f 100644 --- a/completions/xrdb +++ b/completions/xrdb @@ -16,7 +16,7 @@ _xrdb() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi diff --git a/completions/xsltproc b/completions/xsltproc index 98d3e72a3cf..241de67b953 100644 --- a/completions/xsltproc +++ b/completions/xsltproc @@ -16,8 +16,8 @@ _xsltproc() ;; --encoding) # some aliases removed - COMPREPLY=( $( compgen -W "$( iconv -l | command sed -e '/^UTF[1378]/d' \ - -e '/^ISO[0-9_]/d' -e '/^8859/d' -e 's/\/.*//')" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "$(iconv -l | command sed -e '/^UTF[1378]/d' \ + -e '/^ISO[0-9_]/d' -e '/^8859/d' -e 's/\/.*//')" -- "$cur") ) return ;; --param|--stringparam) @@ -37,7 +37,7 @@ _xsltproc() [[ $cword -gt 2 && `_get_cword '' 2` == --?(string)param ]] && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) COMPREPLY=( "${COMPREPLY[@]%:}" ) else # TODO: 1st file xsl|xslt, 2nd XML diff --git a/completions/xxd b/completions/xxd index f190d75a787..f6bcb4a28e9 100644 --- a/completions/xxd +++ b/completions/xxd @@ -12,7 +12,7 @@ _xxd() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) return fi diff --git a/completions/xz b/completions/xz index 763c0db969b..b64921f153d 100644 --- a/completions/xz +++ b/completions/xz @@ -16,15 +16,15 @@ _xz() return ;; --check|-!(-*)C) - COMPREPLY=( $( compgen -W 'crc32 crc64 sha256 none' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'crc32 crc64 sha256 none' -- "$cur") ) return ;; --format|-!(-*)F) - COMPREPLY=( $( compgen -W 'auto xz lzma raw' -- "$cur" ) ) + COMPREPLY=( $(compgen -W 'auto xz lzma raw' -- "$cur") ) return ;; --threads|-!(-*)T) - COMPREPLY=( $( compgen -W "{0..$(_ncpus)}" -- "$cur" ) ) + COMPREPLY=( $(compgen -W "{0..$(_ncpus)}" -- "$cur") ) return ;; --memlimit|--memlimit-compress|--memlimit-decompress|--memory|\ @@ -39,8 +39,8 @@ _xz() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" --long-help ) {-1..-9}' \ - -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" --long-help) {-1..-9}' \ + -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi @@ -49,8 +49,7 @@ _xz() local IFS=$'\n' compopt -o filenames - COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ - $( compgen -d -- "$cur" ) ) + COMPREPLY=( $(compgen -f -X "$xspec" -- "$cur") $(compgen -d -- "$cur") ) } && complete -F _xz xz pxz diff --git a/completions/xzdec b/completions/xzdec index 0ce9d5585e9..6b402eb33eb 100644 --- a/completions/xzdec +++ b/completions/xzdec @@ -17,7 +17,7 @@ _xzdec() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/ypmatch b/completions/ypmatch index c6de48b3294..655390f247f 100644 --- a/completions/ypmatch +++ b/completions/ypmatch @@ -12,13 +12,13 @@ _ypmatch() if [[ $cmd == ypmatch && $cword -eq 1 && ${#words[@]} -eq 3 ]]; then map=${words[2]} - COMPREPLY=( $( compgen -W '$( ypcat $map 2>/dev/null | \ - cut -d':' -f 1 )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '$(ypcat $map 2>/dev/null | \ + cut -d':' -f 1)' -- "$cur") ) else [[ $cmd == ypmatch && $cword -ne 2 ]] && return - COMPREPLY=( $( compgen -W \ - '$( printf "%s\n" $(ypcat -x 2>/dev/null | \ - cut -d"\"" -f 2) )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$(printf "%s\n" $(ypcat -x 2>/dev/null | \ + cut -d"\"" -f 2))' -- "$cur") ) fi } && complete -F _ypmatch ypmatch ypcat diff --git a/completions/yum-arch b/completions/yum-arch index 9dac178e084..c0a66a819de 100644 --- a/completions/yum-arch +++ b/completions/yum-arch @@ -6,7 +6,7 @@ _yum_arch() _init_completion || return if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '-d -v -vv -n -c -z -s -l -q' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '-d -v -vv -n -c -z -s -l -q' -- "$cur") ) else _filedir -d fi diff --git a/completions/zopfli b/completions/zopfli index ee2c890c269..3c7ea4034ee 100644 --- a/completions/zopfli +++ b/completions/zopfli @@ -12,8 +12,8 @@ _zopfli() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W \ - '$( _parse_help "$1" -h | command sed -e "s/#$//" )' -- "$cur" ) ) + COMPREPLY=( $(compgen -W \ + '$(_parse_help "$1" -h | command sed -e "s/#$//")' -- "$cur") ) [[ $COMPREPLY == --i ]] && compopt -o nospace return fi @@ -22,8 +22,7 @@ _zopfli() local IFS=$'\n' xspec="*.@(gz|t[ag]z)" compopt -o filenames - COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ - $( compgen -d -- "$cur" ) ) + COMPREPLY=( $(compgen -f -X "$xspec" -- "$cur") $(compgen -d -- "$cur") ) } && complete -F _zopfli zopfli diff --git a/completions/zopflipng b/completions/zopflipng index 88ddbe68ec1..dff0356f37f 100644 --- a/completions/zopflipng +++ b/completions/zopflipng @@ -10,7 +10,7 @@ _zopflipng() return ;; --splitting) - COMPREPLY=( $( compgen -W '{0..3}' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '{0..3}' -- "$cur") ) return ;; esac @@ -18,8 +18,8 @@ _zopflipng() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( _parse_help "$1" -h ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]%:}' -- "$cur" ) ) + COMPREPLY=( $(_parse_help "$1" -h) ) + COMPREPLY=( $(compgen -W '${COMPREPLY[@]%:}' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi From 689beea52bd43bb45d96645f965e211351fbe579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 14 Apr 2019 19:19:51 +0300 Subject: [PATCH 0077/1094] *: remove whitespace after redirections --- Makefile.am | 4 ++-- README.md | 2 +- bash_completion | 16 ++++++++-------- completions/7z | 4 ++-- completions/_umount.linux | 8 ++++---- completions/ant | 4 ++-- completions/apt-build | 2 +- completions/apt-cache | 2 +- completions/apt-get | 2 +- completions/aptitude | 2 +- completions/cvs | 4 ++-- completions/fbgs | 2 +- completions/fbi | 4 ++-- completions/feh | 8 ++++---- completions/ipsec | 2 +- completions/portinstall | 4 ++-- completions/removepkg | 2 +- completions/slackpkg | 4 ++-- completions/slapt-get | 8 ++++---- completions/slapt-src | 8 ++++---- completions/strace | 4 ++-- doc/testing.txt | 12 ++++++------ 22 files changed, 54 insertions(+), 54 deletions(-) diff --git a/Makefile.am b/Makefile.am index 78b6effc06e..75acece0f70 100644 --- a/Makefile.am +++ b/Makefile.am @@ -32,6 +32,6 @@ EXTRA_DIST = CHANGES $(pkgdata_DATA) bash_completion.sh.in .dir-locals.el \ install-data-hook: tmpfile=`mktemp $${TMPDIR:-/tmp}/bash_completion.XXXXXX` && \ $(SED) -e 's|-/etc/bash_completion\.d|-$(compatdir)|' \ - $(DESTDIR)$(pkgdatadir)/bash_completion > $$tmpfile && \ - cat $$tmpfile > $(DESTDIR)$(pkgdatadir)/bash_completion && \ + $(DESTDIR)$(pkgdatadir)/bash_completion >$$tmpfile && \ + cat $$tmpfile >$(DESTDIR)$(pkgdatadir)/bash_completion && \ rm $$tmpfile diff --git a/README.md b/README.md index 9a4da251250..06984a10c1c 100644 --- a/README.md +++ b/README.md @@ -316,7 +316,7 @@ A. Probably because the database is being queried every time and this uses a #!/bin/sh rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n' 2>&1 \ - | sort > /var/log/rpmpkgs + | sort >/var/log/rpmpkgs ``` rpm completion will use this flat text file instead of the RPM database, diff --git a/bash_completion b/bash_completion index d532a44fc19..6a2520b9ff8 100644 --- a/bash_completion +++ b/bash_completion @@ -146,7 +146,7 @@ quote_readline() # This function shell-dequotes the argument dequote() { - eval printf %s "$1" 2> /dev/null + eval printf %s "$1" 2>/dev/null } @@ -192,7 +192,7 @@ _upvars() # Error checking [[ ${1#-a} ]] || { echo "bash: ${FUNCNAME[0]}: \`$1': missing"\ "number specifier" 1>&2; return 1; } - printf %d "${1#-a}" &> /dev/null || { echo "bash:"\ + printf %d "${1#-a}" &>/dev/null || { echo "bash:"\ "${FUNCNAME[0]}: \`$1': invalid number specifier" 1>&2 return 1; } # Assign array of -aN elements @@ -1288,7 +1288,7 @@ _shells() local shell rest while read -r shell rest; do [[ $shell == /* && $shell == "$cur"* ]] && COMPREPLY+=( $shell ) - done 2>/dev/null < /etc/shells + done 2>/dev/null 0) if not. _realcommand() { - type -P "$1" > /dev/null && { - if type -p realpath > /dev/null; then + type -P "$1" >/dev/null && { + if type -p realpath >/dev/null; then realpath "$(type -P "$1")" - elif type -p greadlink > /dev/null; then + elif type -p greadlink >/dev/null; then greadlink -f "$(type -P "$1")" - elif type -p readlink > /dev/null; then + elif type -p readlink >/dev/null; then readlink -f "$(type -P "$1")" else type -P "$1" @@ -1592,7 +1592,7 @@ _known_hosts_real() COMPREPLY+=( $host ) done IFS=$OIFS - done < "$i" + done <"$i" done COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") ) fi diff --git a/completions/7z b/completions/7z index 4a82e5f7a5d..e977c85dccb 100644 --- a/completions/7z +++ b/completions/7z @@ -33,7 +33,7 @@ _7z() x=$(compgen -P"${opt}${cur%%@*}@" -f -- "${cur#*@}") && while read -r tmp; do COMPREPLY+=( "$tmp" ) - done <<< "$x" + done <<<"$x" compopt -o filenames fi return @@ -51,7 +51,7 @@ _7z() x=$(compgen -P${cur:0:2} -S/ -d -- "${cur:2}") && while read -r tmp; do COMPREPLY+=( "$tmp" ) - done <<< "$x" + done <<<"$x" compopt -o nospace -o filenames return ;; diff --git a/completions/_umount.linux b/completions/_umount.linux index fa34d187206..848550eeed9 100644 --- a/completions/_umount.linux +++ b/completions/_umount.linux @@ -72,8 +72,8 @@ _linux_fstab() if [[ $cur && $cur != /* ]]; then local realcur [[ $cur == */ ]] && # don't let readlink drop last / from path - realcur="$(readlink -f "$cur." 2> /dev/null)/" || - realcur=$(readlink -f "$cur" 2> /dev/null) + realcur="$(readlink -f "$cur." 2>/dev/null)/" || + realcur=$(readlink -f "$cur" 2>/dev/null) if [[ $realcur ]]; then local dirrealcur= dircur= basecur if [[ $cur == */* ]]; then @@ -84,7 +84,7 @@ _linux_fstab() local i n=${#COMPREPLY[@]} for (( i=0; i < $n; i++ )); do [[ "${COMPREPLY[i]}" == "$realcur"* ]] && - COMPREPLY+=( $(cd "$dircur" 2> /dev/null && + COMPREPLY+=( $(cd "$dircur" 2>/dev/null && compgen -f -d -P "$dircur" \ -X "!${COMPREPLY[i]##"$dirrealcur"}" -- "$basecur") ) done @@ -132,7 +132,7 @@ _umount() if [[ -r /proc/mounts ]]; then # Linux /proc/mounts is properly quoted. This is important when # unmounting usb devices with pretty names. - _linux_fstab < /proc/mounts + _linux_fstab ' line; do @@ -22,7 +22,7 @@ _ant_parse_targets() _ant_parse_targets $imported_buildfile fi fi - done < $1 + done <$1 } _ant() diff --git a/completions/apt-build b/completions/apt-build index 4aab430f498..b6cf8eff0fd 100644 --- a/completions/apt-build +++ b/completions/apt-build @@ -15,7 +15,7 @@ _apt_build() if [[ -n $special ]]; then case $special in install|source|info) - COMPREPLY=( $(apt-cache pkgnames "$cur" 2> /dev/null) ) + COMPREPLY=( $(apt-cache pkgnames "$cur" 2>/dev/null) ) ;; remove) COMPREPLY=( \ diff --git a/completions/apt-cache b/completions/apt-cache index e73ac4ecd67..1c091c561e1 100644 --- a/completions/apt-cache +++ b/completions/apt-cache @@ -2,7 +2,7 @@ # List APT binary packages _apt_cache_packages() { - apt-cache --no-generate pkgnames "$cur" 2> /dev/null + apt-cache --no-generate pkgnames "$cur" 2>/dev/null } # List APT source packages diff --git a/completions/apt-get b/completions/apt-get index 23b59a5e718..33a60e0291c 100644 --- a/completions/apt-get +++ b/completions/apt-get @@ -26,7 +26,7 @@ _apt_get() ;; source) COMPREPLY=( $(apt-cache --no-generate pkgnames "$cur" \ - 2> /dev/null) $(apt-cache dumpavail | \ + 2>/dev/null) $(apt-cache dumpavail | \ command grep "^Source: $cur" | sort -u | cut -f2 -d" ") ) ;; install) diff --git a/completions/aptitude b/completions/aptitude index 0707d5e4700..3f4e55007d2 100644 --- a/completions/aptitude +++ b/completions/aptitude @@ -66,7 +66,7 @@ _aptitude() --target-release|--default-release|-!(-*)t) COMPREPLY=( $(apt-cache policy | \ command grep "release.o=Debian,a=$cur" | \ - command sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null) ) + command sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2>/dev/null) ) return ;; esac diff --git a/completions/cvs b/completions/cvs index 7a052c8474a..be3b3b06df1 100644 --- a/completions/cvs +++ b/completions/cvs @@ -40,7 +40,7 @@ _cvs_roots() local -a cvsroots cvsroots=( $CVSROOT ) [[ -r ~/.cvspass ]] && cvsroots+=( $(awk '{ print $2 }' ~/.cvspass) ) - [[ -r CVS/Root ]] && mapfile -tO ${#cvsroots[@]} cvsroots < CVS/Root + [[ -r CVS/Root ]] && mapfile -tO ${#cvsroots[@]} cvsroots /dev/null | \ + COMPREPLY=( $(cvs -d "$cvsroot" co -c 2>/dev/null | \ awk '{print $1}') ) COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") ) else diff --git a/completions/fbgs b/completions/fbgs index ebaf670c6bb..7a3ad7be147 100644 --- a/completions/fbgs +++ b/completions/fbgs @@ -14,7 +14,7 @@ _fbgs() -m|--mode) COMPREPLY=( $(compgen -W '$(command sed \ -n "/^mode/{s/^mode \{1,\}\"\([^\"]\{1,\}\)\"/\1/g;p}" \ - /etc/fb.modes 2> /dev/null)' -- "$cur") ) + /etc/fb.modes 2>/dev/null)' -- "$cur") ) return ;; -d|--device) diff --git a/completions/fbi b/completions/fbi index 89c2ce124f3..ac92e60f566 100644 --- a/completions/fbi +++ b/completions/fbi @@ -16,13 +16,13 @@ _fbi() ;; -f|--font) local IFS=$'\n' - COMPREPLY=( $(compgen -W '$(fc-list 2> /dev/null)' -- "$cur") ) + COMPREPLY=( $(compgen -W '$(fc-list 2>/dev/null)' -- "$cur") ) return ;; -m|--mode) COMPREPLY=( $(compgen -W '$(command sed \ -n "/^mode/{s/^mode \{1,\}\"\([^\"]\{1,\}\)\"/\1/g;p}" \ - /etc/fb.modes 2> /dev/null)' -- "$cur") ) + /etc/fb.modes 2>/dev/null)' -- "$cur") ) return ;; -d|--device) diff --git a/completions/feh b/completions/feh index a4400ec8138..71e59798732 100644 --- a/completions/feh +++ b/completions/feh @@ -26,13 +26,13 @@ _feh() return fi local font_path - # font_path="$(imlib2-config --prefix 2> /dev/null)/share/imlib2/data/fonts" - # COMPREPLY=( $(cd "$font_path" 2> /dev/null; compgen -f \ + # font_path="$(imlib2-config --prefix 2>/dev/null)/share/imlib2/data/fonts" + # COMPREPLY=( $(cd "$font_path" 2>/dev/null; compgen -f \ # -X "!*.@([tT][tT][fF])" -S / -- "$cur") ) for (( i=${#words[@]}-1; i>0; i-- )); do if [[ ${words[i]} == -@(C|-fontpath) ]]; then font_path="${words[i+1]}" - COMPREPLY+=( $(cd "$font_path" 2> /dev/null; compgen -f \ + COMPREPLY+=( $(cd "$font_path" 2>/dev/null; compgen -f \ -X "!*.@([tT][tT][fF])" -S / -- "$cur") ) fi done @@ -48,7 +48,7 @@ _feh() continue fi COMPREPLY+=( $(compgen -W "$theme_name" -- "$cur") ) - done < "$conf_path" + done <"$conf_path" return ;; --sort|-!(-*)S) diff --git a/completions/ipsec b/completions/ipsec index 3e00b7e0210..00e6b7ea6bc 100644 --- a/completions/ipsec +++ b/completions/ipsec @@ -67,7 +67,7 @@ _ipsec_strongswan() case ${words[1]} in down|route|status|statusall|unroute|up) local confdir=$(ipsec --confdir) - _ipsec_connections < "$confdir/ipsec.conf" + _ipsec_connections <"$confdir/ipsec.conf" ;; list*) COMPREPLY=( $(compgen -W '--utc' -- "$cur") ) diff --git a/completions/portinstall b/completions/portinstall index fd1aa227a73..8a70b136f16 100644 --- a/completions/portinstall +++ b/completions/portinstall @@ -18,10 +18,10 @@ _portinstall() [[ "$prev" == -l || "$prev" == -L || "$prev" == -o ]] && return - COMPREPLY=( $(command grep -E "^$cur" 2>/dev/null < $indexfile | \ + COMPREPLY=( $(command grep -E "^$cur" 2>/dev/null <$indexfile | \ cut -d'|' -f1) ) COMPREPLY2=( $(command grep -E "^[^\|]+\|$portsdir$cur" 2>/dev/null \ - < $indexfile | cut -d'|' -f2) ) + <$indexfile | cut -d'|' -f2) ) COMPREPLY2=( ${COMPREPLY2[@]#$portsdir} ) COMPREPLY+=( "${COMPREPLY2[@]}" ) diff --git a/completions/removepkg b/completions/removepkg index 035efecb2e8..77f414f6943 100644 --- a/completions/removepkg +++ b/completions/removepkg @@ -15,7 +15,7 @@ _removepkg() fi local root=${ROOT:-/} - COMPREPLY=( $(cd "$root/var/log/packages" 2> /dev/null || return 1; \ + COMPREPLY=( $(cd "$root/var/log/packages" 2>/dev/null || return 1; \ compgen -f -- "$cur") ) } && complete -F _removepkg removepkg diff --git a/completions/slackpkg b/completions/slackpkg index 6fdfd09fe84..a1d500dcfa2 100644 --- a/completions/slackpkg +++ b/completions/slackpkg @@ -78,12 +78,12 @@ _slackpkg() _filedir COMPREPLY+=( $(compgen -W 'a ap d e f k kde kdei l n t tcl x xap xfce y' -- "$cur") ) - COMPREPLY+=( $(cut -f 6 -d\ "${WORKDIR}/pkglist" 2> /dev/null | \ + COMPREPLY+=( $(cut -f 6 -d\ "${WORKDIR}/pkglist" 2>/dev/null | \ command grep "^$cur") ) return ;; info) - COMPREPLY=( $(cut -f 6 -d\ "${WORKDIR}/pkglist" 2> /dev/null | \ + COMPREPLY=( $(cut -f 6 -d\ "${WORKDIR}/pkglist" 2>/dev/null | \ command grep "^$cur") ) return ;; diff --git a/completions/slapt-get b/completions/slapt-get index 22f5eef4cbc..9b249f19002 100644 --- a/completions/slapt-get +++ b/completions/slapt-get @@ -56,13 +56,13 @@ _slapt_get() # slapt-get will fail to search for "^name-version" # it can search for names only local name=${cur%%-*} - COMPREPLY=( $(LC_ALL=C "$1" -c "$config" --search "^$name" 2> \ - /dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}") ) + COMPREPLY=( $(LC_ALL=C "$1" -c "$config" --search "^$name" \ + 2>/dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}") ) return ;; avl) # --install|-i| - COMPREPLY=( $(LC_ALL=C "$1" -c "$config" --available 2> \ - /dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}") ) + COMPREPLY=( $(LC_ALL=C "$1" -c "$config" --available \ + 2>/dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}") ) return ;; ins) # --remove|--filelist diff --git a/completions/slapt-src b/completions/slapt-src index 69b643cc91d..64458babcda 100644 --- a/completions/slapt-src +++ b/completions/slapt-src @@ -54,12 +54,12 @@ _slapt_src() if [[ "$cur" == *:* ]]; then local name=${cur%:*} local version=${cur##*:} - COMPREPLY=( $(LC_ALL=C "$1" --config "$config" --search "^$name" 2> \ - /dev/null | LC_ALL=C command sed -ne \ + COMPREPLY=( $(LC_ALL=C "$1" --config "$config" --search "^$name" \ + 2>/dev/null | LC_ALL=C command sed -ne \ "/^$cur/{s/^$name:\([^ ]*\) .*$/\1/;p}") ) else - COMPREPLY=( $(LC_ALL=C "$1" --config "$config" --search "^$cur" 2> \ - /dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}") ) + COMPREPLY=( $(LC_ALL=C "$1" --config "$config" --search "^$cur" \ + 2>/dev/null | LC_ALL=C command sed -ne "/^$cur/{s/ .*$//;p}") ) fi } && complete -F _slapt_src slapt-src diff --git a/completions/strace b/completions/strace index e96e9528449..3ce2bd15a8e 100644 --- a/completions/strace +++ b/completions/strace @@ -41,7 +41,7 @@ _strace() [[ $define == "#define" && \ $syscall =~ ^__NR_(.+) ]] && \ syscalls[${BASH_REMATCH[1]}]=1 - done 2>/dev/null < /usr/include/asm/unistd.h + done 2>/dev/null /dev/null < $unistd + done 2>/dev/null <$unistd fi COMPREPLY=( $(compgen -W '${!syscalls[@]} file diff --git a/doc/testing.txt b/doc/testing.txt index f16dd21efca..62650e3b85b 100644 --- a/doc/testing.txt +++ b/doc/testing.txt @@ -167,9 +167,9 @@ ctrl-alt-Fx to switch the console from /dev/tty1 to tty7. There are many more /dev/tty* which are not accessed via function keys. To be safe, use a tty greater than tty7) ----------------------- -./runUnit < /dev/tty40 ----------------------- +--------------------- +./runUnit $LOG || cat $LOG -./runCompletion --outdir log/bash-4 --tool_exec /opt/bash-4.3/bin/bash > $LOG || cat $LOG +./runUnit --outdir log/bash-4 --tool_exec /opt/bash-4.3/bin/bash >$LOG || cat $LOG +./runCompletion --outdir log/bash-4 --tool_exec /opt/bash-4.3/bin/bash >$LOG || cat $LOG # Clean up log file [ -f $LOG ] && rm $LOG From 0fddd5512587cf717a9eb39ba422a80f8f7000e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 14 Apr 2019 19:20:54 +0300 Subject: [PATCH 0078/1094] msynctool: code cleanups --- completions/msynctool | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/completions/msynctool b/completions/msynctool index c3600ce7513..4fd51618593 100644 --- a/completions/msynctool +++ b/completions/msynctool @@ -14,7 +14,7 @@ _msynctool() ;; --addmember) COMPREPLY=( $(compgen -W '$($1 --listplugins \ - | command sed -e '1d')' -- "$cur") ) + | command sed -e 1d)' -- "$cur") ) return ;; esac @@ -22,12 +22,12 @@ _msynctool() case $prev in --configure|--addgroup|--delgroup|--showgroup|--sync|--addmember) COMPREPLY=( $(compgen -W '$($1 --listgroups \ - | command sed -e '1d')' -- "$cur") ) + | command sed -e 1d)' -- "$cur") ) return ;; --showformats|--filter-objtype|--slow-sync) COMPREPLY=( $(compgen -W '$($1 --listobjects \ - | command sed -e '1d')' -- "$cur") ) + | command sed -e 1d)' -- "$cur") ) return ;; esac From 2a932367917a9d7349bf049257e10840caa9c4da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 14 Apr 2019 19:22:17 +0300 Subject: [PATCH 0079/1094] *: spelling fixes --- CHANGES | 2 +- completions/tar | 2 +- test/t/conftest.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 8a45281c4a5..cfd88c5589c 100644 --- a/CHANGES +++ b/CHANGES @@ -71,7 +71,7 @@ bash-completion (2.8) * mkdir: Complete files without appending space * __load_completion: Load "xspec" completions dynamically too * __load_completion: Code cleanup - * _avaiable_interfaces: Get rid of eval + * _available_interfaces: Get rid of eval * make: Pass script to sed as parameter instead of using process substitution * ccze: New completion diff --git a/completions/tar b/completions/tar index 3e161732b43..a70887d926b 100644 --- a/completions/tar +++ b/completions/tar @@ -426,7 +426,7 @@ __tar_try_list_archive() __tar_cleanup_prev() { if [[ "$prev" =~ ^-[a-zA-Z0-9?]*$ ]]; then - # transformate '-caf' ~> '-f' + # transform '-caf' ~> '-f' prev="-$(__tar_last_char "$prev")" fi } diff --git a/test/t/conftest.py b/test/t/conftest.py index 18c1badca5c..7781fd1e6d8 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -274,7 +274,7 @@ class CompletionResult: def __init__(self, output: str, items: Optional[Iterable[str]] = None): """ - When items are specified, they are used as the base for comparisions + When items are specified, they are used as the base for comparisons provided by this class. When not, regular expressions are used instead. This is because it is not always possible to unambiguously split a completion output string into individual items, for example when the From 63257ba4f8466fad3e4e219259554a0e8627def8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 14 Apr 2019 21:47:39 +0300 Subject: [PATCH 0080/1094] svn, svk, wget: use _iconv_charsets --- completions/_svn | 3 +-- completions/svk | 3 +-- completions/wget | 5 +---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/completions/_svn b/completions/_svn index 71062baa843..ca1a61744e7 100644 --- a/completions/_svn +++ b/completions/_svn @@ -34,8 +34,7 @@ _svn() return ;; --encoding) - COMPREPLY=( $(compgen -W '$(iconv --list | \ - command sed -e "s@//@@;")' -- "$cur") ) + _xfunc iconv _iconv_charsets return ;; --editor-cmd|--diff-cmd|--diff3-cmd) diff --git a/completions/svk b/completions/svk index 0c24fbdf8dd..b122ab7865f 100644 --- a/completions/svk +++ b/completions/svk @@ -27,8 +27,7 @@ _svk() return ;; --encoding) - COMPREPLY=( $(compgen -W \ - '$(iconv --list | command sed -e "s@//@@;")' -- "$cur") ) + _xfunc iconv _iconv_charsets return ;; esac diff --git a/completions/wget b/completions/wget index 7994a4a10bc..b27d860dbf7 100644 --- a/completions/wget +++ b/completions/wget @@ -135,10 +135,7 @@ _wget() return ;; --local-encoding|--remote-encoding) - type -P xauth &>/dev/null && \ - COMPREPLY=( $(compgen -W '$(iconv -l 2>/dev/null | \ - command sed -e "s@/*\$@@" -e "s/[,()]//g" 2>/dev/null)' \ - -- "$cur" ) ) + type -P xauth &>/dev/null && _xfunc iconv _iconv_charsets return ;; --execute|-!(-*)e) From 3c10d4d88015e096a0ee840d6a008508607cb81b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 14 Apr 2019 21:48:22 +0300 Subject: [PATCH 0081/1094] *: make _parse_usage fallbacks more concise --- completions/_dmesg | 3 +-- completions/_hexdump | 3 +-- completions/chmod | 3 +-- completions/grpck | 3 +-- completions/ifstat | 3 +-- completions/make | 3 +-- completions/modinfo | 3 +-- completions/passwd | 3 +-- completions/quota | 3 +-- completions/sudo | 3 +-- completions/sysctl | 3 +-- 11 files changed, 11 insertions(+), 22 deletions(-) diff --git a/completions/_dmesg b/completions/_dmesg index 9740932717a..1dff7db2086 100644 --- a/completions/_dmesg +++ b/completions/_dmesg @@ -26,8 +26,7 @@ _dmesg() esac local opts=$(_parse_help "$1") - [[ $opts ]] || opts=$(_parse_usage "$1") - COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) } && complete -F _dmesg dmesg diff --git a/completions/_hexdump b/completions/_hexdump index bfd0a62a059..a3c2a839c60 100644 --- a/completions/_hexdump +++ b/completions/_hexdump @@ -20,8 +20,7 @@ _hexdump() if [[ $cur == -* ]]; then local opts="$(_parse_help "$1")" - [[ $opts ]] || opts="$(_parse_usage "$1")" - COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) return fi diff --git a/completions/chmod b/completions/chmod index 89cb397e0dd..849da8511e1 100644 --- a/completions/chmod +++ b/completions/chmod @@ -22,8 +22,7 @@ _chmod() if [[ $cur == -* && $cur != $modearg ]]; then local opts=$(_parse_help "$1") - [[ $opts ]] || opts=$(_parse_usage "$1") - COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/grpck b/completions/grpck index 3b0d1964cb0..9f5eac7b80b 100644 --- a/completions/grpck +++ b/completions/grpck @@ -14,8 +14,7 @@ _grpck() if [[ "$cur" == -* ]]; then local opts=$(_parse_help "$1") - [[ $opts ]] || opts=$(_parse_usage "$1") - COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) return fi diff --git a/completions/ifstat b/completions/ifstat index 2be902e59f3..bfe3a3ef830 100644 --- a/completions/ifstat +++ b/completions/ifstat @@ -52,8 +52,7 @@ _ifstat() if [[ "$cur" == -* ]]; then local opts=$(_parse_help "$1") - [[ $opts ]] || opts=$(_parse_usage "$1") - COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/make b/completions/make index d644df6c138..2c99c037a3d 100644 --- a/completions/make +++ b/completions/make @@ -115,8 +115,7 @@ _make() if [[ "$cur" == -* ]]; then local opts="$(_parse_help "$1")" - [[ $opts ]] || opts="$(_parse_usage "$1")" - COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace elif [[ $cur == *=* ]]; then prev=${cur%%=*} diff --git a/completions/modinfo b/completions/modinfo index 6aa5e662d4e..c151fad4ab9 100644 --- a/completions/modinfo +++ b/completions/modinfo @@ -22,8 +22,7 @@ _modinfo() if [[ "$cur" == -* ]]; then local opts=$(_parse_help "$1") - [[ $opts ]] || opts=$(_parse_usage "$1") - COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/passwd b/completions/passwd index 1734a326571..5a1e5629713 100644 --- a/completions/passwd +++ b/completions/passwd @@ -13,8 +13,7 @@ _passwd() if [[ "$cur" == -* ]]; then local opts=$(_parse_help "$1") - [[ $opts ]] || opts=$(_parse_usage "$1") - COMPREPLY=( $(compgen -W '$opts' -- "$cur") ) + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) return fi diff --git a/completions/quota b/completions/quota index 01e14509b12..bf7319bc0bf 100644 --- a/completions/quota +++ b/completions/quota @@ -19,8 +19,7 @@ _user_or_group() _quota_parse_help() { local opts=$(_parse_help "$1") - [[ $opts ]] || opts=$(_parse_usage "$1") # non-GNU? - COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace } diff --git a/completions/sudo b/completions/sudo index 994ec78b4c1..1b8e508fe00 100644 --- a/completions/sudo +++ b/completions/sudo @@ -43,8 +43,7 @@ _sudo() if [[ "$cur" == -* ]]; then local opts=$(_parse_help "$1") - [[ $opts ]] || opts=$(_parse_usage "$1") - COMPREPLY=( $(compgen -W '$opts' -- "$cur") ) + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/sysctl b/completions/sysctl index dfd971d52d2..8f00b26be07 100644 --- a/completions/sysctl +++ b/completions/sysctl @@ -17,8 +17,7 @@ _sysctl() if [[ $cur == -* ]]; then local opts="$(_parse_help "$1")" - [[ $opts ]] || opts="$(_parse_usage "$1")" - COMPREPLY=( $(compgen -W "$opts" -- "$cur") ) + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) else local suffix= [[ $prev == -w ]] && suffix== From 662cb7267515ee6b26de9bea833a570a2df80be2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 14 Apr 2019 22:28:31 +0300 Subject: [PATCH 0082/1094] valgrind: look up tools from libexec dirs too Current Fedora development has them in /usr/libexec/valgrind. --- completions/valgrind | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/valgrind b/completions/valgrind index 6aef409b9e7..6f7f66e8ba6 100644 --- a/completions/valgrind +++ b/completions/valgrind @@ -32,7 +32,7 @@ _valgrind() # Tools seem to be named e.g. like memcheck-amd64-linux from which # we want to grab memcheck. COMPREPLY=( $(compgen -W '$( - for f in /usr{,/local}/lib{,64}/valgrind/*; do + for f in /usr{,/local}/lib{,64,exec}/valgrind/*; do [[ $f != *.so && -x $f ]] && command sed -ne "s/^.*\/\(.*\)-\([^-]*\)-\([^-]*\)/\1/p" <<<$f done)' -- "$cur") ) From 77f2855e10f08e9789908d7a91d42c407b67ea32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 20 Apr 2019 09:44:26 +0300 Subject: [PATCH 0083/1094] .dir-locals.el: use flycheck-sh-bash-args Requires flycheck > 31, but this approach doesn't break checking when shellcheck is installed. --- .dir-locals.el | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.dir-locals.el b/.dir-locals.el index c46f181a119..2e969fa8f45 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -1,10 +1,6 @@ -;; bash-completion shell-script mode additional settings for Emacs +;;; Directory Local Variables +;;; For more information see (info "(emacs) Directory Variables") -((sh-mode . ((sh-indent-comment . t) - ;; Somewhat fragile, waiting for flycheck-sh-bash-args - (eval . (setq flycheck-command-wrapper-function - (lambda (command) - (append (butlast command 1) - '("-O" "extglob") - (last command))))) - ))) +((sh-mode + (flycheck-sh-bash-args "-O" "extglob") + (sh-indent-comment . t))) From 2c1a53114896d2f7b8bff075fd16fb811f17b311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 20 Apr 2019 11:03:04 +0300 Subject: [PATCH 0084/1094] *: format Python code with black --- .dir-locals.el | 4 +- Makefile.am | 2 +- helpers/python | 2 +- pyproject.toml | 3 + test/docker/docker-script.sh | 3 + test/generate | 1 - test/requirements.txt | 1 + test/t/conftest.py | 201 +++++++++++------- test/t/test_2to3.py | 1 - test/t/test_7z.py | 1 - test/t/test_a2ps.py | 1 - test/t/test_a2x.py | 1 - test/t/test_abook.py | 1 - test/t/test_aclocal.py | 1 - test/t/test_acpi.py | 1 - test/t/test_acroread.py | 1 - test/t/test_adb.py | 1 - test/t/test_add_members.py | 1 - test/t/test_alias.py | 11 +- test/t/test_alpine.py | 1 - test/t/test_animate.py | 1 - test/t/test_ant.py | 6 +- test/t/test_apache2ctl.py | 1 - test/t/test_appdata_validate.py | 5 +- test/t/test_apt_build.py | 5 +- test/t/test_apt_cache.py | 5 +- test/t/test_apt_get.py | 5 +- test/t/test_aptitude.py | 1 - test/t/test_arch.py | 7 +- test/t/test_arp.py | 1 - test/t/test_arping.py | 1 - test/t/test_arpspoof.py | 1 - test/t/test_asciidoc.py | 1 - test/t/test_aspell.py | 1 - test/t/test_autoconf.py | 1 - test/t/test_autoheader.py | 1 - test/t/test_automake.py | 1 - test/t/test_autoreconf.py | 1 - test/t/test_autorpm.py | 1 - test/t/test_autoscan.py | 1 - test/t/test_autoupdate.py | 1 - test/t/test_avctrl.py | 1 - test/t/test_awk.py | 1 - test/t/test_badblocks.py | 1 - test/t/test_base64.py | 1 - test/t/test_bash.py | 1 - test/t/test_bc.py | 1 - test/t/test_bind.py | 1 - test/t/test_bison.py | 1 - test/t/test_bk.py | 1 - test/t/test_brctl.py | 1 - test/t/test_btdownloadcurses_py.py | 5 +- test/t/test_btdownloadgui_py.py | 5 +- test/t/test_btdownloadheadless_py.py | 5 +- test/t/test_bts.py | 1 - test/t/test_bzip2.py | 1 - test/t/test_cal.py | 1 - test/t/test_cancel.py | 22 +- test/t/test_cardctl.py | 1 - test/t/test_cat.py | 1 - test/t/test_cc.py | 1 - test/t/test_ccache.py | 1 - test/t/test_ccze.py | 1 - test/t/test_cd.py | 7 +- test/t/test_cdrecord.py | 1 - test/t/test_cfagent.py | 1 - test/t/test_cfrun.py | 1 - test/t/test_chage.py | 1 - test/t/test_change_pw.py | 7 +- test/t/test_check_db.py | 1 - test/t/test_check_perms.py | 1 - test/t/test_checksec.py | 1 - test/t/test_chfn.py | 1 - test/t/test_chgrp.py | 1 - test/t/test_chkconfig.py | 6 +- test/t/test_chown.py | 33 +-- test/t/test_chpasswd.py | 1 - test/t/test_chromium_browser.py | 5 +- test/t/test_chronyc.py | 1 - test/t/test_chroot.py | 1 - test/t/test_chrpath.py | 1 - test/t/test_chsh.py | 1 - test/t/test_ci.py | 1 - test/t/test_ciptool.py | 1 - test/t/test_civclient.py | 1 - test/t/test_civserver.py | 1 - test/t/test_cksfv.py | 1 - test/t/test_cleanarch.py | 7 +- test/t/test_clisp.py | 1 - test/t/test_clone_member.py | 1 - test/t/test_co.py | 1 - test/t/test_compare.py | 1 - test/t/test_complete.py | 1 - test/t/test_composite.py | 1 - test/t/test_config_list.py | 1 - test/t/test_configure.py | 3 +- test/t/test_conjure.py | 1 - test/t/test_convert.py | 1 - test/t/test_cowsay.py | 1 - test/t/test_cp.py | 1 - test/t/test_cpan2dist.py | 1 - test/t/test_cpio.py | 6 +- test/t/test_cplusplus.py | 1 - test/t/test_cppcheck.py | 1 - test/t/test_createdb.py | 3 +- test/t/test_createuser.py | 5 +- test/t/test_crontab.py | 1 - test/t/test_cryptsetup.py | 1 - test/t/test_csplit.py | 1 - test/t/test_curl.py | 1 - test/t/test_cut.py | 1 - test/t/test_cvs.py | 7 +- test/t/test_cvsps.py | 7 +- test/t/test_date.py | 1 - test/t/test_dcop.py | 1 - test/t/test_dd.py | 1 - test/t/test_declare.py | 1 - test/t/test_deja_dup.py | 5 +- test/t/test_desktop_file_validate.py | 5 +- test/t/test_df.py | 1 - test/t/test_dfutool.py | 1 - test/t/test_dhclient.py | 1 - test/t/test_dict.py | 1 - test/t/test_diff.py | 1 - test/t/test_dir.py | 1 - test/t/test_display.py | 1 - test/t/test_dmesg.py | 1 - test/t/test_dnssec_keygen.py | 46 ++-- test/t/test_dnsspoof.py | 1 - test/t/test_dot.py | 1 - test/t/test_dpkg.py | 6 +- test/t/test_dpkg_deb.py | 5 +- test/t/test_dpkg_reconfigure.py | 5 +- test/t/test_dpkg_source.py | 5 +- test/t/test_dropdb.py | 3 +- test/t/test_dropuser.py | 1 - test/t/test_dselect.py | 1 - test/t/test_dsniff.py | 1 - test/t/test_du.py | 1 - test/t/test_dumpdb.py | 7 +- test/t/test_dumpe2fs.py | 1 - test/t/test_e2freefrag.py | 1 - test/t/test_e2label.py | 1 - test/t/test_ebtables.py | 1 - test/t/test_ecryptfs_migrate_home.py | 5 +- test/t/test_eject.py | 1 - test/t/test_enscript.py | 1 - test/t/test_env.py | 4 +- test/t/test_eog.py | 1 - test/t/test_ether_wake.py | 5 +- test/t/test_etherwake.py | 1 - test/t/test_evince.py | 4 +- test/t/test_expand.py | 4 +- test/t/test_explodepkg.py | 9 +- test/t/test_export.py | 1 - test/t/test_faillog.py | 1 - test/t/test_fbgs.py | 1 - test/t/test_fbi.py | 1 - test/t/test_feh.py | 6 +- test/t/test_file.py | 1 - test/t/test_file_roller.py | 5 +- test/t/test_filefrag.py | 1 - test/t/test_filesnarf.py | 1 - test/t/test_find.py | 1 - test/t/test_find_member.py | 1 - test/t/test_finger.py | 8 +- test/t/test_fio.py | 1 - test/t/test_firefox.py | 1 - test/t/test_flake8.py | 5 +- test/t/test_fmt.py | 4 +- test/t/test_fold.py | 4 +- test/t/test_freebsd_update.py | 5 +- test/t/test_freeciv.py | 1 - test/t/test_freeciv_server.py | 5 +- test/t/test_function.py | 1 - test/t/test_fusermount.py | 1 - test/t/test_g4.py | 1 - test/t/test_g77.py | 1 - test/t/test_gcc.py | 1 - test/t/test_gcj.py | 1 - test/t/test_gcl.py | 1 - test/t/test_gdb.py | 1 - test/t/test_genaliases.py | 7 +- test/t/test_gendiff.py | 1 - test/t/test_genisoimage.py | 1 - test/t/test_geoiplookup.py | 1 - test/t/test_getconf.py | 1 - test/t/test_getent.py | 1 - test/t/test_gkrellm.py | 1 - test/t/test_gm.py | 1 - test/t/test_gmplayer.py | 1 - test/t/test_gnatmake.py | 1 - test/t/test_gnokii.py | 1 - test/t/test_gnome_mplayer.py | 5 +- test/t/test_gnome_screenshot.py | 5 +- test/t/test_gpasswd.py | 1 - test/t/test_gpc.py | 1 - test/t/test_gperf.py | 1 - test/t/test_gpg.py | 1 - test/t/test_gpg2.py | 1 - test/t/test_gpgv.py | 1 - test/t/test_gphoto2.py | 1 - test/t/test_gplusplus.py | 1 - test/t/test_gprof.py | 4 +- test/t/test_grep.py | 1 - test/t/test_groupadd.py | 1 - test/t/test_groupdel.py | 1 - test/t/test_groupmems.py | 1 - test/t/test_groupmod.py | 1 - test/t/test_growisofs.py | 1 - test/t/test_grpck.py | 1 - test/t/test_grub.py | 1 - test/t/test_gzip.py | 1 - test/t/test_hciattach.py | 1 - test/t/test_hciconfig.py | 1 - test/t/test_hcitool.py | 1 - test/t/test_hddtemp.py | 1 - test/t/test_head.py | 4 +- test/t/test_hexdump.py | 1 - test/t/test_hid2hci.py | 7 +- test/t/test_host.py | 1 - test/t/test_hostname.py | 1 - test/t/test_hping2.py | 1 - test/t/test_hping3.py | 1 - test/t/test_htop.py | 1 - test/t/test_htpasswd.py | 1 - test/t/test_hunspell.py | 1 - test/t/test_hwclock.py | 1 - test/t/test_iconv.py | 1 - test/t/test_id.py | 1 - test/t/test_identify.py | 1 - test/t/test_idn.py | 1 - test/t/test_ifdown.py | 1 - test/t/test_ifstat.py | 11 +- test/t/test_iftop.py | 1 - test/t/test_ifup.py | 1 - test/t/test_import.py | 1 - test/t/test_info.py | 7 +- test/t/test_inject.py | 7 +- test/t/test_inotifywait.py | 1 - test/t/test_inotifywatch.py | 1 - test/t/test_insmod.py | 1 - test/t/test_installpkg.py | 25 ++- test/t/test_interdiff.py | 1 - test/t/test_invoke_rc_d.py | 5 +- test/t/test_ionice.py | 1 - test/t/test_ip.py | 1 - test/t/test_iperf.py | 1 - test/t/test_iperf3.py | 1 - test/t/test_ipmitool.py | 1 - test/t/test_ipsec.py | 1 - test/t/test_iptables.py | 1 - test/t/test_ipv6calc.py | 1 - test/t/test_irb.py | 1 - test/t/test_iscsiadm.py | 1 - test/t/test_isort.py | 1 - test/t/test_isql.py | 7 +- test/t/test_iwconfig.py | 1 - test/t/test_iwlist.py | 1 - test/t/test_iwpriv.py | 1 - test/t/test_iwspy.py | 1 - test/t/test_jar.py | 1 - test/t/test_jarsigner.py | 1 - test/t/test_java.py | 5 +- test/t/test_javac.py | 1 - test/t/test_javadoc.py | 4 +- test/t/test_javaws.py | 1 - test/t/test_jpegoptim.py | 1 - test/t/test_jps.py | 1 - test/t/test_jq.py | 9 +- test/t/test_jshint.py | 1 - test/t/test_json_xs.py | 1 - test/t/test_jsonschema.py | 1 - test/t/test_k3b.py | 1 - test/t/test_kcov.py | 1 - test/t/test_kdvi.py | 5 +- test/t/test_kill.py | 1 - test/t/test_kldload.py | 1 - test/t/test_kldunload.py | 4 +- test/t/test_koji.py | 1 - test/t/test_kpdf.py | 1 - test/t/test_kplayer.py | 1 - test/t/test_ktutil.py | 1 - test/t/test_l2ping.py | 1 - test/t/test_larch.py | 1 - test/t/test_lastlog.py | 1 - test/t/test_ld.py | 1 - test/t/test_ldapadd.py | 1 - test/t/test_ldapcompare.py | 1 - test/t/test_ldapdelete.py | 1 - test/t/test_ldapmodrdn.py | 1 - test/t/test_ldappasswd.py | 1 - test/t/test_ldapsearch.py | 1 - test/t/test_ldapvi.py | 1 - test/t/test_ldapwhoami.py | 1 - test/t/test_ldd.py | 1 - test/t/test_less.py | 1 - test/t/test_lftp.py | 10 +- test/t/test_lftpget.py | 1 - test/t/test_lilo.py | 1 - test/t/test_links.py | 1 - test/t/test_lintian.py | 1 - test/t/test_lintian_info.py | 5 +- test/t/test_lisp.py | 1 - test/t/test_list_admins.py | 1 - test/t/test_list_lists.py | 1 - test/t/test_list_members.py | 1 - test/t/test_list_owners.py | 7 +- test/t/test_ln.py | 1 - test/t/test_locale_gen.py | 5 +- test/t/test_look.py | 4 +- test/t/test_lpq.py | 1 - test/t/test_lpr.py | 1 - test/t/test_lrzip.py | 1 - test/t/test_ls.py | 19 +- test/t/test_lsof.py | 1 - test/t/test_lspci.py | 1 - test/t/test_lsscsi.py | 1 - test/t/test_lsusb.py | 1 - test/t/test_lua.py | 1 - test/t/test_luac.py | 1 - test/t/test_luseradd.py | 1 - test/t/test_luserdel.py | 1 - test/t/test_lusermod.py | 1 - test/t/test_lvchange.py | 6 +- test/t/test_lvcreate.py | 6 +- test/t/test_lvdisplay.py | 6 +- test/t/test_lvextend.py | 6 +- test/t/test_lvm.py | 1 - test/t/test_lvmdiskscan.py | 6 +- test/t/test_lvreduce.py | 6 +- test/t/test_lvremove.py | 6 +- test/t/test_lvrename.py | 6 +- test/t/test_lvresize.py | 6 +- test/t/test_lvs.py | 4 +- test/t/test_lvscan.py | 4 +- test/t/test_lz4.py | 1 - test/t/test_lzip.py | 1 - test/t/test_lzma.py | 1 - test/t/test_lzop.py | 1 - test/t/test_m4.py | 4 +- test/t/test_macof.py | 1 - test/t/test_mailmanctl.py | 7 +- test/t/test_mailsnarf.py | 1 - test/t/test_make.py | 9 +- test/t/test_makepkg.py | 10 +- test/t/test_man.py | 67 +++--- test/t/test_mc.py | 1 - test/t/test_mcrypt.py | 1 - test/t/test_md5sum.py | 1 - test/t/test_mdadm.py | 1 - test/t/test_mdecrypt.py | 1 - test/t/test_mdtool.py | 1 - test/t/test_medusa.py | 1 - test/t/test_mencoder.py | 7 +- test/t/test_mii_diag.py | 5 +- test/t/test_mii_tool.py | 5 +- test/t/test_minicom.py | 1 - test/t/test_mkdir.py | 1 - test/t/test_mkfifo.py | 1 - test/t/test_mkinitrd.py | 1 - test/t/test_mkisofs.py | 1 - test/t/test_mknod.py | 1 - test/t/test_mktemp.py | 1 - test/t/test_mmsitepass.py | 1 - test/t/test_mock.py | 1 - test/t/test_modinfo.py | 16 +- test/t/test_modprobe.py | 16 +- test/t/test_module.py | 1 - test/t/test_mogrify.py | 1 - test/t/test_monodevelop.py | 1 - test/t/test_montage.py | 1 - test/t/test_mount.py | 6 +- test/t/test_mplayer.py | 7 +- test/t/test_mr.py | 11 +- test/t/test_msgsnarf.py | 1 - test/t/test_msynctool.py | 1 - test/t/test_mtx.py | 1 - test/t/test_munin_node_configure.py | 5 +- test/t/test_munin_run.py | 5 +- test/t/test_mussh.py | 1 - test/t/test_mutt.py | 26 +-- test/t/test_muttng.py | 1 - test/t/test_mv.py | 1 - test/t/test_mypy.py | 1 - test/t/test_mysql.py | 1 - test/t/test_mysqladmin.py | 1 - test/t/test_nc.py | 1 - test/t/test_ncftp.py | 1 - test/t/test_nethogs.py | 1 - test/t/test_netstat.py | 1 - test/t/test_newgrp.py | 1 - test/t/test_newlist.py | 1 - test/t/test_newusers.py | 1 - test/t/test_ngrep.py | 1 - test/t/test_nl.py | 1 - test/t/test_nm.py | 1 - test/t/test_nmap.py | 1 - test/t/test_nmcli.py | 1 - test/t/test_nproc.py | 1 - test/t/test_nslookup.py | 1 - test/t/test_nsupdate.py | 1 - test/t/test_ntpdate.py | 1 - test/t/test_objcopy.py | 1 - test/t/test_objdump.py | 1 - test/t/test_od.py | 1 - test/t/test_oggdec.py | 1 - test/t/test_op.py | 1 - test/t/test_openssl.py | 1 - test/t/test_opera.py | 1 - test/t/test_optipng.py | 1 - test/t/test_p4.py | 1 - test/t/test_pack200.py | 1 - test/t/test_passwd.py | 1 - test/t/test_paste.py | 1 - test/t/test_patch.py | 1 - test/t/test_pdftotext.py | 1 - test/t/test_perl.py | 1 - test/t/test_perlcritic.py | 1 - test/t/test_perldoc.py | 7 +- test/t/test_perltidy.py | 1 - test/t/test_phing.py | 1 - test/t/test_pine.py | 1 - test/t/test_pinfo.py | 7 +- test/t/test_ping.py | 1 - test/t/test_pkg_config.py | 5 +- test/t/test_pkg_deinstall.py | 14 +- test/t/test_pkg_delete.py | 1 - test/t/test_pkg_get.py | 5 +- test/t/test_pkg_info.py | 1 - test/t/test_pkgadd.py | 1 - test/t/test_pkgrm.py | 1 - test/t/test_pkgtool.py | 1 - test/t/test_pkgutil.py | 1 - test/t/test_pkill.py | 1 - test/t/test_plague_client.py | 5 +- test/t/test_pm_hibernate.py | 5 +- test/t/test_pm_is_supported.py | 5 +- test/t/test_pm_powersave.py | 5 +- test/t/test_pngfix.py | 1 - test/t/test_portinstall.py | 17 +- test/t/test_portsnap.py | 1 - test/t/test_portupgrade.py | 7 +- test/t/test_postcat.py | 1 - test/t/test_postconf.py | 1 - test/t/test_postfix.py | 1 - test/t/test_postmap.py | 1 - test/t/test_postsuper.py | 1 - test/t/test_povray.py | 1 - test/t/test_pr.py | 1 - test/t/test_prelink.py | 1 - test/t/test_protoc.py | 1 - test/t/test_psql.py | 3 +- test/t/test_ptx.py | 1 - test/t/test_puppet.py | 1 - test/t/test_pushd.py | 1 - test/t/test_pv.py | 1 - test/t/test_pvchange.py | 6 +- test/t/test_pvcreate.py | 6 +- test/t/test_pvdisplay.py | 6 +- test/t/test_pvmove.py | 1 - test/t/test_pvremove.py | 6 +- test/t/test_pvs.py | 4 +- test/t/test_pvscan.py | 1 - test/t/test_pwck.py | 1 - test/t/test_pwd.py | 1 - test/t/test_pwdx.py | 1 - test/t/test_pwgen.py | 1 - test/t/test_pycodestyle.py | 1 - test/t/test_pydoc.py | 1 - test/t/test_pydocstyle.py | 1 - test/t/test_pyflakes.py | 1 - test/t/test_pylint.py | 1 - test/t/test_pylint_3.py | 5 +- test/t/test_pytest.py | 1 - test/t/test_python.py | 1 - test/t/test_python3.py | 1 - test/t/test_pyvenv.py | 1 - test/t/test_qemu.py | 1 - test/t/test_qrunner.py | 1 - test/t/test_querybts.py | 1 - test/t/test_quota.py | 1 - test/t/test_quotacheck.py | 1 - test/t/test_quotaon.py | 1 - test/t/test_radvdump.py | 1 - test/t/test_rcs.py | 1 - test/t/test_rcsdiff.py | 1 - test/t/test_rdesktop.py | 1 - test/t/test_rdict.py | 1 - test/t/test_readelf.py | 1 - test/t/test_readonly.py | 1 - test/t/test_remove_members.py | 1 - test/t/test_removepkg.py | 1 - test/t/test_renice.py | 1 - test/t/test_repomanage.py | 1 - test/t/test_reportbug.py | 1 - test/t/test_reptyr.py | 1 - test/t/test_resolvconf.py | 1 - test/t/test_rfcomm.py | 1 - test/t/test_rfkill.py | 1 - test/t/test_ri.py | 7 +- test/t/test_rlog.py | 1 - test/t/test_rm.py | 1 - test/t/test_rmdir.py | 1 - test/t/test_rmlist.py | 1 - test/t/test_rmmod.py | 1 - test/t/test_route.py | 1 - test/t/test_rpcdebug.py | 1 - test/t/test_rpm.py | 4 +- test/t/test_rpm2tgz.py | 21 +- test/t/test_rpmbuild.py | 1 - test/t/test_rrdtool.py | 1 - test/t/test_rsync.py | 5 +- test/t/test_rtcwake.py | 1 - test/t/test_runuser.py | 1 - test/t/test_sbcl.py | 1 - test/t/test_sbcl_mt.py | 5 +- test/t/test_sbopkg.py | 1 - test/t/test_screen.py | 1 - test/t/test_scrub.py | 8 +- test/t/test_sdptool.py | 1 - test/t/test_sed.py | 4 +- test/t/test_seq.py | 1 - test/t/test_service.py | 1 - test/t/test_set.py | 1 - test/t/test_setquota.py | 1 - test/t/test_sftp.py | 1 - test/t/test_sh.py | 1 - test/t/test_sha1sum.py | 1 - test/t/test_shar.py | 1 - test/t/test_shellcheck.py | 1 - test/t/test_sitecopy.py | 1 - test/t/test_slackpkg.py | 1 - test/t/test_slapt_get.py | 5 +- test/t/test_slapt_src.py | 5 +- test/t/test_smartctl.py | 1 - test/t/test_smbcacls.py | 1 - test/t/test_smbclient.py | 1 - test/t/test_smbcquotas.py | 1 - test/t/test_smbget.py | 1 - test/t/test_smbpasswd.py | 1 - test/t/test_smbtar.py | 1 - test/t/test_smbtree.py | 1 - test/t/test_snownews.py | 1 - test/t/test_sort.py | 1 - test/t/test_split.py | 4 +- test/t/test_spovray.py | 1 - test/t/test_sqlite3.py | 1 - test/t/test_ss.py | 1 - test/t/test_ssh.py | 1 - test/t/test_ssh_add.py | 5 +- test/t/test_ssh_copy_id.py | 1 - test/t/test_ssh_keygen.py | 5 +- test/t/test_sshfs.py | 5 +- test/t/test_sshmitm.py | 1 - test/t/test_sshow.py | 1 - test/t/test_strace.py | 1 - test/t/test_stream.py | 1 - test/t/test_strings.py | 1 - test/t/test_strip.py | 1 - test/t/test_su.py | 1 - test/t/test_sudo.py | 21 +- test/t/test_svcadm.py | 1 - test/t/test_svk.py | 1 - test/t/test_svn.py | 1 - test/t/test_svnadmin.py | 1 - test/t/test_svnlook.py | 1 - test/t/test_sync_members.py | 1 - test/t/test_sysbench.py | 1 - test/t/test_sysctl.py | 8 +- test/t/test_tac.py | 1 - test/t/test_tail.py | 4 +- test/t/test_tar.py | 19 +- test/t/test_tcpdump.py | 1 - test/t/test_tcpkill.py | 1 - test/t/test_tcpnice.py | 1 - test/t/test_tee.py | 1 - test/t/test_texindex.py | 1 - test/t/test_tightvncviewer.py | 1 - test/t/test_time.py | 7 +- test/t/test_timeout.py | 1 - test/t/test_tipc.py | 1 - test/t/test_touch.py | 4 +- test/t/test_tox.py | 1 - test/t/test_tr.py | 4 +- test/t/test_tracepath.py | 1 - test/t/test_tshark.py | 1 - test/t/test_tune2fs.py | 1 - test/t/test_udevadm.py | 1 - test/t/test_ulimit.py | 1 - test/t/test_umount.py | 1 - test/t/test_unace.py | 1 - test/t/test_uname.py | 4 +- test/t/test_unexpand.py | 6 +- test/t/test_uniq.py | 4 +- test/t/test_units.py | 4 +- test/t/test_unpack200.py | 1 - test/t/test_unrar.py | 1 - test/t/test_unset.py | 1 - test/t/test_unshunt.py | 1 - test/t/test_update_alternatives.py | 5 +- test/t/test_update_rc_d.py | 5 +- test/t/test_upgradepkg.py | 25 ++- test/t/test_urlsnarf.py | 1 - test/t/test_uscan.py | 1 - test/t/test_useradd.py | 1 - test/t/test_userdel.py | 1 - test/t/test_usermod.py | 1 - test/t/test_valgrind.py | 19 +- test/t/test_vdir.py | 1 - test/t/test_vgcfgbackup.py | 6 +- test/t/test_vgcfgrestore.py | 6 +- test/t/test_vgchange.py | 1 - test/t/test_vgck.py | 4 +- test/t/test_vgconvert.py | 6 +- test/t/test_vgcreate.py | 1 - test/t/test_vgdisplay.py | 6 +- test/t/test_vgexport.py | 4 +- test/t/test_vgextend.py | 4 +- test/t/test_vgimport.py | 4 +- test/t/test_vgmerge.py | 4 +- test/t/test_vgmknodes.py | 6 +- test/t/test_vgreduce.py | 4 +- test/t/test_vgremove.py | 4 +- test/t/test_vgrename.py | 4 +- test/t/test_vgs.py | 4 +- test/t/test_vgscan.py | 4 +- test/t/test_vgsplit.py | 1 - test/t/test_vi.py | 1 - test/t/test_vipw.py | 1 - test/t/test_vmstat.py | 1 - test/t/test_vncviewer.py | 1 - test/t/test_vpnc.py | 5 +- test/t/test_watch.py | 1 - test/t/test_wc.py | 4 +- test/t/test_webmitm.py | 1 - test/t/test_wget.py | 1 - test/t/test_who.py | 4 +- test/t/test_wine.py | 1 - test/t/test_withlist.py | 1 - test/t/test_wodim.py | 1 - test/t/test_wol.py | 11 +- test/t/test_write.py | 1 - test/t/test_wsimport.py | 1 - test/t/test_wtf.py | 1 - test/t/test_wvdial.py | 1 - test/t/test_xdg_mime.py | 5 +- test/t/test_xdg_settings.py | 5 +- test/t/test_xfreerdp.py | 1 - test/t/test_xgamma.py | 1 - test/t/test_xm.py | 1 - test/t/test_xmllint.py | 1 - test/t/test_xmlwf.py | 1 - test/t/test_xmms.py | 1 - test/t/test_xmodmap.py | 1 - test/t/test_xpovray.py | 1 - test/t/test_xrandr.py | 1 - test/t/test_xrdb.py | 1 - test/t/test_xsltproc.py | 1 - test/t/test_xvnc4viewer.py | 1 - test/t/test_xxd.py | 1 - test/t/test_xz.py | 5 +- test/t/test_xzdec.py | 1 - test/t/test_ypcat.py | 1 - test/t/test_ypmatch.py | 1 - test/t/test_yum.py | 1 - test/t/test_yum_arch.py | 5 +- test/t/test_zopfli.py | 1 - test/t/test_zopflipng.py | 1 - test/t/unit/test_unit_count_args.py | 26 ++- test/t/unit/test_unit_expand.py | 4 +- test/t/unit/test_unit_expand_tilde_by_ref.py | 4 +- test/t/unit/test_unit_filedir.py | 1 - .../test_unit_find_unique_completion_pair.py | 9 +- .../t/unit/test_unit_get_comp_words_by_ref.py | 11 +- test/t/unit/test_unit_get_cword.py | 8 +- test/t/unit/test_unit_init_completion.py | 13 +- test/t/unit/test_unit_ip_addresses.py | 25 ++- test/t/unit/test_unit_longopt.py | 9 +- test/t/unit/test_unit_parse_help.py | 9 +- test/t/unit/test_unit_parse_usage.py | 9 +- test/t/unit/test_unit_tilde.py | 21 +- 682 files changed, 715 insertions(+), 1377 deletions(-) create mode 100644 pyproject.toml diff --git a/.dir-locals.el b/.dir-locals.el index 2e969fa8f45..db8dc273c47 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -1,6 +1,8 @@ ;;; Directory Local Variables ;;; For more information see (info "(emacs) Directory Variables") -((sh-mode +((python-mode + (eval add-hook 'before-save-hook 'blacken-buffer nil t)) + (sh-mode (flycheck-sh-bash-args "-O" "extglob") (sh-indent-comment . t))) diff --git a/Makefile.am b/Makefile.am index 75acece0f70..87862675f67 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,7 +27,7 @@ CLEANFILES = bash_completion.sh bash-completion.pc \ bash-completion-config.cmake bash-completion-config-version.cmake EXTRA_DIST = CHANGES $(pkgdata_DATA) bash_completion.sh.in .dir-locals.el \ - .editorconfig README.md CONTRIBUTING.md + .editorconfig README.md CONTRIBUTING.md pyproject.toml install-data-hook: tmpfile=`mktemp $${TMPDIR:-/tmp}/bash_completion.XXXXXX` && \ diff --git a/helpers/python b/helpers/python index b6c4d5ed593..9e26825234e 100644 --- a/helpers/python +++ b/helpers/python @@ -11,4 +11,4 @@ else: walker = pkgutil.iter_modules for mod in walker(): - print(mod[1]) + print (mod[1]) # noqa: E211 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000000..2581528c37f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[tool.black] +line-length = 79 +target-version = ["py34", "py35", "py36", "py37", "py38"] diff --git a/test/docker/docker-script.sh b/test/docker/docker-script.sh index 35d89d63a64..bd8ef446137 100755 --- a/test/docker/docker-script.sh +++ b/test/docker/docker-script.sh @@ -3,6 +3,9 @@ if [ $DIST = tools ]; then perlcritic helpers/perl flake8 helpers/python test test/generate + black --check -t py27 -t py33 -t py34 -t py35 -t py36 -t py37 -t py38 \ + helpers/python + black --check test test/generate exit 0 fi diff --git a/test/generate b/test/generate index 2bf0ccc6edb..59f525b7997 100755 --- a/test/generate +++ b/test/generate @@ -29,7 +29,6 @@ import pytest %s class Test%s: - @pytest.mark.complete("%s %s") def test_1(self, completion): assert completion""" diff --git a/test/requirements.txt b/test/requirements.txt index dbe5bb1c86c..23ced80163d 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -1,3 +1,4 @@ +black>=19.3b0 pexpect>=4 pytest>=3.5 pytest-xdist diff --git a/test/t/conftest.py b/test/t/conftest.py index 7781fd1e6d8..0969a313144 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -13,16 +13,17 @@ def find_unique_completion_pair( - items: Iterable[str]) -> Optional[Tuple[str, str]]: + items: Iterable[str] +) -> Optional[Tuple[str, str]]: result = None bestscore = 0 sitems = sorted(set(items)) for i in range(len(sitems)): cur = sitems[i] curlen = len(cur) - prv = sitems[i-1] if i != 0 else "" + prv = sitems[i - 1] if i != 0 else "" prvlen = len(prv) - nxt = sitems[i+1] if i < len(sitems)-1 else "" + nxt = sitems[i + 1] if i < len(sitems) - 1 else "" nxtlen = len(nxt) diffprv = prv == "" diffnxt = nxt == "" @@ -55,9 +56,9 @@ def find_unique_completion_pair( @pytest.fixture(scope="class") def part_full_user(bash: pexpect.spawn) -> Optional[Tuple[str, str]]: - res = assert_bash_exec( - bash, "compgen -u", want_output=True, - ).strip().split() + res = ( + assert_bash_exec(bash, "compgen -u", want_output=True).strip().split() + ) pair = find_unique_completion_pair(res) if not pair: pytest.skip("No suitable test user found") @@ -66,9 +67,9 @@ def part_full_user(bash: pexpect.spawn) -> Optional[Tuple[str, str]]: @pytest.fixture(scope="class") def part_full_group(bash: pexpect.spawn) -> Optional[Tuple[str, str]]: - res = assert_bash_exec( - bash, "compgen -g", want_output=True, - ).strip().split() + res = ( + assert_bash_exec(bash, "compgen -g", want_output=True).strip().split() + ) pair = find_unique_completion_pair(res) if not pair: pytest.skip("No suitable test user found") @@ -82,17 +83,21 @@ def bash(request) -> pexpect.spawn: if os.environ.get("BASHCOMP_TEST_LOGFILE"): logfile = open(os.environ.get("BASHCOMP_TEST_LOGFILE"), "w") testdir = os.path.abspath( - os.path.join(os.path.dirname(__file__), os.pardir)) + os.path.join(os.path.dirname(__file__), os.pardir) + ) env = os.environ.copy() - env.update(dict( - SRCDIR=testdir, # TODO needed at least by bashrc - SRCDIRABS=testdir, # TODO needed? - PS1=PS1, - INPUTRC="%s/config/inputrc" % testdir, - TERM="dumb", - BASH_COMPLETION_COMPAT_DIR="%s/fixtures/shared/empty_dir" % testdir, - LC_COLLATE="C", # to match Python's default locale unaware sort - )) + env.update( + dict( + SRCDIR=testdir, # TODO needed at least by bashrc + SRCDIRABS=testdir, # TODO needed? + PS1=PS1, + INPUTRC="%s/config/inputrc" % testdir, + TERM="dumb", + BASH_COMPLETION_COMPAT_DIR="%s/fixtures/shared/empty_dir" + % testdir, + LC_COLLATE="C", # to match Python's default locale unaware sort + ) + ) fixturesdir = os.path.join(testdir, "fixtures") os.chdir(fixturesdir) @@ -140,7 +145,8 @@ def bash(request) -> pexpect.spawn: return if not cmd_found: match = re.search( - r"^test_(.+)\.py$", os.path.basename(str(request.fspath))) + r"^test_(.+)\.py$", os.path.basename(str(request.fspath)) + ) if match: cmd = match.group(1) @@ -152,8 +158,11 @@ def bash(request) -> pexpect.spawn: # reset to a good state first (Ctrl+C, expect prompt). bash.sendintr() bash.expect_exact(PS1) - diff_env(before_env, get_env(bash), - marker.kwargs.get("ignore_env") if marker else "") + diff_env( + before_env, + get_env(bash), + marker.kwargs.get("ignore_env") if marker else "", + ) if marker: for post_cmd in marker.kwargs.get("post_cmds", []): @@ -199,7 +208,8 @@ def load_completion_for(bash: pexpect.spawn, cmd: str) -> bool: def assert_bash_exec( - bash: pexpect.spawn, cmd: str, want_output: bool = False) -> str: + bash: pexpect.spawn, cmd: str, want_output: bool = False +) -> str: # Send command bash.sendline(cmd) @@ -212,41 +222,51 @@ def assert_bash_exec( # Retrieve exit status echo = "echo $?" bash.sendline(echo) - got = bash.expect([ - r"^%s\r\n(\d+)\r\n%s" % (re.escape(echo), re.escape(PS1)), - PS1, - pexpect.EOF, - pexpect.TIMEOUT, - ]) + got = bash.expect( + [ + r"^%s\r\n(\d+)\r\n%s" % (re.escape(echo), re.escape(PS1)), + PS1, + pexpect.EOF, + pexpect.TIMEOUT, + ] + ) status = bash.match.group(1) if got == 0 else "unknown" - assert status == "0", \ - 'Error running "%s": exit status=%s, output="%s"' % \ - (cmd, status, output) + assert status == "0", 'Error running "%s": exit status=%s, output="%s"' % ( + cmd, + status, + output, + ) if output: - assert want_output, \ - 'Unexpected output from "%s": exit status=%s, output="%s"' % \ - (cmd, status, output) + assert want_output, ( + 'Unexpected output from "%s": exit status=%s, output="%s"' + % (cmd, status, output) + ) else: - assert not want_output, \ - 'Expected output from "%s": exit status=%s, output="%s"' % \ - (cmd, status, output) + assert not want_output, ( + 'Expected output from "%s": exit status=%s, output="%s"' + % (cmd, status, output) + ) return output def get_env(bash: pexpect.spawn) -> List[str]: - return assert_bash_exec( - bash, - "{ (set -o posix ; set); declare -F; shopt -p; set -o; }", - want_output=True - ).strip().splitlines() + return ( + assert_bash_exec( + bash, + "{ (set -o posix ; set); declare -F; shopt -p; set -o; }", + want_output=True, + ) + .strip() + .splitlines() + ) def diff_env(before: List[str], after: List[str], ignore: str): diff = [ - x for x in - difflib.unified_diff(before, after, n=0, lineterm="") + x + for x in difflib.unified_diff(before, after, n=0, lineterm="") # Remove unified diff markers: if not re.search(r"^(---|\+\+\+|@@ )", x) # Ignore variables expected to change: @@ -260,8 +280,8 @@ def diff_env(before: List[str], after: List[str], ignore: str): # saving. Remove its changes, and note that it may take two lines. for i in range(0, len(diff)): if re.match("^[-+]COMP_WORDBREAKS=", diff[i]): - if i < len(diff) and not re.match(r"^\+[\w]+=", diff[i+1]): - del diff[i+1] + if i < len(diff) and not re.match(r"^\+[\w]+=", diff[i + 1]): + del diff[i + 1] del diff[i] break assert not diff, "Environment should not be modified" @@ -301,15 +321,19 @@ def __eq__(self, expected: Union[str, Iterable[str]]) -> bool: expiter = [expected] if isinstance(expected, str) else sorted(expected) if self._items is not None: return self._items == expiter - return bool(re.match(r"^\s*" + - r"\s+".join(re.escape(x) for x in expiter) + - r"\s*$", self.output)) + return bool( + re.match( + r"^\s*" + r"\s+".join(re.escape(x) for x in expiter) + r"\s*$", + self.output, + ) + ) def __contains__(self, item: str) -> bool: if self._items is not None: return item in self._items return bool( - re.search(r"(^|\s)%s(\s|$)" % re.escape(item), self.output)) + re.search(r"(^|\s)%s(\s|$)" % re.escape(item), self.output) + ) def __iter__(self) -> Iterable[str]: """ @@ -318,8 +342,11 @@ def __iter__(self) -> Iterable[str]: whitespace. In those cases, it errs on the side of possibly returning more items than there actually are, and intends to never return fewer. """ - return iter(self._items if self._items is not None - else re.split(r" {2,}|\r\n", self.output.strip())) + return iter( + self._items + if self._items is not None + else re.split(r" {2,}|\r\n", self.output.strip()) + ) def __len__(self) -> int: """ @@ -333,7 +360,8 @@ def __repr__(self) -> str: def assert_complete( - bash: pexpect.spawn, cmd: str, **kwargs) -> CompletionResult: + bash: pexpect.spawn, cmd: str, **kwargs +) -> CompletionResult: skipif = kwargs.get("skipif") if skipif: try: @@ -350,29 +378,33 @@ def assert_complete( env = kwargs.get("env", {}) if env: # Back up environment and apply new one - assert_bash_exec(bash, " ".join( - '%s%s="$%s"' % (env_prefix, k, k) for k in env.keys() - )) - assert_bash_exec(bash, "export %s" % " ".join( - "%s=%s" % (k, v) for k, v in env.items() - )) + assert_bash_exec( + bash, + " ".join('%s%s="$%s"' % (env_prefix, k, k) for k in env.keys()), + ) + assert_bash_exec( + bash, + "export %s" % " ".join("%s=%s" % (k, v) for k, v in env.items()), + ) bash.send(cmd + "\t") bash.expect_exact(cmd) bash.send(MAGIC_MARK) - got = bash.expect([ - # 0: multiple lines, result in .before - r"\r\n" + re.escape(PS1 + cmd) + ".*" + MAGIC_MARK, - # 1: no completion - r"^" + MAGIC_MARK, - # 2: on same line, result in .match - r"^([^\r]+)%s$" % MAGIC_MARK, - pexpect.EOF, - pexpect.TIMEOUT, - ]) + got = bash.expect( + [ + # 0: multiple lines, result in .before + r"\r\n" + re.escape(PS1 + cmd) + ".*" + MAGIC_MARK, + # 1: no completion + r"^" + MAGIC_MARK, + # 2: on same line, result in .match + r"^([^\r]+)%s$" % MAGIC_MARK, + pexpect.EOF, + pexpect.TIMEOUT, + ] + ) if got == 0: output = bash.before if output.endswith(MAGIC_MARK): - output = bash.before[:-len(MAGIC_MARK)] + output = bash.before[: -len(MAGIC_MARK)] result = CompletionResult(output) elif got == 2: output = bash.match.group(1) @@ -387,12 +419,16 @@ def assert_complete( # TODO: Test with declare -p if a var was set, backup only if yes, and # similarly restore only backed up vars. Should remove some need # for ignore_env. - assert_bash_exec(bash, "export %s" % " ".join( - '%s="$%s%s"' % (k, env_prefix, k) for k in env.keys() - )) - assert_bash_exec(bash, "unset -v %s" % " ".join( - "%s%s" % (env_prefix, k) for k in env.keys() - )) + assert_bash_exec( + bash, + "export %s" + % " ".join('%s="$%s%s"' % (k, env_prefix, k) for k in env.keys()), + ) + assert_bash_exec( + bash, + "unset -v %s" + % " ".join("%s%s" % (env_prefix, k) for k in env.keys()), + ) if cwd: assert_bash_exec(bash, "cd - >/dev/null") return result @@ -413,12 +449,13 @@ def in_docker() -> bool: class TestUnitBase: - - def _test_unit(self, func, bash, - comp_words, comp_cword, comp_line, comp_point, arg=""): + def _test_unit( + self, func, bash, comp_words, comp_cword, comp_line, comp_point, arg="" + ): assert_bash_exec( bash, - "COMP_WORDS=%s COMP_CWORD=%d COMP_LINE=%s COMP_POINT=%d" % - (comp_words, comp_cword, shlex.quote(comp_line), comp_point)) + "COMP_WORDS=%s COMP_CWORD=%d COMP_LINE=%s COMP_POINT=%d" + % (comp_words, comp_cword, shlex.quote(comp_line), comp_point), + ) output = assert_bash_exec(bash, func % arg, want_output=True) return output.strip() diff --git a/test/t/test_2to3.py b/test/t/test_2to3.py index 23ff6e0258a..966ed1f5c5f 100644 --- a/test/t/test_2to3.py +++ b/test/t/test_2to3.py @@ -2,7 +2,6 @@ class Test2to3: - @pytest.mark.complete("2to3 ") def test_1(self, completion): assert completion diff --git a/test/t/test_7z.py b/test/t/test_7z.py index ec067463afd..02f67089421 100644 --- a/test/t/test_7z.py +++ b/test/t/test_7z.py @@ -2,7 +2,6 @@ class Test7z: - @pytest.mark.complete("7z ") def test_1(self, completion): assert completion diff --git a/test/t/test_a2ps.py b/test/t/test_a2ps.py index f4f3a739583..9d885461e7b 100644 --- a/test/t/test_a2ps.py +++ b/test/t/test_a2ps.py @@ -2,7 +2,6 @@ class TestA2ps: - @pytest.mark.complete("a2ps ") def test_1(self, completion): assert completion diff --git a/test/t/test_a2x.py b/test/t/test_a2x.py index 2847bc44a44..3741e28d2c0 100644 --- a/test/t/test_a2x.py +++ b/test/t/test_a2x.py @@ -2,7 +2,6 @@ class TestA2x: - @pytest.mark.complete("a2x ") def test_1(self, completion): assert completion diff --git a/test/t/test_abook.py b/test/t/test_abook.py index 7eda13def7f..1df910cfd54 100644 --- a/test/t/test_abook.py +++ b/test/t/test_abook.py @@ -2,7 +2,6 @@ class TestAbook: - @pytest.mark.complete("abook -") def test_1(self, completion): assert completion diff --git a/test/t/test_aclocal.py b/test/t/test_aclocal.py index fa7809b3977..cb3aca1bffe 100644 --- a/test/t/test_aclocal.py +++ b/test/t/test_aclocal.py @@ -2,7 +2,6 @@ class TestAclocal: - @pytest.mark.complete("aclocal ") def test_1(self, completion): assert completion diff --git a/test/t/test_acpi.py b/test/t/test_acpi.py index 3a99d52b9f5..8da4eaf45dd 100644 --- a/test/t/test_acpi.py +++ b/test/t/test_acpi.py @@ -2,7 +2,6 @@ class TestAcpi: - @pytest.mark.complete("acpi -") def test_1(self, completion): assert completion diff --git a/test/t/test_acroread.py b/test/t/test_acroread.py index 6c710342929..471b93c251a 100644 --- a/test/t/test_acroread.py +++ b/test/t/test_acroread.py @@ -2,7 +2,6 @@ class TestAcroread: - @pytest.mark.complete("acroread ", cwd="fixtures/acroread") def test_1(self, completion): assert completion == "foo.d/ t.pdf".split() diff --git a/test/t/test_adb.py b/test/t/test_adb.py index 00c5738f931..081a10470aa 100644 --- a/test/t/test_adb.py +++ b/test/t/test_adb.py @@ -2,7 +2,6 @@ class TestAdb: - @pytest.mark.complete("adb ") def test_1(self, completion): assert completion diff --git a/test/t/test_add_members.py b/test/t/test_add_members.py index 8a1c8a4c6bb..095a5ded7ee 100644 --- a/test/t/test_add_members.py +++ b/test/t/test_add_members.py @@ -2,7 +2,6 @@ class TestAddMembers: - @pytest.mark.complete("add_members -") def test_1(self, completion): assert completion diff --git a/test/t/test_alias.py b/test/t/test_alias.py index 26236a76691..da9ecc33b1b 100644 --- a/test/t/test_alias.py +++ b/test/t/test_alias.py @@ -2,17 +2,10 @@ @pytest.mark.bashcomp( - pre_cmds=( - "unalias -a", - "alias foo=bar", - "alias bar='foo foo'", - ), - post_cmds=( - "unalias -a", - ), + pre_cmds=("unalias -a", "alias foo=bar", "alias bar='foo foo'"), + post_cmds=("unalias -a",), ) class TestAlias: - @pytest.mark.complete("alias ") def test_1(self, completion): assert completion == "bar foo".split() diff --git a/test/t/test_alpine.py b/test/t/test_alpine.py index 83f6354ae06..a8a83a0b1a8 100644 --- a/test/t/test_alpine.py +++ b/test/t/test_alpine.py @@ -2,7 +2,6 @@ class TestAlpine: - @pytest.mark.complete("alpine -") def test_1(self, completion): assert completion diff --git a/test/t/test_animate.py b/test/t/test_animate.py index 7fc02a8e7f6..2103606e845 100644 --- a/test/t/test_animate.py +++ b/test/t/test_animate.py @@ -2,7 +2,6 @@ class TestAnimate: - @pytest.mark.complete("animate ") def test_1(self, completion): assert completion diff --git a/test/t/test_ant.py b/test/t/test_ant.py index b1f87b763cd..225a1148428 100644 --- a/test/t/test_ant.py +++ b/test/t/test_ant.py @@ -3,7 +3,6 @@ @pytest.mark.bashcomp(ignore_env=r"^\+ANT_ARGS=") class TestAnt: - @pytest.mark.complete("ant -") def test_1(self, completion): assert completion @@ -16,7 +15,8 @@ def test_2(self, completion): def test_3(self, completion): assert completion == "build-with-import imported-build".split() - @pytest.mark.complete("ant ", cwd="ant", - env=dict(ANT_ARGS="'-f named-build.xml'")) + @pytest.mark.complete( + "ant ", cwd="ant", env=dict(ANT_ARGS="'-f named-build.xml'") + ) def test_4(self, completion): assert completion == "named-build" diff --git a/test/t/test_apache2ctl.py b/test/t/test_apache2ctl.py index 5abce583d5f..856a0e4dc68 100644 --- a/test/t/test_apache2ctl.py +++ b/test/t/test_apache2ctl.py @@ -2,7 +2,6 @@ class TestApache2ctl: - @pytest.mark.complete("apache2ctl ") def test_1(self, completion): assert completion diff --git a/test/t/test_appdata_validate.py b/test/t/test_appdata_validate.py index 3eccec33724..d57aa99208e 100644 --- a/test/t/test_appdata_validate.py +++ b/test/t/test_appdata_validate.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="appdata-validate", -) +@pytest.mark.bashcomp(cmd="appdata-validate") class TestAppdataValidate: - @pytest.mark.complete("appdata-validate ") def test_1(self, completion): assert completion diff --git a/test/t/test_apt_build.py b/test/t/test_apt_build.py index 38ac0e338d2..8346e110b64 100644 --- a/test/t/test_apt_build.py +++ b/test/t/test_apt_build.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="apt-build", -) +@pytest.mark.bashcomp(cmd="apt-build") class TestAptBuild: - @pytest.mark.complete("apt-build ") def test_1(self, completion): assert completion diff --git a/test/t/test_apt_cache.py b/test/t/test_apt_cache.py index 453aa93b67a..195df17b901 100644 --- a/test/t/test_apt_cache.py +++ b/test/t/test_apt_cache.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="apt-cache", -) +@pytest.mark.bashcomp(cmd="apt-cache") class TestAptCache: - @pytest.mark.complete("apt-cache ") def test_1(self, completion): assert completion diff --git a/test/t/test_apt_get.py b/test/t/test_apt_get.py index 49ae653777e..ccdff6cd947 100644 --- a/test/t/test_apt_get.py +++ b/test/t/test_apt_get.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="apt-get", -) +@pytest.mark.bashcomp(cmd="apt-get") class TestAptGet: - @pytest.mark.complete("apt-get ") def test_1(self, completion): assert all(x in completion for x in "install update".split()) diff --git a/test/t/test_aptitude.py b/test/t/test_aptitude.py index 621dea3ce63..c59c35802e1 100644 --- a/test/t/test_aptitude.py +++ b/test/t/test_aptitude.py @@ -2,7 +2,6 @@ class TestAptitude: - @pytest.mark.complete("aptitude ") def test_1(self, completion): assert completion diff --git a/test/t/test_arch.py b/test/t/test_arch.py index dfbf8e616f7..69e0b1ae6a1 100644 --- a/test/t/test_arch.py +++ b/test/t/test_arch.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "PATH=/usr/lib/mailman/bin:$PATH", - ), -) +@pytest.mark.bashcomp(pre_cmds=("PATH=/usr/lib/mailman/bin:$PATH",)) class TestArch: - @pytest.mark.complete("arch -") def test_1(self, completion): assert completion diff --git a/test/t/test_arp.py b/test/t/test_arp.py index c78ae30e69f..35963d754ec 100644 --- a/test/t/test_arp.py +++ b/test/t/test_arp.py @@ -4,7 +4,6 @@ class TestArp: - @pytest.mark.xfail(in_docker(), reason="Probably fails in docker") @pytest.mark.complete("arp ") def test_1(self, completion): diff --git a/test/t/test_arping.py b/test/t/test_arping.py index 02e9360a25e..850344bed95 100644 --- a/test/t/test_arping.py +++ b/test/t/test_arping.py @@ -2,7 +2,6 @@ class TestArping: - @pytest.mark.complete("arping ") def test_1(self, completion): assert completion diff --git a/test/t/test_arpspoof.py b/test/t/test_arpspoof.py index 40ecb8ddedd..9fcf20b727a 100644 --- a/test/t/test_arpspoof.py +++ b/test/t/test_arpspoof.py @@ -2,7 +2,6 @@ class TestArpspoof: - @pytest.mark.complete("arpspoof -") def test_1(self, completion): assert completion diff --git a/test/t/test_asciidoc.py b/test/t/test_asciidoc.py index 20a34ea7e38..b295a27d529 100644 --- a/test/t/test_asciidoc.py +++ b/test/t/test_asciidoc.py @@ -2,7 +2,6 @@ class TestAsciidoc: - @pytest.mark.complete("asciidoc ") def test_1(self, completion): assert completion diff --git a/test/t/test_aspell.py b/test/t/test_aspell.py index 2a7e87c8f7b..b7a03c417fe 100644 --- a/test/t/test_aspell.py +++ b/test/t/test_aspell.py @@ -2,7 +2,6 @@ class TestAspell: - @pytest.mark.complete("aspell ") def test_1(self, completion): assert completion diff --git a/test/t/test_autoconf.py b/test/t/test_autoconf.py index 7636b8b3384..9b98b6253c9 100644 --- a/test/t/test_autoconf.py +++ b/test/t/test_autoconf.py @@ -2,7 +2,6 @@ class TestAutoconf: - @pytest.mark.complete("autoconf ") def test_1(self, completion): assert completion diff --git a/test/t/test_autoheader.py b/test/t/test_autoheader.py index 2c680660277..57ad8af130c 100644 --- a/test/t/test_autoheader.py +++ b/test/t/test_autoheader.py @@ -2,7 +2,6 @@ class TestAutoheader: - @pytest.mark.complete("autoheader ") def test_1(self, completion): assert completion diff --git a/test/t/test_automake.py b/test/t/test_automake.py index 0ae039e4cc1..5d25c6a7e69 100644 --- a/test/t/test_automake.py +++ b/test/t/test_automake.py @@ -2,7 +2,6 @@ class TestAutomake: - @pytest.mark.complete("automake ") def test_1(self, completion): assert completion diff --git a/test/t/test_autoreconf.py b/test/t/test_autoreconf.py index c9bca1ef7a5..10e2a2e8970 100644 --- a/test/t/test_autoreconf.py +++ b/test/t/test_autoreconf.py @@ -2,7 +2,6 @@ class TestAutoreconf: - @pytest.mark.complete("autoreconf ") def test_1(self, completion): assert completion diff --git a/test/t/test_autorpm.py b/test/t/test_autorpm.py index df1c3812085..185585e0edf 100644 --- a/test/t/test_autorpm.py +++ b/test/t/test_autorpm.py @@ -2,7 +2,6 @@ class TestAutorpm: - @pytest.mark.complete("autorpm ") def test_1(self, completion): assert completion diff --git a/test/t/test_autoscan.py b/test/t/test_autoscan.py index 9dbd13dff41..b2667543176 100644 --- a/test/t/test_autoscan.py +++ b/test/t/test_autoscan.py @@ -2,7 +2,6 @@ class TestAutoscan: - @pytest.mark.complete("autoscan ") def test_1(self, completion): assert completion diff --git a/test/t/test_autoupdate.py b/test/t/test_autoupdate.py index 1701ffe680d..13fd8d4d901 100644 --- a/test/t/test_autoupdate.py +++ b/test/t/test_autoupdate.py @@ -2,7 +2,6 @@ class TestAutoupdate: - @pytest.mark.complete("autoupdate ") def test_1(self, completion): assert completion diff --git a/test/t/test_avctrl.py b/test/t/test_avctrl.py index 23eca7bb8d0..6ff1ec38dfd 100644 --- a/test/t/test_avctrl.py +++ b/test/t/test_avctrl.py @@ -2,7 +2,6 @@ class TestAvctrl: - @pytest.mark.complete("avctrl ") def test_1(self, completion): assert completion diff --git a/test/t/test_awk.py b/test/t/test_awk.py index 7ae0c9c60c2..ad2034d1f37 100644 --- a/test/t/test_awk.py +++ b/test/t/test_awk.py @@ -2,7 +2,6 @@ class TestAwk: - @pytest.mark.complete("awk ") def test_1(self, completion): assert completion diff --git a/test/t/test_badblocks.py b/test/t/test_badblocks.py index c4e62bf576a..57a559de5d6 100644 --- a/test/t/test_badblocks.py +++ b/test/t/test_badblocks.py @@ -2,7 +2,6 @@ class TestBadblocks: - @pytest.mark.complete("badblocks ") def test_1(self, completion): assert completion diff --git a/test/t/test_base64.py b/test/t/test_base64.py index 20c5c18dac5..efc35ebbfb0 100644 --- a/test/t/test_base64.py +++ b/test/t/test_base64.py @@ -2,7 +2,6 @@ class TestBase64: - @pytest.mark.complete("base64 ") def test_1(self, completion): assert completion diff --git a/test/t/test_bash.py b/test/t/test_bash.py index fe788e43d10..d6e6959a49c 100644 --- a/test/t/test_bash.py +++ b/test/t/test_bash.py @@ -2,7 +2,6 @@ class TestBash: - @pytest.mark.complete("bash --") def test_1(self, completion): assert completion diff --git a/test/t/test_bc.py b/test/t/test_bc.py index 6924103ff93..effcbaeac1e 100644 --- a/test/t/test_bc.py +++ b/test/t/test_bc.py @@ -2,7 +2,6 @@ class TestBc: - @pytest.mark.complete("bc --") def test_1(self, completion): assert completion diff --git a/test/t/test_bind.py b/test/t/test_bind.py index 5e783547303..f97a246e1ba 100644 --- a/test/t/test_bind.py +++ b/test/t/test_bind.py @@ -2,7 +2,6 @@ class TestBind: - @pytest.mark.complete("bind -") def test_1(self, completion): assert completion diff --git a/test/t/test_bison.py b/test/t/test_bison.py index f6e4c201464..47c4908c2fb 100644 --- a/test/t/test_bison.py +++ b/test/t/test_bison.py @@ -2,7 +2,6 @@ class TestBison: - @pytest.mark.complete("bison --") def test_1(self, completion): assert completion diff --git a/test/t/test_bk.py b/test/t/test_bk.py index 724f1a74a67..8ab44b68846 100644 --- a/test/t/test_bk.py +++ b/test/t/test_bk.py @@ -2,7 +2,6 @@ class TestBk: - @pytest.mark.complete("bk ") def test_1(self, completion): assert completion diff --git a/test/t/test_brctl.py b/test/t/test_brctl.py index 18d49e11ee0..7c773e97159 100644 --- a/test/t/test_brctl.py +++ b/test/t/test_brctl.py @@ -2,7 +2,6 @@ class TestBrctl: - @pytest.mark.complete("brctl ") def test_1(self, completion): assert completion diff --git a/test/t/test_btdownloadcurses_py.py b/test/t/test_btdownloadcurses_py.py index db0509bf6b0..0b65519a98e 100644 --- a/test/t/test_btdownloadcurses_py.py +++ b/test/t/test_btdownloadcurses_py.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="btdownloadcurses.py", -) +@pytest.mark.bashcomp(cmd="btdownloadcurses.py") class TestBtdownloadcursesPy: - @pytest.mark.complete("btdownloadcurses.py ") def test_1(self, completion): assert completion diff --git a/test/t/test_btdownloadgui_py.py b/test/t/test_btdownloadgui_py.py index eabf78e2f06..c1b1b38acda 100644 --- a/test/t/test_btdownloadgui_py.py +++ b/test/t/test_btdownloadgui_py.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="btdownloadgui.py", -) +@pytest.mark.bashcomp(cmd="btdownloadgui.py") class TestBtdownloadguiPy: - @pytest.mark.complete("btdownloadgui.py ") def test_1(self, completion): assert completion diff --git a/test/t/test_btdownloadheadless_py.py b/test/t/test_btdownloadheadless_py.py index 31affd5a796..f84592fa492 100644 --- a/test/t/test_btdownloadheadless_py.py +++ b/test/t/test_btdownloadheadless_py.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="btdownloadheadless.py", -) +@pytest.mark.bashcomp(cmd="btdownloadheadless.py") class TestBtdownloadheadlessPy: - @pytest.mark.complete("btdownloadheadless.py ") def test_1(self, completion): assert completion diff --git a/test/t/test_bts.py b/test/t/test_bts.py index aafb98f2f24..53dd62fc518 100644 --- a/test/t/test_bts.py +++ b/test/t/test_bts.py @@ -2,7 +2,6 @@ class TestBts: - @pytest.mark.complete("bts ") def test_1(self, completion): assert completion diff --git a/test/t/test_bzip2.py b/test/t/test_bzip2.py index e1063a743a6..d1cad249aee 100644 --- a/test/t/test_bzip2.py +++ b/test/t/test_bzip2.py @@ -2,7 +2,6 @@ class TestBzip2: - @pytest.mark.complete("bzip2 ") def test_1(self, completion): assert completion diff --git a/test/t/test_cal.py b/test/t/test_cal.py index 80ae28eb0bc..27102c7a028 100644 --- a/test/t/test_cal.py +++ b/test/t/test_cal.py @@ -2,7 +2,6 @@ class TestCal: - @pytest.mark.complete("cal ") def test_1(self, completion): assert completion diff --git a/test/t/test_cancel.py b/test/t/test_cancel.py index 29651f6de1b..4aeafd2c5fa 100644 --- a/test/t/test_cancel.py +++ b/test/t/test_cancel.py @@ -4,21 +4,31 @@ class TestCancel: - @pytest.fixture(scope="class") def added_job(self, request, bash): try: - got = assert_bash_exec(bash, "lp -H hold shared/default/foo", - want_output=True).strip().split() + got = ( + assert_bash_exec( + bash, "lp -H hold shared/default/foo", want_output=True + ) + .strip() + .split() + ) except AssertionError: pytest.skip("Could not add test print job") return if len(got) > 3: request.addfinalizer( - lambda: assert_bash_exec(bash, "cancel %s" % got[3])) + lambda: assert_bash_exec(bash, "cancel %s" % got[3]) + ) @pytest.mark.complete("cancel ") def test_1(self, bash, completion, added_job): - got = assert_bash_exec(bash, "lpstat | awk '{print $1}'", - want_output=True).strip().split() + got = ( + assert_bash_exec( + bash, "lpstat | awk '{print $1}'", want_output=True + ) + .strip() + .split() + ) assert completion == sorted(got) diff --git a/test/t/test_cardctl.py b/test/t/test_cardctl.py index 379e5483469..df28b6bda0d 100644 --- a/test/t/test_cardctl.py +++ b/test/t/test_cardctl.py @@ -2,7 +2,6 @@ class TestCardctl: - @pytest.mark.complete("cardctl ") def test_1(self, completion): assert completion diff --git a/test/t/test_cat.py b/test/t/test_cat.py index 40a604779f9..94245e8fcd5 100644 --- a/test/t/test_cat.py +++ b/test/t/test_cat.py @@ -2,7 +2,6 @@ class TestCat: - @pytest.mark.complete("cat ") def test_1(self, completion): assert completion diff --git a/test/t/test_cc.py b/test/t/test_cc.py index 192685d670b..12f6b2b5c6c 100644 --- a/test/t/test_cc.py +++ b/test/t/test_cc.py @@ -2,7 +2,6 @@ class TestCc: - @pytest.mark.complete("cc ") def test_1(self, completion): assert completion diff --git a/test/t/test_ccache.py b/test/t/test_ccache.py index af10f38302e..573e3e44991 100644 --- a/test/t/test_ccache.py +++ b/test/t/test_ccache.py @@ -2,7 +2,6 @@ class TestCcache: - @pytest.mark.complete("ccache -") def test_1(self, completion): assert completion diff --git a/test/t/test_ccze.py b/test/t/test_ccze.py index 32ddd84fd70..c54a1fa141f 100644 --- a/test/t/test_ccze.py +++ b/test/t/test_ccze.py @@ -2,7 +2,6 @@ class TestCcze: - @pytest.mark.complete("ccze ") def test_1(self, completion): assert completion diff --git a/test/t/test_cd.py b/test/t/test_cd.py index ff4f056cada..fd532312cf2 100644 --- a/test/t/test_cd.py +++ b/test/t/test_cd.py @@ -3,7 +3,6 @@ @pytest.mark.bashcomp(ignore_env=r"^\+CDPATH=$") class TestCd: - @pytest.mark.complete("cd shared/default/") def test_1(self, completion): assert completion == ["bar bar.d/", "foo.d/"] @@ -16,8 +15,8 @@ def test_2(self, completion): def test_3(self, completion): assert not completion - @pytest.mark.complete("cd ", - cwd="shared/default/foo.d", - env=dict(CDPATH="")) + @pytest.mark.complete( + "cd ", cwd="shared/default/foo.d", env=dict(CDPATH="") + ) def test_4(self, completion): assert not completion # No subdirs nor CDPATH diff --git a/test/t/test_cdrecord.py b/test/t/test_cdrecord.py index f414432cbcc..d9d2da1f780 100644 --- a/test/t/test_cdrecord.py +++ b/test/t/test_cdrecord.py @@ -2,7 +2,6 @@ class TestCdrecord: - @pytest.mark.complete("cdrecord -d") def test_1(self, completion): assert completion diff --git a/test/t/test_cfagent.py b/test/t/test_cfagent.py index a3079c8539b..f4b477bcfd5 100644 --- a/test/t/test_cfagent.py +++ b/test/t/test_cfagent.py @@ -2,7 +2,6 @@ class TestCfagent: - @pytest.mark.complete("cfagent -") def test_1(self, completion): assert completion diff --git a/test/t/test_cfrun.py b/test/t/test_cfrun.py index 2fb8b950187..a647d76b246 100644 --- a/test/t/test_cfrun.py +++ b/test/t/test_cfrun.py @@ -2,7 +2,6 @@ class TestCfrun: - @pytest.mark.complete("cfrun -") def test_1(self, completion): assert completion diff --git a/test/t/test_chage.py b/test/t/test_chage.py index 3129ced74bd..6ef344357b9 100644 --- a/test/t/test_chage.py +++ b/test/t/test_chage.py @@ -2,7 +2,6 @@ class TestChage: - @pytest.mark.complete("chage ") def test_1(self, completion): assert completion diff --git a/test/t/test_change_pw.py b/test/t/test_change_pw.py index db664a70624..69909af08cc 100644 --- a/test/t/test_change_pw.py +++ b/test/t/test_change_pw.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "PATH=/usr/lib/mailman/bin:$PATH", - ), -) +@pytest.mark.bashcomp(pre_cmds=("PATH=/usr/lib/mailman/bin:$PATH",)) class TestChangePw: - @pytest.mark.complete("change_pw -") def test_1(self, completion): assert completion diff --git a/test/t/test_check_db.py b/test/t/test_check_db.py index 65968a908ec..a9f4844b084 100644 --- a/test/t/test_check_db.py +++ b/test/t/test_check_db.py @@ -2,7 +2,6 @@ class TestCheckDb: - @pytest.mark.complete("check_db -") def test_1(self, completion): assert completion diff --git a/test/t/test_check_perms.py b/test/t/test_check_perms.py index 5c5b38a727e..813ae4ce0a5 100644 --- a/test/t/test_check_perms.py +++ b/test/t/test_check_perms.py @@ -2,7 +2,6 @@ class TestCheckPerms: - @pytest.mark.complete("check_perms -") def test_1(self, completion): assert completion diff --git a/test/t/test_checksec.py b/test/t/test_checksec.py index 5842b494c9c..4fce13ff2c0 100644 --- a/test/t/test_checksec.py +++ b/test/t/test_checksec.py @@ -2,7 +2,6 @@ class TestChecksec: - @pytest.mark.complete("checksec -") def test_1(self, completion): assert completion diff --git a/test/t/test_chfn.py b/test/t/test_chfn.py index c26655271eb..ca719b8edf1 100644 --- a/test/t/test_chfn.py +++ b/test/t/test_chfn.py @@ -2,7 +2,6 @@ class TestChfn: - @pytest.mark.complete("chfn ") def test_1(self, completion): assert completion diff --git a/test/t/test_chgrp.py b/test/t/test_chgrp.py index 0adf4770ca3..87a583e750d 100644 --- a/test/t/test_chgrp.py +++ b/test/t/test_chgrp.py @@ -2,7 +2,6 @@ class TestChgrp: - @pytest.mark.complete("chgrp ") def test_1(self, completion): assert completion diff --git a/test/t/test_chkconfig.py b/test/t/test_chkconfig.py index 2868b22541c..c610a5d5ba9 100644 --- a/test/t/test_chkconfig.py +++ b/test/t/test_chkconfig.py @@ -2,14 +2,14 @@ class TestChkconfig: - @pytest.mark.complete("chkconfig -") def test_1(self, completion): assert completion # systemd may not be running e.g. in a docker container, and listing # services will then fail. - @pytest.mark.complete("chkconfig ", - skipif="! systemctl list-units &>/dev/null") + @pytest.mark.complete( + "chkconfig ", skipif="! systemctl list-units &>/dev/null" + ) def test_2(self, completion): assert completion diff --git a/test/t/test_chown.py b/test/t/test_chown.py index bdfef3ff507..37221cfa861 100644 --- a/test/t/test_chown.py +++ b/test/t/test_chown.py @@ -9,16 +9,17 @@ pre_cmds=( # Fake root command to get all users/groups completed at least for now "root_command=sudo", - ), + ) ) class TestChown: - - @pytest.mark.xfail(getpass.getuser() != "root", - reason="Only root can chown to all users") + @pytest.mark.xfail( + getpass.getuser() != "root", reason="Only root can chown to all users" + ) @pytest.mark.complete("chown ") def test_1(self, bash, completion): - users = sorted(assert_bash_exec( - bash, "compgen -A user", want_output=True).split()) + users = sorted( + assert_bash_exec(bash, "compgen -A user", want_output=True).split() + ) assert completion == users @pytest.mark.complete("chown foo: shared/default/") @@ -38,8 +39,7 @@ def test_4(self, bash, part_full_user): def test_5(self, bash, part_full_user, part_full_group): _, user = part_full_user partgroup, fullgroup = part_full_group - completion = assert_complete( - bash, "chown %s:%s" % (user, partgroup)) + completion = assert_complete(bash, "chown %s:%s" % (user, partgroup)) assert completion == "%s:%s" % (user, fullgroup) assert completion.output.endswith(" ") @@ -53,11 +53,15 @@ def test_6(self, bash, part_full_group): def test_7(self, bash, part_full_group): """Test preserving special chars in $prefix$partgroup.""" part, full = part_full_group - for prefix in (r"funky\ user:", "funky.user:", r"funky\.user:", - r"fu\ nky.user:", r"f\ o\ o\.\bar:", - r"foo\_b\ a\.r\ :"): - completion = assert_complete( - bash, "chown %s%s" % (prefix, part)) + for prefix in ( + r"funky\ user:", + "funky.user:", + r"funky\.user:", + r"fu\ nky.user:", + r"f\ o\ o\.\bar:", + r"foo\_b\ a\.r\ :", + ): + completion = assert_complete(bash, "chown %s%s" % (prefix, part)) assert completion == "%s%s" % (prefix, full) assert completion.output.endswith(" ") @@ -67,7 +71,8 @@ def test_8(self, bash, part_full_user, part_full_group): partgroup, _ = part_full_group for x in range(2, 5): completion = assert_complete( - bash, "chown %s%s:%s" % (user, x * "\\", partgroup)) + bash, "chown %s%s:%s" % (user, x * "\\", partgroup) + ) assert not completion def test_9(self, bash, part_full_group): diff --git a/test/t/test_chpasswd.py b/test/t/test_chpasswd.py index 132b70ee716..ce16a75d670 100644 --- a/test/t/test_chpasswd.py +++ b/test/t/test_chpasswd.py @@ -2,7 +2,6 @@ class TestChpasswd: - @pytest.mark.complete("chpasswd -") def test_1(self, completion): assert completion diff --git a/test/t/test_chromium_browser.py b/test/t/test_chromium_browser.py index 58695f945db..75cabdaf9af 100644 --- a/test/t/test_chromium_browser.py +++ b/test/t/test_chromium_browser.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="chromium-browser", -) +@pytest.mark.bashcomp(cmd="chromium-browser") class TestChromiumBrowser: - @pytest.mark.complete("chromium-browser ") def test_1(self, completion): assert completion diff --git a/test/t/test_chronyc.py b/test/t/test_chronyc.py index b221013ce00..fdc91ac5e79 100644 --- a/test/t/test_chronyc.py +++ b/test/t/test_chronyc.py @@ -2,7 +2,6 @@ class TestChronyc: - @pytest.mark.complete("chronyc ") def test_1(self, completion): assert completion diff --git a/test/t/test_chroot.py b/test/t/test_chroot.py index 41d00ae3bb5..1f28cefa394 100644 --- a/test/t/test_chroot.py +++ b/test/t/test_chroot.py @@ -2,7 +2,6 @@ class TestChroot: - @pytest.mark.complete("chroot ") def test_1(self, completion): assert completion diff --git a/test/t/test_chrpath.py b/test/t/test_chrpath.py index 40a4a7e1d25..036a1a41607 100644 --- a/test/t/test_chrpath.py +++ b/test/t/test_chrpath.py @@ -2,7 +2,6 @@ class TestChrpath: - @pytest.mark.complete("chrpath ") def test_1(self, completion): assert completion diff --git a/test/t/test_chsh.py b/test/t/test_chsh.py index 59866f5de48..26e3a0a3426 100644 --- a/test/t/test_chsh.py +++ b/test/t/test_chsh.py @@ -2,7 +2,6 @@ class TestChsh: - @pytest.mark.complete("chsh ") def test_1(self, completion): assert completion diff --git a/test/t/test_ci.py b/test/t/test_ci.py index ac88903e9a1..f941b2ccc6d 100644 --- a/test/t/test_ci.py +++ b/test/t/test_ci.py @@ -2,7 +2,6 @@ class TestCi: - @pytest.mark.complete("ci ") def test_1(self, completion): assert completion diff --git a/test/t/test_ciptool.py b/test/t/test_ciptool.py index 086023da462..0ff54442c83 100644 --- a/test/t/test_ciptool.py +++ b/test/t/test_ciptool.py @@ -2,7 +2,6 @@ class TestCiptool: - @pytest.mark.complete("ciptool ") def test_1(self, completion): assert completion diff --git a/test/t/test_civclient.py b/test/t/test_civclient.py index 99e0c7641d3..cff70f4761c 100644 --- a/test/t/test_civclient.py +++ b/test/t/test_civclient.py @@ -2,7 +2,6 @@ class TestCivclient: - @pytest.mark.complete("civclient -") def test_1(self, completion): assert completion diff --git a/test/t/test_civserver.py b/test/t/test_civserver.py index 991dea41559..b822ddefdc9 100644 --- a/test/t/test_civserver.py +++ b/test/t/test_civserver.py @@ -2,7 +2,6 @@ class TestCivserver: - @pytest.mark.complete("civserver -") def test_1(self, completion): assert completion diff --git a/test/t/test_cksfv.py b/test/t/test_cksfv.py index d8a5c477105..b4df87676bb 100644 --- a/test/t/test_cksfv.py +++ b/test/t/test_cksfv.py @@ -2,7 +2,6 @@ class TestCksfv: - @pytest.mark.complete("cksfv -") def test_1(self, completion): assert completion diff --git a/test/t/test_cleanarch.py b/test/t/test_cleanarch.py index 9f3a7fd140d..95b268e2f2e 100644 --- a/test/t/test_cleanarch.py +++ b/test/t/test_cleanarch.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "PATH=/usr/lib/mailman/bin:$PATH", - ), -) +@pytest.mark.bashcomp(pre_cmds=("PATH=/usr/lib/mailman/bin:$PATH",)) class TestCleanarch: - @pytest.mark.complete("cleanarch -") def test_1(self, completion): assert completion diff --git a/test/t/test_clisp.py b/test/t/test_clisp.py index 8c317923717..3fcb25936b3 100644 --- a/test/t/test_clisp.py +++ b/test/t/test_clisp.py @@ -2,7 +2,6 @@ class TestClisp: - @pytest.mark.complete("clisp ") def test_1(self, completion): assert completion diff --git a/test/t/test_clone_member.py b/test/t/test_clone_member.py index 1ee003b482a..8f54298a1e7 100644 --- a/test/t/test_clone_member.py +++ b/test/t/test_clone_member.py @@ -2,7 +2,6 @@ class TestCloneMember: - @pytest.mark.complete("clone_member -") def test_1(self, completion): assert completion diff --git a/test/t/test_co.py b/test/t/test_co.py index f20f8294f73..0404b45f8b6 100644 --- a/test/t/test_co.py +++ b/test/t/test_co.py @@ -2,7 +2,6 @@ class TestCo: - @pytest.mark.complete("co ") def test_1(self, completion): assert completion diff --git a/test/t/test_compare.py b/test/t/test_compare.py index 8a6996a0693..172c8dabb12 100644 --- a/test/t/test_compare.py +++ b/test/t/test_compare.py @@ -2,7 +2,6 @@ class TestCompare: - @pytest.mark.complete("compare ") def test_1(self, completion): assert completion diff --git a/test/t/test_complete.py b/test/t/test_complete.py index 084f8f45fc3..036f954edcb 100644 --- a/test/t/test_complete.py +++ b/test/t/test_complete.py @@ -2,7 +2,6 @@ class TestComplete: - @pytest.mark.complete("complete -") def test_1(self, completion): assert completion diff --git a/test/t/test_composite.py b/test/t/test_composite.py index 5b58f2d7897..58f4e398882 100644 --- a/test/t/test_composite.py +++ b/test/t/test_composite.py @@ -2,7 +2,6 @@ class TestComposite: - @pytest.mark.complete("composite ") def test_1(self, completion): assert completion diff --git a/test/t/test_config_list.py b/test/t/test_config_list.py index cb344b6d609..d17fadc6b9e 100644 --- a/test/t/test_config_list.py +++ b/test/t/test_config_list.py @@ -2,7 +2,6 @@ class TestConfigList: - @pytest.mark.complete("config_list -") def test_1(self, completion): assert completion diff --git a/test/t/test_configure.py b/test/t/test_configure.py index 5c245e20e1d..17bc9d4869f 100644 --- a/test/t/test_configure.py +++ b/test/t/test_configure.py @@ -5,10 +5,9 @@ pre_cmds=( # Make sure our own ./configure is in PATH "PATH=$PWD/../..:$PATH", - ), + ) ) class TestConfigure: - @pytest.mark.complete("configure --") def test_1(self, completion): assert completion diff --git a/test/t/test_conjure.py b/test/t/test_conjure.py index e748a1ffd9e..3dcc0dbca89 100644 --- a/test/t/test_conjure.py +++ b/test/t/test_conjure.py @@ -2,7 +2,6 @@ class TestConjure: - @pytest.mark.complete("conjure ") def test_1(self, completion): assert completion diff --git a/test/t/test_convert.py b/test/t/test_convert.py index fff407e7f04..90dfb4776bf 100644 --- a/test/t/test_convert.py +++ b/test/t/test_convert.py @@ -2,7 +2,6 @@ class TestConvert: - @pytest.mark.complete("convert ") def test_1(self, completion): assert completion diff --git a/test/t/test_cowsay.py b/test/t/test_cowsay.py index 8b7da13ac44..2920d9ea9d9 100644 --- a/test/t/test_cowsay.py +++ b/test/t/test_cowsay.py @@ -2,7 +2,6 @@ class TestCowsay: - @pytest.mark.complete("cowsay ") def test_1(self, completion): assert completion diff --git a/test/t/test_cp.py b/test/t/test_cp.py index 93f41e5c33d..a25998fcee0 100644 --- a/test/t/test_cp.py +++ b/test/t/test_cp.py @@ -2,7 +2,6 @@ class TestCp: - @pytest.mark.complete("cp ") def test_1(self, completion): assert completion diff --git a/test/t/test_cpan2dist.py b/test/t/test_cpan2dist.py index 42473bc3325..13feae9e770 100644 --- a/test/t/test_cpan2dist.py +++ b/test/t/test_cpan2dist.py @@ -2,7 +2,6 @@ class TestCpan2dist: - @pytest.mark.complete("cpan2dist -") def test_1(self, completion): assert completion diff --git a/test/t/test_cpio.py b/test/t/test_cpio.py index fb2eedb51df..69bb5702961 100644 --- a/test/t/test_cpio.py +++ b/test/t/test_cpio.py @@ -4,13 +4,13 @@ class TestCpio: - @pytest.mark.complete("cpio --") def test_1(self, completion): assert completion @pytest.mark.complete("cpio -R ") def test_2(self, bash, completion): - users = sorted(assert_bash_exec( - bash, "compgen -A user", want_output=True).split()) + users = sorted( + assert_bash_exec(bash, "compgen -A user", want_output=True).split() + ) assert completion == users diff --git a/test/t/test_cplusplus.py b/test/t/test_cplusplus.py index 239c71103e9..a2dd3edefe9 100644 --- a/test/t/test_cplusplus.py +++ b/test/t/test_cplusplus.py @@ -3,7 +3,6 @@ @pytest.mark.bashcomp(cmd="c++") class TestCPlusPlus: - @pytest.mark.complete("c++ ") def test_1(self, completion): assert completion diff --git a/test/t/test_cppcheck.py b/test/t/test_cppcheck.py index 05cb630d635..d5e3af9ba7f 100644 --- a/test/t/test_cppcheck.py +++ b/test/t/test_cppcheck.py @@ -2,7 +2,6 @@ class TestCppcheck: - @pytest.mark.complete("cppcheck ") def test_1(self, completion): assert completion diff --git a/test/t/test_createdb.py b/test/t/test_createdb.py index 672196cc4e0..7e22643894e 100644 --- a/test/t/test_createdb.py +++ b/test/t/test_createdb.py @@ -4,7 +4,6 @@ class TestCreatedb: # --help can fail due to missing package dependencies, e.g. on Ubuntu 14 - @pytest.mark.complete("createdb -", - skipif="! createdb --help &>/dev/null") + @pytest.mark.complete("createdb -", skipif="! createdb --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_createuser.py b/test/t/test_createuser.py index d8e5a04e741..f25f10f783f 100644 --- a/test/t/test_createuser.py +++ b/test/t/test_createuser.py @@ -4,7 +4,8 @@ class TestCreateuser: # --help can fail due to missing package dependencies, e.g. on Ubuntu 14 - @pytest.mark.complete("createuser -", - skipif="! createuser --help &>/dev/null") + @pytest.mark.complete( + "createuser -", skipif="! createuser --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_crontab.py b/test/t/test_crontab.py index ca0e6038785..098fd9e04b0 100644 --- a/test/t/test_crontab.py +++ b/test/t/test_crontab.py @@ -2,7 +2,6 @@ class TestCrontab: - @pytest.mark.complete("crontab ") def test_1(self, completion): assert completion diff --git a/test/t/test_cryptsetup.py b/test/t/test_cryptsetup.py index b1c61c97758..235ac4fca0f 100644 --- a/test/t/test_cryptsetup.py +++ b/test/t/test_cryptsetup.py @@ -2,7 +2,6 @@ class TestCryptsetup: - @pytest.mark.complete("cryptsetup ") def test_1(self, completion): assert completion diff --git a/test/t/test_csplit.py b/test/t/test_csplit.py index 27fde525daa..54eab34c291 100644 --- a/test/t/test_csplit.py +++ b/test/t/test_csplit.py @@ -2,7 +2,6 @@ class TestCsplit: - @pytest.mark.complete("csplit ") def test_1(self, completion): assert completion diff --git a/test/t/test_curl.py b/test/t/test_curl.py index 9cdb2a623a3..324fba2a31a 100644 --- a/test/t/test_curl.py +++ b/test/t/test_curl.py @@ -2,7 +2,6 @@ class TestCurl: - @pytest.mark.complete("curl --h") def test_1(self, completion): assert completion diff --git a/test/t/test_cut.py b/test/t/test_cut.py index 08ed32de9a4..31fa636a04a 100644 --- a/test/t/test_cut.py +++ b/test/t/test_cut.py @@ -2,7 +2,6 @@ class TestCut: - @pytest.mark.complete("cut ") def test_1(self, completion): assert completion diff --git a/test/t/test_cvs.py b/test/t/test_cvs.py index 20ecfc77aea..825acbf5229 100644 --- a/test/t/test_cvs.py +++ b/test/t/test_cvs.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "HOME=$PWD/cvs", - ), -) +@pytest.mark.bashcomp(pre_cmds=("HOME=$PWD/cvs",)) class TestCvs: - @pytest.mark.complete("cvs ") def test_1(self, completion): assert completion diff --git a/test/t/test_cvsps.py b/test/t/test_cvsps.py index a42b87d5bb4..0a4da9bae5d 100644 --- a/test/t/test_cvsps.py +++ b/test/t/test_cvsps.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "HOME=$PWD/cvs", - ), -) +@pytest.mark.bashcomp(pre_cmds=("HOME=$PWD/cvs",)) class TestCvsps: - @pytest.mark.complete("cvsps -") def test_1(self, completion): assert completion diff --git a/test/t/test_date.py b/test/t/test_date.py index 8d3152fc4af..8df574e987c 100644 --- a/test/t/test_date.py +++ b/test/t/test_date.py @@ -2,7 +2,6 @@ class TestDate: - @pytest.mark.complete("date ") def test_1(self, completion): assert completion diff --git a/test/t/test_dcop.py b/test/t/test_dcop.py index c184159400f..669725e2879 100644 --- a/test/t/test_dcop.py +++ b/test/t/test_dcop.py @@ -4,7 +4,6 @@ class TestDcop: - @pytest.mark.complete("dcop ") def test_1(self, completion): try: diff --git a/test/t/test_dd.py b/test/t/test_dd.py index 0cc75eb71fb..616f4d4aff9 100644 --- a/test/t/test_dd.py +++ b/test/t/test_dd.py @@ -2,7 +2,6 @@ class TestDd: - @pytest.mark.complete("dd --") def test_1(self, completion): assert completion diff --git a/test/t/test_declare.py b/test/t/test_declare.py index f09b51b241a..b17affc2fb1 100644 --- a/test/t/test_declare.py +++ b/test/t/test_declare.py @@ -2,7 +2,6 @@ class TestDeclare: - @pytest.mark.complete("declare -") def test_1(self, completion): assert completion diff --git a/test/t/test_deja_dup.py b/test/t/test_deja_dup.py index 0fa3b25eeb0..1da29e9923a 100644 --- a/test/t/test_deja_dup.py +++ b/test/t/test_deja_dup.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="deja-dup", -) +@pytest.mark.bashcomp(cmd="deja-dup") class TestDejaDup: - @pytest.mark.complete("deja-dup -") def test_1(self, completion): assert completion diff --git a/test/t/test_desktop_file_validate.py b/test/t/test_desktop_file_validate.py index 018766f01bc..e007a956649 100644 --- a/test/t/test_desktop_file_validate.py +++ b/test/t/test_desktop_file_validate.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="desktop-file-validate", -) +@pytest.mark.bashcomp(cmd="desktop-file-validate") class TestDesktopFileValidate: - @pytest.mark.complete("desktop-file-validate ") def test_1(self, completion): assert completion diff --git a/test/t/test_df.py b/test/t/test_df.py index 53be7f89de3..247311cc46f 100644 --- a/test/t/test_df.py +++ b/test/t/test_df.py @@ -2,7 +2,6 @@ class TestDf: - @pytest.mark.complete("df ") def test_1(self, completion): assert completion diff --git a/test/t/test_dfutool.py b/test/t/test_dfutool.py index b1a0f8d70a2..7b450bdea29 100644 --- a/test/t/test_dfutool.py +++ b/test/t/test_dfutool.py @@ -2,7 +2,6 @@ class TestDfutool: - @pytest.mark.complete("dfutool ") def test_1(self, completion): assert completion diff --git a/test/t/test_dhclient.py b/test/t/test_dhclient.py index 3dcceead67a..fdfbd4732d5 100644 --- a/test/t/test_dhclient.py +++ b/test/t/test_dhclient.py @@ -2,7 +2,6 @@ class TestDhclient: - @pytest.mark.complete("dhclient -") def test_1(self, completion): assert completion diff --git a/test/t/test_dict.py b/test/t/test_dict.py index d635be36d8a..65f6b129747 100644 --- a/test/t/test_dict.py +++ b/test/t/test_dict.py @@ -2,7 +2,6 @@ class TestDict: - @pytest.mark.complete("dict -") def test_1(self, completion): assert completion diff --git a/test/t/test_diff.py b/test/t/test_diff.py index 478a7b6fa32..25157bd9d90 100644 --- a/test/t/test_diff.py +++ b/test/t/test_diff.py @@ -2,7 +2,6 @@ class TestDiff: - @pytest.mark.complete("diff --") def test_1(self, completion): assert completion diff --git a/test/t/test_dir.py b/test/t/test_dir.py index ab81308facd..3026d502734 100644 --- a/test/t/test_dir.py +++ b/test/t/test_dir.py @@ -2,7 +2,6 @@ class TestDir: - @pytest.mark.complete("dir ") def test_1(self, completion): assert completion diff --git a/test/t/test_display.py b/test/t/test_display.py index 422f95e6548..9f5c1004af6 100644 --- a/test/t/test_display.py +++ b/test/t/test_display.py @@ -2,7 +2,6 @@ class TestDisplay: - @pytest.mark.complete("display ") def test_1(self, completion): assert completion diff --git a/test/t/test_dmesg.py b/test/t/test_dmesg.py index e09e956df08..4416fe1c2f9 100644 --- a/test/t/test_dmesg.py +++ b/test/t/test_dmesg.py @@ -2,7 +2,6 @@ class TestDmesg: - @pytest.mark.complete("dmesg -") def test_1(self, completion): assert completion diff --git a/test/t/test_dnssec_keygen.py b/test/t/test_dnssec_keygen.py index c60a3a3a952..d52e3af0ee0 100644 --- a/test/t/test_dnssec_keygen.py +++ b/test/t/test_dnssec_keygen.py @@ -2,13 +2,9 @@ @pytest.mark.bashcomp( - cmd="dnssec-keygen", - pre_cmds=( - "PATH=$PATH:$PWD/dnssec-keygen", - ), + cmd="dnssec-keygen", pre_cmds=("PATH=$PATH:$PWD/dnssec-keygen",) ) class TestDnssecKeygen: - @pytest.mark.complete("dnssec-keygen -") def test_1(self, completion): assert completion @@ -38,8 +34,9 @@ def test_4(self, completion): def test_5(self, completion): assert not completion - @pytest.mark.complete("dnssec-keygen -a ", - env=dict(PATH="$PWD/dnssec-keygen:$PATH")) + @pytest.mark.complete( + "dnssec-keygen -a ", env=dict(PATH="$PWD/dnssec-keygen:$PATH") + ) def test_6(self, completion): assert completion == sorted( "RSA RSAMD5 DSA RSASHA1 NSEC3RSASHA1 NSEC3DSA " @@ -47,32 +44,37 @@ def test_6(self, completion): "ECDSAP256SHA256 ECDSAP384SHA384 " "ED25519 ED448 DH " "HMAC-MD5 HMAC-SHA1 HMAC-SHA224 HMAC-SHA256 " - "HMAC-SHA384 HMAC-SHA512" - .split()) + "HMAC-SHA384 HMAC-SHA512".split() + ) - @pytest.mark.complete("dnssec-keygen -n ", - env=dict(PATH="$PWD/dnssec-keygen:$PATH")) + @pytest.mark.complete( + "dnssec-keygen -n ", env=dict(PATH="$PWD/dnssec-keygen:$PATH") + ) def test_7(self, completion): assert completion == sorted("ZONE HOST ENTITY USER OTHER".split()) - @pytest.mark.complete("dnssec-keygen -f ", - env=dict(PATH="$PWD/dnssec-keygen:$PATH")) + @pytest.mark.complete( + "dnssec-keygen -f ", env=dict(PATH="$PWD/dnssec-keygen:$PATH") + ) def test_8(self, completion): assert completion == sorted("KSK REVOKE".split()) - @pytest.mark.complete("dnssec-keygen -T ", - env=dict(PATH="$PWD/dnssec-keygen:$PATH")) + @pytest.mark.complete( + "dnssec-keygen -T ", env=dict(PATH="$PWD/dnssec-keygen:$PATH") + ) def test_9(self, completion): assert completion == sorted("DNSKEY KEY".split()) - @pytest.mark.complete("dnssec-keygen -t ", - env=dict(PATH="$PWD/dnssec-keygen:$PATH")) + @pytest.mark.complete( + "dnssec-keygen -t ", env=dict(PATH="$PWD/dnssec-keygen:$PATH") + ) def test_10(self, completion): assert completion == sorted( - "AUTHCONF NOAUTHCONF NOAUTH NOCONF".split()) + "AUTHCONF NOAUTHCONF NOAUTH NOCONF".split() + ) - @pytest.mark.complete("dnssec-keygen -m ", - env=dict(PATH="$PWD/dnssec-keygen:$PATH")) + @pytest.mark.complete( + "dnssec-keygen -m ", env=dict(PATH="$PWD/dnssec-keygen:$PATH") + ) def test_11(self, completion): - assert completion == sorted( - "usage trace record size mctx".split()) + assert completion == sorted("usage trace record size mctx".split()) diff --git a/test/t/test_dnsspoof.py b/test/t/test_dnsspoof.py index 39725df528b..fae6c430da6 100644 --- a/test/t/test_dnsspoof.py +++ b/test/t/test_dnsspoof.py @@ -2,7 +2,6 @@ class TestDnsspoof: - @pytest.mark.complete("dnsspoof -") def test_1(self, completion): assert completion diff --git a/test/t/test_dot.py b/test/t/test_dot.py index c3964718eee..a4aa6742368 100644 --- a/test/t/test_dot.py +++ b/test/t/test_dot.py @@ -2,7 +2,6 @@ class TestDot: - @pytest.mark.complete("dot ") def test_1(self, completion): assert completion diff --git a/test/t/test_dpkg.py b/test/t/test_dpkg.py index feca081ffbb..e609ee86214 100644 --- a/test/t/test_dpkg.py +++ b/test/t/test_dpkg.py @@ -2,13 +2,13 @@ class TestDpkg: - @pytest.mark.complete("dpkg --c") def test_1(self, completion): assert completion - @pytest.mark.complete("dpkg -L ", - skipif='test -z "$(dpkg -l 2>/dev/null)"') + @pytest.mark.complete( + "dpkg -L ", skipif='test -z "$(dpkg -l 2>/dev/null)"' + ) def test_2(self, completion): assert completion diff --git a/test/t/test_dpkg_deb.py b/test/t/test_dpkg_deb.py index 1d156793342..4bd7368bed2 100644 --- a/test/t/test_dpkg_deb.py +++ b/test/t/test_dpkg_deb.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="dpkg-deb", -) +@pytest.mark.bashcomp(cmd="dpkg-deb") class TestDpkgDeb: - @pytest.mark.complete("dpkg-deb --c") def test_1(self, completion): assert completion diff --git a/test/t/test_dpkg_reconfigure.py b/test/t/test_dpkg_reconfigure.py index 15108ea93f5..46347b3f11e 100644 --- a/test/t/test_dpkg_reconfigure.py +++ b/test/t/test_dpkg_reconfigure.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="dpkg-reconfigure", -) +@pytest.mark.bashcomp(cmd="dpkg-reconfigure") class TestDpkgReconfigure: - @pytest.mark.complete("dpkg-reconfigure --") def test_1(self, completion): assert completion diff --git a/test/t/test_dpkg_source.py b/test/t/test_dpkg_source.py index a4652b5acfb..f2d5f19b13c 100644 --- a/test/t/test_dpkg_source.py +++ b/test/t/test_dpkg_source.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="dpkg-source", -) +@pytest.mark.bashcomp(cmd="dpkg-source") class TestDpkgSource: - @pytest.mark.complete("dpkg-source -") def test_1(self, completion): assert completion diff --git a/test/t/test_dropdb.py b/test/t/test_dropdb.py index 5b36b56ec9a..7e0b7929d57 100644 --- a/test/t/test_dropdb.py +++ b/test/t/test_dropdb.py @@ -4,7 +4,6 @@ class TestDropdb: # --help can fail due to missing package dependencies, e.g. on Ubuntu 14 - @pytest.mark.complete("dropdb -", - skipif="! dropdb --help &>/dev/null") + @pytest.mark.complete("dropdb -", skipif="! dropdb --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_dropuser.py b/test/t/test_dropuser.py index 1c4e152eb39..83a99d949a2 100644 --- a/test/t/test_dropuser.py +++ b/test/t/test_dropuser.py @@ -2,7 +2,6 @@ class TestDropuser: - @pytest.mark.complete("dropuser ") def test_1(self, completion): assert completion diff --git a/test/t/test_dselect.py b/test/t/test_dselect.py index e9cae2e55ea..3145cc405f7 100644 --- a/test/t/test_dselect.py +++ b/test/t/test_dselect.py @@ -2,7 +2,6 @@ class TestDselect: - @pytest.mark.complete("dselect ") def test_1(self, completion): assert completion diff --git a/test/t/test_dsniff.py b/test/t/test_dsniff.py index 793bc08cf43..978c4365556 100644 --- a/test/t/test_dsniff.py +++ b/test/t/test_dsniff.py @@ -2,7 +2,6 @@ class TestDsniff: - @pytest.mark.complete("dsniff -") def test_1(self, completion): assert completion diff --git a/test/t/test_du.py b/test/t/test_du.py index d026840a2f7..c014b069694 100644 --- a/test/t/test_du.py +++ b/test/t/test_du.py @@ -2,7 +2,6 @@ class TestDu: - @pytest.mark.complete("du ") def test_1(self, completion): assert completion diff --git a/test/t/test_dumpdb.py b/test/t/test_dumpdb.py index 7c21fca852d..50776827bfa 100644 --- a/test/t/test_dumpdb.py +++ b/test/t/test_dumpdb.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "PATH=/usr/lib/mailman/bin:$PATH", - ), -) +@pytest.mark.bashcomp(pre_cmds=("PATH=/usr/lib/mailman/bin:$PATH",)) class TestDumpdb: - @pytest.mark.complete("dumpdb ") def test_1(self, completion): assert completion diff --git a/test/t/test_dumpe2fs.py b/test/t/test_dumpe2fs.py index b5ca6a25075..fa7590e6301 100644 --- a/test/t/test_dumpe2fs.py +++ b/test/t/test_dumpe2fs.py @@ -2,7 +2,6 @@ class TestDumpe2fs: - @pytest.mark.complete("dumpe2fs ") def test_1(self, completion): assert completion diff --git a/test/t/test_e2freefrag.py b/test/t/test_e2freefrag.py index 0201d96e442..6685382ded2 100644 --- a/test/t/test_e2freefrag.py +++ b/test/t/test_e2freefrag.py @@ -2,7 +2,6 @@ class TestE2freefrag: - @pytest.mark.complete("e2freefrag ") def test_1(self, completion): assert completion diff --git a/test/t/test_e2label.py b/test/t/test_e2label.py index 788ee74be73..ca436a65fb2 100644 --- a/test/t/test_e2label.py +++ b/test/t/test_e2label.py @@ -2,7 +2,6 @@ class TestE2label: - @pytest.mark.complete("e2label ") def test_1(self, completion): assert completion diff --git a/test/t/test_ebtables.py b/test/t/test_ebtables.py index 1ea89d3e8e6..bcca3cbe87e 100644 --- a/test/t/test_ebtables.py +++ b/test/t/test_ebtables.py @@ -2,7 +2,6 @@ class TestEbtables: - @pytest.mark.complete("ebtables -") def test_1(self, completion): assert completion diff --git a/test/t/test_ecryptfs_migrate_home.py b/test/t/test_ecryptfs_migrate_home.py index 08f407e7856..fd49ca8bcb8 100644 --- a/test/t/test_ecryptfs_migrate_home.py +++ b/test/t/test_ecryptfs_migrate_home.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="ecryptfs-migrate-home", -) +@pytest.mark.bashcomp(cmd="ecryptfs-migrate-home") class TestEcryptfsMigrateHome: - @pytest.mark.complete("ecryptfs-migrate-home ") def test_1(self, completion): assert completion diff --git a/test/t/test_eject.py b/test/t/test_eject.py index e7c65a4c78d..037ea98e2ac 100644 --- a/test/t/test_eject.py +++ b/test/t/test_eject.py @@ -2,7 +2,6 @@ class TestEject: - @pytest.mark.complete("eject -") def test_1(self, completion): assert completion diff --git a/test/t/test_enscript.py b/test/t/test_enscript.py index d5f6d1e0521..2e4ff51a4e6 100644 --- a/test/t/test_enscript.py +++ b/test/t/test_enscript.py @@ -2,7 +2,6 @@ class TestEnscript: - @pytest.mark.complete("enscript --") def test_1(self, completion): assert completion diff --git a/test/t/test_env.py b/test/t/test_env.py index 90663483ece..57ed9769b65 100644 --- a/test/t/test_env.py +++ b/test/t/test_env.py @@ -2,8 +2,6 @@ class TestEnv: - - @pytest.mark.complete("env --", - skipif="! env --help &>/dev/null") + @pytest.mark.complete("env --", skipif="! env --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_eog.py b/test/t/test_eog.py index cb127340742..c095934fec3 100644 --- a/test/t/test_eog.py +++ b/test/t/test_eog.py @@ -2,7 +2,6 @@ class TestEog: - @pytest.mark.complete("eog ") def test_1(self, completion): assert completion diff --git a/test/t/test_ether_wake.py b/test/t/test_ether_wake.py index 57bde949fd9..b9dac0b44ba 100644 --- a/test/t/test_ether_wake.py +++ b/test/t/test_ether_wake.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="ether-wake", -) +@pytest.mark.bashcomp(cmd="ether-wake") class TestEtherWake: - @pytest.mark.complete("ether-wake ") def test_1(self, completion): assert completion diff --git a/test/t/test_etherwake.py b/test/t/test_etherwake.py index ac613d35eee..b444b43385c 100644 --- a/test/t/test_etherwake.py +++ b/test/t/test_etherwake.py @@ -2,7 +2,6 @@ class TestEtherwake: - @pytest.mark.complete("etherwake -") def test_1(self, completion): assert completion diff --git a/test/t/test_evince.py b/test/t/test_evince.py index eec8922e838..0dc44f38efe 100644 --- a/test/t/test_evince.py +++ b/test/t/test_evince.py @@ -2,7 +2,6 @@ class TestEvince: - @pytest.mark.complete("evince ", cwd="evince") def test_1(self, completion): # .txt should not be here @@ -15,4 +14,5 @@ def test_1(self, completion): ".pdf.bz2 .pdf.BZ2 .PDF.bz2 .PDF.BZ2 .pdf.gz .pdf.GZ .PDF.gz " ".PDF.GZ .pgm .PGM .png .PNG .pnm .PNM .ppm .PPM .ps .PS " ".ps.bz2 .ps.BZ2 .PS.bz2 .PS.BZ2 .ps.gz .ps.GZ .PS.gz .PS.GZ " - ".tga .TGA .tif .TIF .tiff .TIFF .xpm .XPM .xwd .XWD".split()) + ".tga .TGA .tif .TIF .tiff .TIFF .xpm .XPM .xwd .XWD".split() + ) diff --git a/test/t/test_expand.py b/test/t/test_expand.py index 5099480e7bc..004c018b6b4 100644 --- a/test/t/test_expand.py +++ b/test/t/test_expand.py @@ -2,8 +2,6 @@ class TestExpand: - - @pytest.mark.complete("expand --", - skipif="! expand --help &>/dev/null") + @pytest.mark.complete("expand --", skipif="! expand --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_explodepkg.py b/test/t/test_explodepkg.py index 79d7e82bf2d..29463dfdf1b 100644 --- a/test/t/test_explodepkg.py +++ b/test/t/test_explodepkg.py @@ -5,13 +5,14 @@ class TestExplodepkg: - @pytest.mark.complete("explodepkg ", cwd="slackware/home") def test_1(self, completion): expected = sorted( - x for x in os.listdir("slackware/home") + x + for x in os.listdir("slackware/home") if os.path.isdir("./%s" % x) - or (os.path.isfile("./%s" % x) - and fnmatch.fnmatch(x, "*.t[bglx]z")) + or ( + os.path.isfile("./%s" % x) and fnmatch.fnmatch(x, "*.t[bglx]z") + ) ) assert completion == expected diff --git a/test/t/test_export.py b/test/t/test_export.py index 22469eb5a11..59dfdb2ee11 100644 --- a/test/t/test_export.py +++ b/test/t/test_export.py @@ -2,7 +2,6 @@ class TestExport: - @pytest.mark.complete("export BASH") def test_1(self, completion): assert completion diff --git a/test/t/test_faillog.py b/test/t/test_faillog.py index d71a2d6c75e..d9799d574a7 100644 --- a/test/t/test_faillog.py +++ b/test/t/test_faillog.py @@ -2,7 +2,6 @@ class TestFaillog: - @pytest.mark.complete("faillog -") def test_1(self, completion): assert completion diff --git a/test/t/test_fbgs.py b/test/t/test_fbgs.py index fc949d2dec3..53ff74128a9 100644 --- a/test/t/test_fbgs.py +++ b/test/t/test_fbgs.py @@ -2,7 +2,6 @@ class TestFbgs: - @pytest.mark.complete("fbgs ") def test_1(self, completion): assert completion diff --git a/test/t/test_fbi.py b/test/t/test_fbi.py index 14c3c86bc34..e27fef51626 100644 --- a/test/t/test_fbi.py +++ b/test/t/test_fbi.py @@ -2,7 +2,6 @@ class TestFbi: - @pytest.mark.complete("fbi ") def test_1(self, completion): assert completion diff --git a/test/t/test_feh.py b/test/t/test_feh.py index 16eeb0d31f8..1802e25f2bd 100644 --- a/test/t/test_feh.py +++ b/test/t/test_feh.py @@ -2,13 +2,13 @@ class TestFeh: - @pytest.mark.complete("feh ") def test_1(self, completion): assert completion - @pytest.mark.complete("feh --lis", - skipif="feh --help 2>&1 | grep -qF 'man feh'") + @pytest.mark.complete( + "feh --lis", skipif="feh --help 2>&1 | grep -qF 'man feh'" + ) def test_2(self, completion): assert completion diff --git a/test/t/test_file.py b/test/t/test_file.py index 60ad77dda63..cfd2c100327 100644 --- a/test/t/test_file.py +++ b/test/t/test_file.py @@ -2,7 +2,6 @@ class TestFile: - @pytest.mark.complete("file ") def test_1(self, completion): assert completion diff --git a/test/t/test_file_roller.py b/test/t/test_file_roller.py index bff61e09bb7..80a1bbc7b32 100644 --- a/test/t/test_file_roller.py +++ b/test/t/test_file_roller.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="file-roller", -) +@pytest.mark.bashcomp(cmd="file-roller") class TestFileRoller: - @pytest.mark.complete("file-roller ") def test_1(self, completion): assert completion diff --git a/test/t/test_filefrag.py b/test/t/test_filefrag.py index a4569d370f4..860b2512462 100644 --- a/test/t/test_filefrag.py +++ b/test/t/test_filefrag.py @@ -2,7 +2,6 @@ class TestFilefrag: - @pytest.mark.complete("filefrag ") def test_1(self, completion): assert completion diff --git a/test/t/test_filesnarf.py b/test/t/test_filesnarf.py index 1dd55b820ac..cd399d4aed4 100644 --- a/test/t/test_filesnarf.py +++ b/test/t/test_filesnarf.py @@ -2,7 +2,6 @@ class TestFilesnarf: - @pytest.mark.complete("filesnarf -") def test_1(self, completion): assert completion diff --git a/test/t/test_find.py b/test/t/test_find.py index 360c8e39a83..a94e0e0d5ec 100644 --- a/test/t/test_find.py +++ b/test/t/test_find.py @@ -2,7 +2,6 @@ class TestFind: - @pytest.mark.complete("find ") def test_1(self, completion): assert completion diff --git a/test/t/test_find_member.py b/test/t/test_find_member.py index 334608ac187..bfcf58874ca 100644 --- a/test/t/test_find_member.py +++ b/test/t/test_find_member.py @@ -2,7 +2,6 @@ class TestFindMember: - @pytest.mark.complete("find_member -") def test_1(self, completion): assert completion diff --git a/test/t/test_finger.py b/test/t/test_finger.py index 9c567324f2f..e3cdfacd31b 100644 --- a/test/t/test_finger.py +++ b/test/t/test_finger.py @@ -4,9 +4,11 @@ class TestFinger: - @pytest.mark.complete("finger ") def test_1(self, bash, completion): - users_at = sorted(assert_bash_exec( - bash, "compgen -A user -S @", want_output=True).split()) + users_at = sorted( + assert_bash_exec( + bash, "compgen -A user -S @", want_output=True + ).split() + ) assert completion == users_at diff --git a/test/t/test_fio.py b/test/t/test_fio.py index e1b493c6b6c..8dd6f789fb1 100644 --- a/test/t/test_fio.py +++ b/test/t/test_fio.py @@ -2,7 +2,6 @@ class TestFio: - @pytest.mark.complete("fio ") def test_1(self, completion): assert completion diff --git a/test/t/test_firefox.py b/test/t/test_firefox.py index de4a2b2093a..cbba2c6c0f8 100644 --- a/test/t/test_firefox.py +++ b/test/t/test_firefox.py @@ -2,7 +2,6 @@ class TestFirefox: - @pytest.mark.complete("firefox ") def test_1(self, completion): assert completion diff --git a/test/t/test_flake8.py b/test/t/test_flake8.py index 1a18dbd404f..9922fb8526b 100644 --- a/test/t/test_flake8.py +++ b/test/t/test_flake8.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - skipif="! flake8 --help &>/dev/null", -) +@pytest.mark.bashcomp(skipif="! flake8 --help &>/dev/null") class TestFlake8: - @pytest.mark.complete("flake8 ") def test_1(self, completion): assert completion diff --git a/test/t/test_fmt.py b/test/t/test_fmt.py index ceed737b50b..dc3473ba406 100644 --- a/test/t/test_fmt.py +++ b/test/t/test_fmt.py @@ -2,8 +2,6 @@ class TestFmt: - - @pytest.mark.complete("fmt -", - skipif="! fmt --help &>/dev/null") + @pytest.mark.complete("fmt -", skipif="! fmt --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_fold.py b/test/t/test_fold.py index dc0d924b7af..9a8fd2aa20b 100644 --- a/test/t/test_fold.py +++ b/test/t/test_fold.py @@ -2,8 +2,6 @@ class TestFold: - - @pytest.mark.complete("fold --", - skipif="! fold --help &>/dev/null") + @pytest.mark.complete("fold --", skipif="! fold --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_freebsd_update.py b/test/t/test_freebsd_update.py index 51a26ba7a29..911a49a5a8a 100644 --- a/test/t/test_freebsd_update.py +++ b/test/t/test_freebsd_update.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="freebsd-update", -) +@pytest.mark.bashcomp(cmd="freebsd-update") class TestFreebsdUpdate: - @pytest.mark.complete("freebsd-update ") def test_1(self, completion): assert completion diff --git a/test/t/test_freeciv.py b/test/t/test_freeciv.py index 81192b11927..1027e43cc69 100644 --- a/test/t/test_freeciv.py +++ b/test/t/test_freeciv.py @@ -2,7 +2,6 @@ class TestFreeciv: - @pytest.mark.complete("freeciv -") def test_1(self, completion): assert completion diff --git a/test/t/test_freeciv_server.py b/test/t/test_freeciv_server.py index 8bbd39d44c8..5546a5e951a 100644 --- a/test/t/test_freeciv_server.py +++ b/test/t/test_freeciv_server.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="freeciv-server", -) +@pytest.mark.bashcomp(cmd="freeciv-server") class TestFreecivServer: - @pytest.mark.complete("freeciv-server -") def test_1(self, completion): assert completion diff --git a/test/t/test_function.py b/test/t/test_function.py index 2bc41d59af1..4401f0225bf 100644 --- a/test/t/test_function.py +++ b/test/t/test_function.py @@ -2,7 +2,6 @@ class TestFunction: - @pytest.mark.complete("function _parse_") def test_1(self, completion): assert completion diff --git a/test/t/test_fusermount.py b/test/t/test_fusermount.py index 25a71d0ecb9..3781586dd56 100644 --- a/test/t/test_fusermount.py +++ b/test/t/test_fusermount.py @@ -2,7 +2,6 @@ class TestFusermount: - @pytest.mark.complete("fusermount ") def test_1(self, completion): assert completion diff --git a/test/t/test_g4.py b/test/t/test_g4.py index 330d2e8bbf6..739c77dbddb 100644 --- a/test/t/test_g4.py +++ b/test/t/test_g4.py @@ -2,7 +2,6 @@ class TestG4: - @pytest.mark.complete("g4 ") def test_1(self, completion): assert completion diff --git a/test/t/test_g77.py b/test/t/test_g77.py index 08518469f07..45da6244f28 100644 --- a/test/t/test_g77.py +++ b/test/t/test_g77.py @@ -2,7 +2,6 @@ class TestG77: - @pytest.mark.complete("g77 ") def test_1(self, completion): assert completion diff --git a/test/t/test_gcc.py b/test/t/test_gcc.py index b6099444271..67f4ee579d9 100644 --- a/test/t/test_gcc.py +++ b/test/t/test_gcc.py @@ -2,7 +2,6 @@ class TestGcc: - @pytest.mark.complete("gcc ") def test_1(self, completion): assert completion diff --git a/test/t/test_gcj.py b/test/t/test_gcj.py index c9438291a02..17e2f4457fc 100644 --- a/test/t/test_gcj.py +++ b/test/t/test_gcj.py @@ -2,7 +2,6 @@ class TestGcj: - @pytest.mark.complete("gcj ") def test_1(self, completion): assert completion diff --git a/test/t/test_gcl.py b/test/t/test_gcl.py index ba2ba1fe8f5..f1e7a5ffb4b 100644 --- a/test/t/test_gcl.py +++ b/test/t/test_gcl.py @@ -2,7 +2,6 @@ class TestGcl: - @pytest.mark.complete("gcl ") def test_1(self, completion): assert completion diff --git a/test/t/test_gdb.py b/test/t/test_gdb.py index 3627fb8cc34..af3b8bab7e3 100644 --- a/test/t/test_gdb.py +++ b/test/t/test_gdb.py @@ -2,7 +2,6 @@ class TestGdb: - @pytest.mark.complete("gdb - ") def test_1(self, completion): assert completion diff --git a/test/t/test_genaliases.py b/test/t/test_genaliases.py index 9ace72aca41..e2f24d65ffc 100644 --- a/test/t/test_genaliases.py +++ b/test/t/test_genaliases.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "PATH=/usr/lib/mailman/bin:$PATH", - ), -) +@pytest.mark.bashcomp(pre_cmds=("PATH=/usr/lib/mailman/bin:$PATH",)) class TestGenaliases: - @pytest.mark.complete("genaliases -") def test_1(self, completion): assert completion diff --git a/test/t/test_gendiff.py b/test/t/test_gendiff.py index 0aec0459294..0e2ab4c3e33 100644 --- a/test/t/test_gendiff.py +++ b/test/t/test_gendiff.py @@ -2,7 +2,6 @@ class TestGendiff: - @pytest.mark.complete("gendiff ") def test_1(self, completion): assert completion diff --git a/test/t/test_genisoimage.py b/test/t/test_genisoimage.py index 2a2ed4997c2..ba16cea2bc0 100644 --- a/test/t/test_genisoimage.py +++ b/test/t/test_genisoimage.py @@ -2,7 +2,6 @@ class TestGenisoimage: - @pytest.mark.complete("genisoimage ") def test_1(self, completion): assert completion diff --git a/test/t/test_geoiplookup.py b/test/t/test_geoiplookup.py index a2e72b813cf..d114d55f074 100644 --- a/test/t/test_geoiplookup.py +++ b/test/t/test_geoiplookup.py @@ -2,7 +2,6 @@ class TestGeoiplookup: - @pytest.mark.complete("geoiplookup -") def test_1(self, completion): assert completion diff --git a/test/t/test_getconf.py b/test/t/test_getconf.py index 88165eaf72a..6f9192d2517 100644 --- a/test/t/test_getconf.py +++ b/test/t/test_getconf.py @@ -2,7 +2,6 @@ class TestGetconf: - @pytest.mark.complete("getconf P") def test_1(self, completion): assert completion diff --git a/test/t/test_getent.py b/test/t/test_getent.py index 2ff6542e8c9..fa84880c7cf 100644 --- a/test/t/test_getent.py +++ b/test/t/test_getent.py @@ -2,7 +2,6 @@ class TestGetent: - @pytest.mark.complete("getent ") def test_1(self, completion): assert completion diff --git a/test/t/test_gkrellm.py b/test/t/test_gkrellm.py index b3189818cda..8ab4b5a717e 100644 --- a/test/t/test_gkrellm.py +++ b/test/t/test_gkrellm.py @@ -5,7 +5,6 @@ @pytest.mark.xfail(not os.environ.get("DISPLAY"), reason="X display required") class TestGkrellm: - @pytest.mark.complete("gkrellm -") def test_1(self, completion): assert completion diff --git a/test/t/test_gm.py b/test/t/test_gm.py index bd631dd936d..82d16702c56 100644 --- a/test/t/test_gm.py +++ b/test/t/test_gm.py @@ -2,7 +2,6 @@ class TestGm: - @pytest.mark.complete("gm ") def test_1(self, completion): assert completion diff --git a/test/t/test_gmplayer.py b/test/t/test_gmplayer.py index 2603d3cc692..211ef51560d 100644 --- a/test/t/test_gmplayer.py +++ b/test/t/test_gmplayer.py @@ -2,7 +2,6 @@ class TestGmplayer: - @pytest.mark.complete("gmplayer ") def test_1(self, completion): assert completion diff --git a/test/t/test_gnatmake.py b/test/t/test_gnatmake.py index 104ba703652..c9f5609fa4a 100644 --- a/test/t/test_gnatmake.py +++ b/test/t/test_gnatmake.py @@ -2,7 +2,6 @@ class TestGnatmake: - @pytest.mark.complete("gnatmake ") def test_1(self, completion): assert completion diff --git a/test/t/test_gnokii.py b/test/t/test_gnokii.py index 1f1c98a7f6f..106005f9349 100644 --- a/test/t/test_gnokii.py +++ b/test/t/test_gnokii.py @@ -2,7 +2,6 @@ class TestGnokii: - @pytest.mark.complete("gnokii ") def test_1(self, completion): assert completion diff --git a/test/t/test_gnome_mplayer.py b/test/t/test_gnome_mplayer.py index bffbed20e6e..5ee952c10db 100644 --- a/test/t/test_gnome_mplayer.py +++ b/test/t/test_gnome_mplayer.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="gnome-mplayer", -) +@pytest.mark.bashcomp(cmd="gnome-mplayer") class TestGnomeMplayer: - @pytest.mark.complete("gnome-mplayer ") def test_1(self, completion): assert completion diff --git a/test/t/test_gnome_screenshot.py b/test/t/test_gnome_screenshot.py index 0448a0ec47e..476f57f14e0 100644 --- a/test/t/test_gnome_screenshot.py +++ b/test/t/test_gnome_screenshot.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="gnome-screenshot", -) +@pytest.mark.bashcomp(cmd="gnome-screenshot") class TestGnomeScreenshot: - @pytest.mark.complete("gnome-screenshot --help") def test_1(self, completion): assert completion diff --git a/test/t/test_gpasswd.py b/test/t/test_gpasswd.py index fdada2e96bb..43826a58052 100644 --- a/test/t/test_gpasswd.py +++ b/test/t/test_gpasswd.py @@ -2,7 +2,6 @@ class TestGpasswd: - @pytest.mark.complete("gpasswd ") def test_1(self, completion): assert completion diff --git a/test/t/test_gpc.py b/test/t/test_gpc.py index ccf67355c02..9903ef45105 100644 --- a/test/t/test_gpc.py +++ b/test/t/test_gpc.py @@ -2,7 +2,6 @@ class TestGpc: - @pytest.mark.complete("gpc ") def test_1(self, completion): assert completion diff --git a/test/t/test_gperf.py b/test/t/test_gperf.py index f6f5f5970d5..f8267bf7396 100644 --- a/test/t/test_gperf.py +++ b/test/t/test_gperf.py @@ -2,7 +2,6 @@ class TestGperf: - @pytest.mark.complete("gperf --") def test_1(self, completion): assert completion diff --git a/test/t/test_gpg.py b/test/t/test_gpg.py index bee9047397c..8ead5e9a11c 100644 --- a/test/t/test_gpg.py +++ b/test/t/test_gpg.py @@ -2,7 +2,6 @@ class TestGpg: - @pytest.mark.complete("gpg ") def test_1(self, completion): assert completion diff --git a/test/t/test_gpg2.py b/test/t/test_gpg2.py index bddd27402c2..6a7ff33300d 100644 --- a/test/t/test_gpg2.py +++ b/test/t/test_gpg2.py @@ -2,7 +2,6 @@ class TestGpg2: - @pytest.mark.complete("gpg2 --h") def test_1(self, completion): assert completion diff --git a/test/t/test_gpgv.py b/test/t/test_gpgv.py index 29a3dc2287a..05feb71f3d8 100644 --- a/test/t/test_gpgv.py +++ b/test/t/test_gpgv.py @@ -2,7 +2,6 @@ class TestGpgv: - @pytest.mark.complete("gpgv ") def test_1(self, completion): assert completion diff --git a/test/t/test_gphoto2.py b/test/t/test_gphoto2.py index 9b96923b15d..830e6f6fff1 100644 --- a/test/t/test_gphoto2.py +++ b/test/t/test_gphoto2.py @@ -2,7 +2,6 @@ class TestGphoto2: - @pytest.mark.complete("gphoto2 --") def test_1(self, completion): assert completion diff --git a/test/t/test_gplusplus.py b/test/t/test_gplusplus.py index c2ab0d983dd..eeeb1bff8e2 100644 --- a/test/t/test_gplusplus.py +++ b/test/t/test_gplusplus.py @@ -3,7 +3,6 @@ @pytest.mark.bashcomp(cmd="g++") class TestGPlusPlus: - @pytest.mark.complete("g++ ") def test_1(self, completion): assert completion diff --git a/test/t/test_gprof.py b/test/t/test_gprof.py index 195c58d2edc..417e09146a4 100644 --- a/test/t/test_gprof.py +++ b/test/t/test_gprof.py @@ -2,8 +2,6 @@ class TestGprof: - - @pytest.mark.complete("gprof --", - skipif="! gprof --help &>/dev/null") + @pytest.mark.complete("gprof --", skipif="! gprof --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_grep.py b/test/t/test_grep.py index 2518de75f8c..d7d742ec154 100644 --- a/test/t/test_grep.py +++ b/test/t/test_grep.py @@ -2,7 +2,6 @@ class TestGrep: - @pytest.mark.complete("grep --") def test_1(self, completion): assert completion diff --git a/test/t/test_groupadd.py b/test/t/test_groupadd.py index 126b1656aaf..efea4677e3e 100644 --- a/test/t/test_groupadd.py +++ b/test/t/test_groupadd.py @@ -2,7 +2,6 @@ class TestGroupadd: - @pytest.mark.complete("groupadd ") def test_1(self, completion): assert not completion diff --git a/test/t/test_groupdel.py b/test/t/test_groupdel.py index 0f0953350f4..1409e6cc668 100644 --- a/test/t/test_groupdel.py +++ b/test/t/test_groupdel.py @@ -2,7 +2,6 @@ class TestGroupdel: - @pytest.mark.complete("groupdel ") def test_1(self, completion): assert completion diff --git a/test/t/test_groupmems.py b/test/t/test_groupmems.py index 3e454b76eb2..2faff63310a 100644 --- a/test/t/test_groupmems.py +++ b/test/t/test_groupmems.py @@ -2,7 +2,6 @@ class TestGroupmems: - @pytest.mark.complete("groupmems -") def test_1(self, completion): assert completion diff --git a/test/t/test_groupmod.py b/test/t/test_groupmod.py index 1e471a3b0a5..08b1d2e2ccb 100644 --- a/test/t/test_groupmod.py +++ b/test/t/test_groupmod.py @@ -2,7 +2,6 @@ class TestGroupmod: - @pytest.mark.complete("groupmod ") def test_1(self, completion): assert completion diff --git a/test/t/test_growisofs.py b/test/t/test_growisofs.py index 4e314aed898..7ce19f6b048 100644 --- a/test/t/test_growisofs.py +++ b/test/t/test_growisofs.py @@ -2,7 +2,6 @@ class TestGrowisofs: - @pytest.mark.complete("growisofs ") def test_1(self, completion): assert completion diff --git a/test/t/test_grpck.py b/test/t/test_grpck.py index f46a62eebad..0d6a5cefa36 100644 --- a/test/t/test_grpck.py +++ b/test/t/test_grpck.py @@ -2,7 +2,6 @@ class TestGrpck: - @pytest.mark.complete("grpck ") def test_1(self, completion): assert completion diff --git a/test/t/test_grub.py b/test/t/test_grub.py index e26d5fa95df..8ecd02091aa 100644 --- a/test/t/test_grub.py +++ b/test/t/test_grub.py @@ -2,7 +2,6 @@ class TestGrub: - @pytest.mark.complete("grub --") def test_1(self, completion): assert completion diff --git a/test/t/test_gzip.py b/test/t/test_gzip.py index 80468eab703..3c2ecb6fb60 100644 --- a/test/t/test_gzip.py +++ b/test/t/test_gzip.py @@ -2,7 +2,6 @@ class TestGzip: - @pytest.mark.complete("gzip ") def test_1(self, completion): assert completion diff --git a/test/t/test_hciattach.py b/test/t/test_hciattach.py index e631af44c65..2dc10956bd8 100644 --- a/test/t/test_hciattach.py +++ b/test/t/test_hciattach.py @@ -2,7 +2,6 @@ class TestHciattach: - @pytest.mark.complete("hciattach ") def test_1(self, completion): assert completion diff --git a/test/t/test_hciconfig.py b/test/t/test_hciconfig.py index e86fb571f55..2a3f1fdf3b8 100644 --- a/test/t/test_hciconfig.py +++ b/test/t/test_hciconfig.py @@ -2,7 +2,6 @@ class TestHciconfig: - @pytest.mark.complete("hciconfig ") def test_1(self, completion): assert completion diff --git a/test/t/test_hcitool.py b/test/t/test_hcitool.py index 866b248300d..8725533f30e 100644 --- a/test/t/test_hcitool.py +++ b/test/t/test_hcitool.py @@ -2,7 +2,6 @@ class TestHcitool: - @pytest.mark.complete("hcitool ") def test_1(self, completion): assert completion diff --git a/test/t/test_hddtemp.py b/test/t/test_hddtemp.py index 40132bbf45c..e80a46cca21 100644 --- a/test/t/test_hddtemp.py +++ b/test/t/test_hddtemp.py @@ -2,7 +2,6 @@ class TestHddtemp: - @pytest.mark.complete("hddtemp -") def test_1(self, completion): assert completion diff --git a/test/t/test_head.py b/test/t/test_head.py index 0e160689560..a287034ab60 100644 --- a/test/t/test_head.py +++ b/test/t/test_head.py @@ -2,8 +2,6 @@ class TestHead: - - @pytest.mark.complete("head --", - skipif="! head --help &>/dev/null") + @pytest.mark.complete("head --", skipif="! head --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_hexdump.py b/test/t/test_hexdump.py index bde25ce8887..82b6d2ba52e 100644 --- a/test/t/test_hexdump.py +++ b/test/t/test_hexdump.py @@ -2,7 +2,6 @@ class TestHexdump: - @pytest.mark.complete("hexdump -") def test_1(self, completion): assert completion diff --git a/test/t/test_hid2hci.py b/test/t/test_hid2hci.py index 410e60e662c..66766fbd1ac 100644 --- a/test/t/test_hid2hci.py +++ b/test/t/test_hid2hci.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "PATH=/lib/udev:$PATH", - ), -) +@pytest.mark.bashcomp(pre_cmds=("PATH=/lib/udev:$PATH",)) class TestHid2hci: - @pytest.mark.complete("hid2hci -") def test_1(self, completion): assert completion diff --git a/test/t/test_host.py b/test/t/test_host.py index b5ebe6ef3bc..555a36f583c 100644 --- a/test/t/test_host.py +++ b/test/t/test_host.py @@ -2,7 +2,6 @@ class TestHost: - @pytest.mark.complete("host -") def test_1(self, completion): assert completion diff --git a/test/t/test_hostname.py b/test/t/test_hostname.py index 922777e4b23..5ccdf4583b4 100644 --- a/test/t/test_hostname.py +++ b/test/t/test_hostname.py @@ -2,7 +2,6 @@ class TestHostname: - @pytest.mark.complete("hostname -") def test_1(self, completion): assert completion diff --git a/test/t/test_hping2.py b/test/t/test_hping2.py index d9dc16bb198..77e2ee26262 100644 --- a/test/t/test_hping2.py +++ b/test/t/test_hping2.py @@ -2,7 +2,6 @@ class TestHping2: - @pytest.mark.complete("hping2 ") def test_1(self, completion): assert completion diff --git a/test/t/test_hping3.py b/test/t/test_hping3.py index 067dfe29c6c..a979cfa7c41 100644 --- a/test/t/test_hping3.py +++ b/test/t/test_hping3.py @@ -2,7 +2,6 @@ class TestHping3: - @pytest.mark.complete("hping3 ") def test_1(self, completion): assert completion diff --git a/test/t/test_htop.py b/test/t/test_htop.py index f182c06a136..62022bbd2d3 100644 --- a/test/t/test_htop.py +++ b/test/t/test_htop.py @@ -2,7 +2,6 @@ class TestHtop: - @pytest.mark.complete("htop -") def test_1(self, completion): assert completion diff --git a/test/t/test_htpasswd.py b/test/t/test_htpasswd.py index c80570ef875..c17c0585ef6 100644 --- a/test/t/test_htpasswd.py +++ b/test/t/test_htpasswd.py @@ -2,7 +2,6 @@ class TestHtpasswd: - @pytest.mark.complete("htpasswd ") def test_1(self, completion): assert completion diff --git a/test/t/test_hunspell.py b/test/t/test_hunspell.py index 55c8fdc3a46..94ea10205af 100644 --- a/test/t/test_hunspell.py +++ b/test/t/test_hunspell.py @@ -2,7 +2,6 @@ class TestHunspell: - @pytest.mark.complete("hunspell ") def test_1(self, completion): assert completion diff --git a/test/t/test_hwclock.py b/test/t/test_hwclock.py index 79826d25174..a9cb30faf19 100644 --- a/test/t/test_hwclock.py +++ b/test/t/test_hwclock.py @@ -2,7 +2,6 @@ class TestHwclock: - @pytest.mark.complete("hwclock -") def test_1(self, completion): assert completion diff --git a/test/t/test_iconv.py b/test/t/test_iconv.py index b381d313f37..dc5f8961a66 100644 --- a/test/t/test_iconv.py +++ b/test/t/test_iconv.py @@ -2,7 +2,6 @@ class TestIconv: - @pytest.mark.complete("iconv -") def test_1(self, completion): assert completion diff --git a/test/t/test_id.py b/test/t/test_id.py index d1b13085095..41f2868a75c 100644 --- a/test/t/test_id.py +++ b/test/t/test_id.py @@ -2,7 +2,6 @@ class TestId: - @pytest.mark.complete("id -") def test_1(self, completion): assert completion diff --git a/test/t/test_identify.py b/test/t/test_identify.py index e51e02f38be..12fba008280 100644 --- a/test/t/test_identify.py +++ b/test/t/test_identify.py @@ -2,7 +2,6 @@ class TestIdentify: - @pytest.mark.complete("identify -") def test_1(self, completion): assert completion diff --git a/test/t/test_idn.py b/test/t/test_idn.py index 6d2ef15bd54..1fd1ce02de7 100644 --- a/test/t/test_idn.py +++ b/test/t/test_idn.py @@ -2,7 +2,6 @@ class TestIdn: - @pytest.mark.complete("idn -") def test_1(self, completion): assert completion diff --git a/test/t/test_ifdown.py b/test/t/test_ifdown.py index 4fc40ae761b..16447be5f36 100644 --- a/test/t/test_ifdown.py +++ b/test/t/test_ifdown.py @@ -4,7 +4,6 @@ class TestIfdown: - @pytest.mark.xfail(in_docker(), reason="Probably fails in docker") @pytest.mark.complete("ifdown ") def test_1(self, completion): diff --git a/test/t/test_ifstat.py b/test/t/test_ifstat.py index ff790baaeb4..e4d828eeffb 100644 --- a/test/t/test_ifstat.py +++ b/test/t/test_ifstat.py @@ -2,17 +2,18 @@ class TestIfstat: - @pytest.mark.complete("ifstat -") def test_1(self, completion): assert completion - @pytest.mark.complete("ifstat -i ", - skipif="ifstat -v | command grep -qF iproute2") + @pytest.mark.complete( + "ifstat -i ", skipif="ifstat -v | command grep -qF iproute2" + ) def test_2(self, completion): assert completion - @pytest.mark.complete("ifstat -d ", - skipif="ifstat -v | command grep -qF iproute2") + @pytest.mark.complete( + "ifstat -d ", skipif="ifstat -v | command grep -qF iproute2" + ) def test_3(self, completion): assert completion diff --git a/test/t/test_iftop.py b/test/t/test_iftop.py index 281a09fdd55..9a25c28aa39 100644 --- a/test/t/test_iftop.py +++ b/test/t/test_iftop.py @@ -2,7 +2,6 @@ class TestIftop: - @pytest.mark.complete("iftop ") def test_1(self, completion): assert completion diff --git a/test/t/test_ifup.py b/test/t/test_ifup.py index 6786c607a37..62d8eb4ac10 100644 --- a/test/t/test_ifup.py +++ b/test/t/test_ifup.py @@ -4,7 +4,6 @@ class TestIfup: - @pytest.mark.xfail(in_docker(), reason="Probably fails in docker") @pytest.mark.complete("ifup ") def test_1(self, completion): diff --git a/test/t/test_import.py b/test/t/test_import.py index 9d247ed74a4..2e860650588 100644 --- a/test/t/test_import.py +++ b/test/t/test_import.py @@ -2,7 +2,6 @@ class TestImport: - @pytest.mark.complete("import ") def test_1(self, completion): assert completion diff --git a/test/t/test_info.py b/test/t/test_info.py index 145dae9b8f1..b52b682e580 100644 --- a/test/t/test_info.py +++ b/test/t/test_info.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "INFOPATH+=:$PWD/info:", - ), -) +@pytest.mark.bashcomp(pre_cmds=("INFOPATH+=:$PWD/info:",)) class TestInfo: - @pytest.mark.complete("info bash") def test_1(self, completion): assert completion diff --git a/test/t/test_inject.py b/test/t/test_inject.py index 4cf294b2952..37680dca2a3 100644 --- a/test/t/test_inject.py +++ b/test/t/test_inject.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "PATH=/usr/lib/mailman/bin:$PATH", - ), -) +@pytest.mark.bashcomp(pre_cmds=("PATH=/usr/lib/mailman/bin:$PATH",)) class TestInject: - @pytest.mark.complete("inject ") def test_1(self, completion): assert completion diff --git a/test/t/test_inotifywait.py b/test/t/test_inotifywait.py index e853dff23e6..fe647ad64ae 100644 --- a/test/t/test_inotifywait.py +++ b/test/t/test_inotifywait.py @@ -2,7 +2,6 @@ class TestInotifywait: - @pytest.mark.complete("inotifywait ") def test_1(self, completion): assert completion diff --git a/test/t/test_inotifywatch.py b/test/t/test_inotifywatch.py index f2a57ff5387..e0e686e84b4 100644 --- a/test/t/test_inotifywatch.py +++ b/test/t/test_inotifywatch.py @@ -2,7 +2,6 @@ class TestInotifywatch: - @pytest.mark.complete("inotifywatch ") def test_1(self, completion): assert completion diff --git a/test/t/test_insmod.py b/test/t/test_insmod.py index 338ccbdce0b..9636185dcf1 100644 --- a/test/t/test_insmod.py +++ b/test/t/test_insmod.py @@ -2,7 +2,6 @@ class TestInsmod: - @pytest.mark.complete("insmod ") def test_1(self, completion): assert completion diff --git a/test/t/test_installpkg.py b/test/t/test_installpkg.py index bcf1f3c8432..4e5ab27c9c0 100644 --- a/test/t/test_installpkg.py +++ b/test/t/test_installpkg.py @@ -5,15 +5,16 @@ class TestInstallpkg: - @pytest.mark.complete("installpkg -") def test_1(self, completion): assert completion @pytest.mark.complete("installpkg --") def test_2(self, completion): - assert completion == "--ask --infobox --md5sum --menu " \ + assert ( + completion == "--ask --infobox --md5sum --menu " "--priority --root --tagfile --terse --warn".split() + ) @pytest.mark.complete("installpkg --root ") def test_3(self, completion): @@ -22,11 +23,17 @@ def test_3(self, completion): @pytest.mark.complete("installpkg --root ") def test_4(self, completion): - expected = sorted([ - "%s/" % x for x in os.listdir("slackware/home") - if os.path.isdir("./%s" % x) - ] + [ - x for x in os.listdir("slackware/home") - if os.path.isfile("./%s" % x) and fnmatch.fnmatch(x, "*.t[bglx]z") - ]) + expected = sorted( + [ + "%s/" % x + for x in os.listdir("slackware/home") + if os.path.isdir("./%s" % x) + ] + + [ + x + for x in os.listdir("slackware/home") + if os.path.isfile("./%s" % x) + and fnmatch.fnmatch(x, "*.t[bglx]z") + ] + ) assert completion == expected diff --git a/test/t/test_interdiff.py b/test/t/test_interdiff.py index 32dc20e226d..e681fd6c334 100644 --- a/test/t/test_interdiff.py +++ b/test/t/test_interdiff.py @@ -2,7 +2,6 @@ class TestInterdiff: - @pytest.mark.complete("interdiff ") def test_1(self, completion): assert completion diff --git a/test/t/test_invoke_rc_d.py b/test/t/test_invoke_rc_d.py index e2b2f878f05..b0d1384e7e2 100644 --- a/test/t/test_invoke_rc_d.py +++ b/test/t/test_invoke_rc_d.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="invoke-rc.d", -) +@pytest.mark.bashcomp(cmd="invoke-rc.d") class TestInvokeRcD: - @pytest.mark.complete("invoke-rc.d ") def test_1(self, completion): assert completion diff --git a/test/t/test_ionice.py b/test/t/test_ionice.py index 4d0adbd1f90..ae047043f02 100644 --- a/test/t/test_ionice.py +++ b/test/t/test_ionice.py @@ -2,7 +2,6 @@ class TestIonice: - @pytest.mark.complete("ionice -") def test_1(self, completion): assert completion diff --git a/test/t/test_ip.py b/test/t/test_ip.py index 7136e34351e..20752505977 100644 --- a/test/t/test_ip.py +++ b/test/t/test_ip.py @@ -2,7 +2,6 @@ class TestIp: - @pytest.mark.complete("ip ") def test_1(self, completion): assert completion diff --git a/test/t/test_iperf.py b/test/t/test_iperf.py index d6ac4ed3d26..23f4df5546d 100644 --- a/test/t/test_iperf.py +++ b/test/t/test_iperf.py @@ -2,7 +2,6 @@ class TestIperf: - @pytest.mark.complete("iperf ") def test_1(self, completion): assert completion diff --git a/test/t/test_iperf3.py b/test/t/test_iperf3.py index 18690fa5f09..cd93a9963e3 100644 --- a/test/t/test_iperf3.py +++ b/test/t/test_iperf3.py @@ -2,7 +2,6 @@ class TestIperf3: - @pytest.mark.complete("iperf3 ") def test_1(self, completion): assert completion diff --git a/test/t/test_ipmitool.py b/test/t/test_ipmitool.py index 3a357bf5547..5f50ec7934b 100644 --- a/test/t/test_ipmitool.py +++ b/test/t/test_ipmitool.py @@ -2,7 +2,6 @@ class TestIpmitool: - @pytest.mark.complete("ipmitool ") def test_1(self, completion): assert completion diff --git a/test/t/test_ipsec.py b/test/t/test_ipsec.py index 8639573441c..5ff29c74f0d 100644 --- a/test/t/test_ipsec.py +++ b/test/t/test_ipsec.py @@ -2,7 +2,6 @@ class TestIpsec: - @pytest.mark.complete("ipsec ") def test_1(self, completion): assert completion diff --git a/test/t/test_iptables.py b/test/t/test_iptables.py index 2894b954c50..7a30bb82881 100644 --- a/test/t/test_iptables.py +++ b/test/t/test_iptables.py @@ -2,7 +2,6 @@ class TestIptables: - @pytest.mark.complete("iptables -") def test_1(self, completion): assert completion diff --git a/test/t/test_ipv6calc.py b/test/t/test_ipv6calc.py index 62bc2651f3c..435af149656 100644 --- a/test/t/test_ipv6calc.py +++ b/test/t/test_ipv6calc.py @@ -2,7 +2,6 @@ class TestIpv6calc: - @pytest.mark.complete("ipv6calc -") def test_1(self, completion): assert completion diff --git a/test/t/test_irb.py b/test/t/test_irb.py index 1c03ef60ead..31c46e20282 100644 --- a/test/t/test_irb.py +++ b/test/t/test_irb.py @@ -2,7 +2,6 @@ class TestIrb: - @pytest.mark.complete("irb ") def test_1(self, completion): assert completion diff --git a/test/t/test_iscsiadm.py b/test/t/test_iscsiadm.py index 1fe4b9b157d..932ffeb59fd 100644 --- a/test/t/test_iscsiadm.py +++ b/test/t/test_iscsiadm.py @@ -2,7 +2,6 @@ class TestIscsiadm: - @pytest.mark.complete("iscsiadm --mode") def test_1(self, completion): assert completion diff --git a/test/t/test_isort.py b/test/t/test_isort.py index a826529a471..4fae3244bb0 100644 --- a/test/t/test_isort.py +++ b/test/t/test_isort.py @@ -2,7 +2,6 @@ class TestIsort: - @pytest.mark.complete("isort ") def test_1(self, completion): assert completion diff --git a/test/t/test_isql.py b/test/t/test_isql.py index aa7e80fe1e8..7ff0bdb4225 100644 --- a/test/t/test_isql.py +++ b/test/t/test_isql.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "ODBCINI=isql/odbc.ini", - ), -) +@pytest.mark.bashcomp(pre_cmds=("ODBCINI=isql/odbc.ini",)) class TestIsql: - @pytest.mark.complete("isql ") def test_1(self, completion): assert completion diff --git a/test/t/test_iwconfig.py b/test/t/test_iwconfig.py index a6b83bd3501..3ac4b31a3e5 100644 --- a/test/t/test_iwconfig.py +++ b/test/t/test_iwconfig.py @@ -2,7 +2,6 @@ class TestIwconfig: - @pytest.mark.complete("iwconfig --") def test_1(self, completion): assert completion diff --git a/test/t/test_iwlist.py b/test/t/test_iwlist.py index ee2dda58f4e..77ffb99cab7 100644 --- a/test/t/test_iwlist.py +++ b/test/t/test_iwlist.py @@ -2,7 +2,6 @@ class TestIwlist: - @pytest.mark.complete("iwlist --") def test_1(self, completion): assert completion diff --git a/test/t/test_iwpriv.py b/test/t/test_iwpriv.py index 0d6eef466d3..dac214ae5d6 100644 --- a/test/t/test_iwpriv.py +++ b/test/t/test_iwpriv.py @@ -2,7 +2,6 @@ class TestIwpriv: - @pytest.mark.complete("iwpriv --") def test_1(self, completion): assert completion diff --git a/test/t/test_iwspy.py b/test/t/test_iwspy.py index 7f817646066..398df37169e 100644 --- a/test/t/test_iwspy.py +++ b/test/t/test_iwspy.py @@ -2,7 +2,6 @@ class TestIwspy: - @pytest.mark.complete("iwspy --") def test_1(self, completion): assert completion diff --git a/test/t/test_jar.py b/test/t/test_jar.py index ee61463e27f..5d4ed8a90e0 100644 --- a/test/t/test_jar.py +++ b/test/t/test_jar.py @@ -2,7 +2,6 @@ class TestJar: - @pytest.mark.complete("jar ") def test_1(self, completion): assert completion diff --git a/test/t/test_jarsigner.py b/test/t/test_jarsigner.py index 8c0f56d094c..a6efa6a30aa 100644 --- a/test/t/test_jarsigner.py +++ b/test/t/test_jarsigner.py @@ -2,7 +2,6 @@ class TestJarsigner: - @pytest.mark.complete("jarsigner ") def test_1(self, completion): assert completion diff --git a/test/t/test_java.py b/test/t/test_java.py index d54fb8caec1..81f07c68d40 100644 --- a/test/t/test_java.py +++ b/test/t/test_java.py @@ -2,12 +2,9 @@ @pytest.mark.bashcomp( - pre_cmds=( - "CLASSPATH=$PWD/java/a:$PWD/java/bashcomp.jar", - ), + pre_cmds=("CLASSPATH=$PWD/java/a:$PWD/java/bashcomp.jar",) ) class TestJava: - @pytest.mark.complete("java -") def test_1(self, completion): assert completion diff --git a/test/t/test_javac.py b/test/t/test_javac.py index c915d923bc1..197004e72a4 100644 --- a/test/t/test_javac.py +++ b/test/t/test_javac.py @@ -2,7 +2,6 @@ class TestJavac: - @pytest.mark.complete("javac ") def test_1(self, completion): assert completion diff --git a/test/t/test_javadoc.py b/test/t/test_javadoc.py index c2edad4f423..395d196dd49 100644 --- a/test/t/test_javadoc.py +++ b/test/t/test_javadoc.py @@ -2,7 +2,6 @@ class TestJavadoc: - @pytest.mark.complete("javadoc ") def test_1(self, completion): assert completion @@ -12,6 +11,7 @@ def test_2(self, completion): assert completion == ["bar bar.d/", "foo.d/"] @pytest.mark.complete( - "javadoc -nodeprecated -linkoffline foo shared/default/") + "javadoc -nodeprecated -linkoffline foo shared/default/" + ) def test_3(self, completion): assert completion == ["bar bar.d/", "foo.d/"] diff --git a/test/t/test_javaws.py b/test/t/test_javaws.py index cd2eb9d9054..9f51c58b50a 100644 --- a/test/t/test_javaws.py +++ b/test/t/test_javaws.py @@ -2,7 +2,6 @@ class TestJavaws: - @pytest.mark.complete("javaws ") def test_1(self, completion): assert completion diff --git a/test/t/test_jpegoptim.py b/test/t/test_jpegoptim.py index b19d45672fe..01eb739c29c 100644 --- a/test/t/test_jpegoptim.py +++ b/test/t/test_jpegoptim.py @@ -2,7 +2,6 @@ class TestJpegoptim: - @pytest.mark.complete("jpegoptim ") def test_1(self, completion): assert completion diff --git a/test/t/test_jps.py b/test/t/test_jps.py index 3b5b4519fda..add9ef976b8 100644 --- a/test/t/test_jps.py +++ b/test/t/test_jps.py @@ -2,7 +2,6 @@ class TestJps: - @pytest.mark.complete("jps -") def test_1(self, completion): assert completion diff --git a/test/t/test_jq.py b/test/t/test_jq.py index 34bbd383df4..c858411fc9b 100644 --- a/test/t/test_jq.py +++ b/test/t/test_jq.py @@ -2,7 +2,6 @@ class TestJq: - @pytest.mark.complete("jq ") def test_1(self, completion): assert not completion @@ -11,9 +10,11 @@ def test_1(self, completion): def test_2(self, completion): assert completion - @pytest.mark.complete("jq -", - skipif="! (jq --help 2>&1 || :) | " - "command grep -qF 'options include'") + @pytest.mark.complete( + "jq -", + skipif="! (jq --help 2>&1 || :) | " + "command grep -qF 'options include'", + ) def test_3(self, completion): assert completion diff --git a/test/t/test_jshint.py b/test/t/test_jshint.py index e9a03ca3579..511e7c9d6a2 100644 --- a/test/t/test_jshint.py +++ b/test/t/test_jshint.py @@ -2,7 +2,6 @@ class TestJshint: - @pytest.mark.complete("jshint ") def test_1(self, completion): assert completion diff --git a/test/t/test_json_xs.py b/test/t/test_json_xs.py index 6298613e63f..f6174b10000 100644 --- a/test/t/test_json_xs.py +++ b/test/t/test_json_xs.py @@ -2,7 +2,6 @@ class TestJsonXs: - @pytest.mark.complete("json_xs ") def test_1(self, completion): assert not completion diff --git a/test/t/test_jsonschema.py b/test/t/test_jsonschema.py index 25e49088476..0905fd7f918 100644 --- a/test/t/test_jsonschema.py +++ b/test/t/test_jsonschema.py @@ -2,7 +2,6 @@ class TestJsonschema: - @pytest.mark.complete("jsonschema ") def test_1(self, completion): assert completion diff --git a/test/t/test_k3b.py b/test/t/test_k3b.py index 9ff790653b8..d9940ba54e2 100644 --- a/test/t/test_k3b.py +++ b/test/t/test_k3b.py @@ -2,7 +2,6 @@ class TestK3b: - @pytest.mark.complete("k3b ") def test_1(self, completion): assert completion diff --git a/test/t/test_kcov.py b/test/t/test_kcov.py index fb7b0ab6b5b..ce985a78459 100644 --- a/test/t/test_kcov.py +++ b/test/t/test_kcov.py @@ -2,7 +2,6 @@ class TestKcov: - @pytest.mark.complete("kcov ") def test_1(self, completion): assert completion diff --git a/test/t/test_kdvi.py b/test/t/test_kdvi.py index d4ad2f6cb95..7fb11cb0cd7 100644 --- a/test/t/test_kdvi.py +++ b/test/t/test_kdvi.py @@ -2,8 +2,9 @@ class TestKdvi: - @pytest.mark.complete("kdvi ", cwd="kdvi") def test_1(self, completion): - assert completion == "foo/ .dvi .DVI .dvi.bz2 .DVI.bz2 .dvi.gz " \ + assert ( + completion == "foo/ .dvi .DVI .dvi.bz2 .DVI.bz2 .dvi.gz " ".DVI.gz .dvi.Z .DVI.Z".split() + ) diff --git a/test/t/test_kill.py b/test/t/test_kill.py index 171330e39c8..59d5fa2beae 100644 --- a/test/t/test_kill.py +++ b/test/t/test_kill.py @@ -2,7 +2,6 @@ class TestKill: - @pytest.mark.complete("kill 1", skipif="! type ps &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_kldload.py b/test/t/test_kldload.py index d9f2cc09f5c..2965e446924 100644 --- a/test/t/test_kldload.py +++ b/test/t/test_kldload.py @@ -2,7 +2,6 @@ class TestKldload: - @pytest.mark.complete("kldload ") def test_1(self, completion): assert completion diff --git a/test/t/test_kldunload.py b/test/t/test_kldunload.py index ffc725843db..a52c99ebb1d 100644 --- a/test/t/test_kldunload.py +++ b/test/t/test_kldunload.py @@ -4,12 +4,12 @@ class TestKldunload: - @pytest.mark.complete("kldunload ") def test_1(self, completion): try: subprocess.check_call( - r"kldstat 2>/dev/null | command grep -q '\.ko$'", shell=True) + r"kldstat 2>/dev/null | command grep -q '\.ko$'", shell=True + ) except BaseException: assert not completion else: diff --git a/test/t/test_koji.py b/test/t/test_koji.py index 990c4029781..68a8477bbe8 100644 --- a/test/t/test_koji.py +++ b/test/t/test_koji.py @@ -2,7 +2,6 @@ class TestKoji: - @pytest.mark.complete("koji ") def test_1(self, completion): assert completion diff --git a/test/t/test_kpdf.py b/test/t/test_kpdf.py index 7e308f3fdc6..ceee34d3b63 100644 --- a/test/t/test_kpdf.py +++ b/test/t/test_kpdf.py @@ -2,7 +2,6 @@ class TestKpdf: - @pytest.mark.complete("kpdf ", cwd="kpdf") def test_1(self, completion): assert completion == "foo/ .eps .ps .EPS .PS .pdf .PDF".split() diff --git a/test/t/test_kplayer.py b/test/t/test_kplayer.py index 2ee61882ea3..ef8a08e6199 100644 --- a/test/t/test_kplayer.py +++ b/test/t/test_kplayer.py @@ -2,7 +2,6 @@ class TestKplayer: - @pytest.mark.complete("kplayer ") def test_1(self, completion): assert completion diff --git a/test/t/test_ktutil.py b/test/t/test_ktutil.py index 1d9370251dd..7c90b8020bd 100644 --- a/test/t/test_ktutil.py +++ b/test/t/test_ktutil.py @@ -2,7 +2,6 @@ class TestKtutil: - @pytest.mark.complete("ktutil ") def test_1(self, completion): assert completion diff --git a/test/t/test_l2ping.py b/test/t/test_l2ping.py index 232575cc786..7979d734ac2 100644 --- a/test/t/test_l2ping.py +++ b/test/t/test_l2ping.py @@ -2,7 +2,6 @@ class TestL2ping: - @pytest.mark.complete("l2ping -") def test_1(self, completion): assert completion diff --git a/test/t/test_larch.py b/test/t/test_larch.py index 9fc46e368e8..e68183c16b8 100644 --- a/test/t/test_larch.py +++ b/test/t/test_larch.py @@ -2,7 +2,6 @@ class TestLarch: - @pytest.mark.complete("larch library-") def test_1(self, completion): assert completion diff --git a/test/t/test_lastlog.py b/test/t/test_lastlog.py index a6ae81a9648..043af96272e 100644 --- a/test/t/test_lastlog.py +++ b/test/t/test_lastlog.py @@ -2,7 +2,6 @@ class TestLastlog: - @pytest.mark.complete("lastlog -") def test_1(self, completion): assert completion diff --git a/test/t/test_ld.py b/test/t/test_ld.py index acc5d7bfbcd..a82f091b306 100644 --- a/test/t/test_ld.py +++ b/test/t/test_ld.py @@ -2,7 +2,6 @@ class TestLd: - @pytest.mark.complete("ld ") def test_1(self, completion): assert completion diff --git a/test/t/test_ldapadd.py b/test/t/test_ldapadd.py index 12106e3faf0..24aa5e397d7 100644 --- a/test/t/test_ldapadd.py +++ b/test/t/test_ldapadd.py @@ -2,7 +2,6 @@ class TestLdapadd: - @pytest.mark.complete("ldapadd -") def test_1(self, completion): assert completion diff --git a/test/t/test_ldapcompare.py b/test/t/test_ldapcompare.py index 5a86f0aea41..6a3afe9adff 100644 --- a/test/t/test_ldapcompare.py +++ b/test/t/test_ldapcompare.py @@ -2,7 +2,6 @@ class TestLdapcompare: - @pytest.mark.complete("ldapcompare -") def test_1(self, completion): assert completion diff --git a/test/t/test_ldapdelete.py b/test/t/test_ldapdelete.py index b2a5bbb1c5b..2065d9bc7c6 100644 --- a/test/t/test_ldapdelete.py +++ b/test/t/test_ldapdelete.py @@ -2,7 +2,6 @@ class TestLdapdelete: - @pytest.mark.complete("ldapdelete -") def test_1(self, completion): assert completion diff --git a/test/t/test_ldapmodrdn.py b/test/t/test_ldapmodrdn.py index dc58e601482..da8bdbdc2c1 100644 --- a/test/t/test_ldapmodrdn.py +++ b/test/t/test_ldapmodrdn.py @@ -2,7 +2,6 @@ class TestLdapmodrdn: - @pytest.mark.complete("ldapmodrdn -") def test_1(self, completion): assert completion diff --git a/test/t/test_ldappasswd.py b/test/t/test_ldappasswd.py index 36f5e42e1c8..e559f23bbdf 100644 --- a/test/t/test_ldappasswd.py +++ b/test/t/test_ldappasswd.py @@ -2,7 +2,6 @@ class TestLdappasswd: - @pytest.mark.complete("ldappasswd -") def test_1(self, completion): assert completion diff --git a/test/t/test_ldapsearch.py b/test/t/test_ldapsearch.py index 4f54f6e4fab..43797f41868 100644 --- a/test/t/test_ldapsearch.py +++ b/test/t/test_ldapsearch.py @@ -2,7 +2,6 @@ class TestLdapsearch: - @pytest.mark.complete("ldapsearch -") def test_1(self, completion): assert completion diff --git a/test/t/test_ldapvi.py b/test/t/test_ldapvi.py index e8299061e4a..a81ae1809c6 100644 --- a/test/t/test_ldapvi.py +++ b/test/t/test_ldapvi.py @@ -2,7 +2,6 @@ class TestLdapvi: - @pytest.mark.complete("ldapvi -") def test_1(self, completion): assert completion diff --git a/test/t/test_ldapwhoami.py b/test/t/test_ldapwhoami.py index a6e46ab5e38..9dcfb5f843c 100644 --- a/test/t/test_ldapwhoami.py +++ b/test/t/test_ldapwhoami.py @@ -2,7 +2,6 @@ class TestLdapwhoami: - @pytest.mark.complete("ldapwhoami -") def test_1(self, completion): assert completion diff --git a/test/t/test_ldd.py b/test/t/test_ldd.py index d1974066888..8c463b60e62 100644 --- a/test/t/test_ldd.py +++ b/test/t/test_ldd.py @@ -2,7 +2,6 @@ class TestLdd: - @pytest.mark.complete("ldd ") def test_1(self, completion): assert completion diff --git a/test/t/test_less.py b/test/t/test_less.py index 6334c6a4d51..79cdf183788 100644 --- a/test/t/test_less.py +++ b/test/t/test_less.py @@ -2,7 +2,6 @@ class TestLess: - @pytest.mark.complete("less --") def test_1(self, completion): assert completion diff --git a/test/t/test_lftp.py b/test/t/test_lftp.py index 2dbd7c3334d..18506f61783 100644 --- a/test/t/test_lftp.py +++ b/test/t/test_lftp.py @@ -3,16 +3,12 @@ from conftest import assert_bash_exec -@pytest.mark.bashcomp( - pre_cmds=( - "HOME=$PWD/lftp", - ), -) +@pytest.mark.bashcomp(pre_cmds=("HOME=$PWD/lftp",)) class TestLftp: - @pytest.mark.complete("lftp ") def test_1(self, bash, completion): hosts = assert_bash_exec( - bash, "compgen -A hostname", want_output=True).split() + bash, "compgen -A hostname", want_output=True + ).split() assert all(x in completion for x in hosts) assert "lftptest" in completion # defined in lftp/.lftp/bookmarks diff --git a/test/t/test_lftpget.py b/test/t/test_lftpget.py index a30010376f1..c1f453e97ca 100644 --- a/test/t/test_lftpget.py +++ b/test/t/test_lftpget.py @@ -2,7 +2,6 @@ class TestLftpget: - @pytest.mark.complete("lftpget -") def test_1(self, completion): assert completion diff --git a/test/t/test_lilo.py b/test/t/test_lilo.py index 375858da2a2..9783f50607e 100644 --- a/test/t/test_lilo.py +++ b/test/t/test_lilo.py @@ -2,7 +2,6 @@ class TestLilo: - @pytest.mark.complete("lilo -") def test_1(self, completion): assert completion diff --git a/test/t/test_links.py b/test/t/test_links.py index fb762028a68..f21b872830e 100644 --- a/test/t/test_links.py +++ b/test/t/test_links.py @@ -2,7 +2,6 @@ class TestLinks: - @pytest.mark.complete("links ") def test_1(self, completion): assert completion diff --git a/test/t/test_lintian.py b/test/t/test_lintian.py index 8fefe176371..c6526426fba 100644 --- a/test/t/test_lintian.py +++ b/test/t/test_lintian.py @@ -2,7 +2,6 @@ class TestLintian: - @pytest.mark.complete("lintian --") def test_1(self, completion): assert completion diff --git a/test/t/test_lintian_info.py b/test/t/test_lintian_info.py index 32338cf0df0..6bcc9e526b0 100644 --- a/test/t/test_lintian_info.py +++ b/test/t/test_lintian_info.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="lintian-info", -) +@pytest.mark.bashcomp(cmd="lintian-info") class TestLintianInfo: - @pytest.mark.complete("lintian-info ") def test_1(self, completion): assert completion diff --git a/test/t/test_lisp.py b/test/t/test_lisp.py index 2382aeb9308..8477061073d 100644 --- a/test/t/test_lisp.py +++ b/test/t/test_lisp.py @@ -2,7 +2,6 @@ class TestLisp: - @pytest.mark.complete("lisp ") def test_1(self, completion): assert completion diff --git a/test/t/test_list_admins.py b/test/t/test_list_admins.py index aecf3aa5267..b65387e567b 100644 --- a/test/t/test_list_admins.py +++ b/test/t/test_list_admins.py @@ -2,7 +2,6 @@ class TestListAdmins: - @pytest.mark.complete("list_admins -") def test_1(self, completion): assert completion diff --git a/test/t/test_list_lists.py b/test/t/test_list_lists.py index e3ec870e6b0..966ca251f82 100644 --- a/test/t/test_list_lists.py +++ b/test/t/test_list_lists.py @@ -2,7 +2,6 @@ class TestListLists: - @pytest.mark.complete("list_lists -") def test_1(self, completion): assert completion diff --git a/test/t/test_list_members.py b/test/t/test_list_members.py index 32bf400d755..96ea2ef3df3 100644 --- a/test/t/test_list_members.py +++ b/test/t/test_list_members.py @@ -2,7 +2,6 @@ class TestListMembers: - @pytest.mark.complete("list_members -") def test_1(self, completion): assert completion diff --git a/test/t/test_list_owners.py b/test/t/test_list_owners.py index 21c1b280e30..2a6bcab81be 100644 --- a/test/t/test_list_owners.py +++ b/test/t/test_list_owners.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "PATH=/usr/lib/mailman/bin:$PATH", - ), -) +@pytest.mark.bashcomp(pre_cmds=("PATH=/usr/lib/mailman/bin:$PATH",)) class TestListOwners: - @pytest.mark.complete("list_owners -") def test_1(self, completion): assert completion diff --git a/test/t/test_ln.py b/test/t/test_ln.py index 8c451bc2709..de053345d9d 100644 --- a/test/t/test_ln.py +++ b/test/t/test_ln.py @@ -2,7 +2,6 @@ class TestLn: - @pytest.mark.complete("ln ") def test_1(self, completion): assert completion diff --git a/test/t/test_locale_gen.py b/test/t/test_locale_gen.py index 2bf6c8339b8..41ac376f624 100644 --- a/test/t/test_locale_gen.py +++ b/test/t/test_locale_gen.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="locale-gen", -) +@pytest.mark.bashcomp(cmd="locale-gen") class TestLocaleGen: - @pytest.mark.complete("locale-gen ") def test_1(self, completion): assert completion diff --git a/test/t/test_look.py b/test/t/test_look.py index b28155a69b0..fd6800e5a38 100644 --- a/test/t/test_look.py +++ b/test/t/test_look.py @@ -4,12 +4,12 @@ class TestLook: - @pytest.mark.complete("look foo") def test_1(self, completion): try: subprocess.check_call( - "look foo 2>/dev/null | command grep -q ^foo", shell=True) + "look foo 2>/dev/null | command grep -q ^foo", shell=True + ) except BaseException: assert not completion else: diff --git a/test/t/test_lpq.py b/test/t/test_lpq.py index a3f89ed121f..0d69270d08a 100644 --- a/test/t/test_lpq.py +++ b/test/t/test_lpq.py @@ -2,7 +2,6 @@ class TestLpq: - @pytest.mark.complete("lpq ") def test_1(self, completion): assert completion diff --git a/test/t/test_lpr.py b/test/t/test_lpr.py index df4c284a643..30c710bb9fd 100644 --- a/test/t/test_lpr.py +++ b/test/t/test_lpr.py @@ -2,7 +2,6 @@ class TestLpr: - @pytest.mark.complete("lpr ") def test_1(self, completion): assert completion diff --git a/test/t/test_lrzip.py b/test/t/test_lrzip.py index 4731693c8a2..266d8a30ff8 100644 --- a/test/t/test_lrzip.py +++ b/test/t/test_lrzip.py @@ -2,7 +2,6 @@ class TestLrzip: - @pytest.mark.complete("lrzip ") def test_1(self, completion): assert completion diff --git a/test/t/test_ls.py b/test/t/test_ls.py index 06e3a0a5700..ed5ad9c49c9 100644 --- a/test/t/test_ls.py +++ b/test/t/test_ls.py @@ -1,12 +1,13 @@ import pytest from conftest import ( - assert_bash_exec, assert_complete, find_unique_completion_pair, + assert_bash_exec, + assert_complete, + find_unique_completion_pair, ) class TestLs: - @pytest.mark.complete("ls --", skipif="! ls --help &>/dev/null") def test_1(self, completion): assert completion @@ -17,10 +18,16 @@ def test_2(self, completion): def test_3(self, bash): """~part should complete to ~full if home dir does not exist.""" - res = assert_bash_exec( - bash, "for u in $(compgen -u); do " - "eval test -d ~$u || echo $u; unset u; done", - want_output=True).strip().split() + res = ( + assert_bash_exec( + bash, + "for u in $(compgen -u); do " + "eval test -d ~$u || echo $u; unset u; done", + want_output=True, + ) + .strip() + .split() + ) part_full = find_unique_completion_pair(res) if not part_full: pytest.skip("No suitable test user found") diff --git a/test/t/test_lsof.py b/test/t/test_lsof.py index f156faef9e8..170d2690148 100644 --- a/test/t/test_lsof.py +++ b/test/t/test_lsof.py @@ -2,7 +2,6 @@ class TestLsof: - @pytest.mark.complete("lsof ") def test_1(self, completion): assert completion diff --git a/test/t/test_lspci.py b/test/t/test_lspci.py index af52302efe4..44663426e1b 100644 --- a/test/t/test_lspci.py +++ b/test/t/test_lspci.py @@ -2,7 +2,6 @@ class TestLspci: - @pytest.mark.complete("lspci -") def test_1(self, completion): assert completion diff --git a/test/t/test_lsscsi.py b/test/t/test_lsscsi.py index 9e4cec5d5e3..a297b3757e1 100644 --- a/test/t/test_lsscsi.py +++ b/test/t/test_lsscsi.py @@ -2,7 +2,6 @@ class TestLsscsi: - @pytest.mark.complete("lsscsi ") def test_1(self, completion): assert not completion diff --git a/test/t/test_lsusb.py b/test/t/test_lsusb.py index 17bb3f91335..9c546d3259e 100644 --- a/test/t/test_lsusb.py +++ b/test/t/test_lsusb.py @@ -2,7 +2,6 @@ class TestLsusb: - @pytest.mark.complete("lsusb -") def test_1(self, completion): assert completion diff --git a/test/t/test_lua.py b/test/t/test_lua.py index 958e1f91941..edcae88350d 100644 --- a/test/t/test_lua.py +++ b/test/t/test_lua.py @@ -2,7 +2,6 @@ class TestLua: - @pytest.mark.complete("lua ") def test_1(self, completion): assert completion diff --git a/test/t/test_luac.py b/test/t/test_luac.py index c77eee4168c..f14d400a064 100644 --- a/test/t/test_luac.py +++ b/test/t/test_luac.py @@ -2,7 +2,6 @@ class TestLuac: - @pytest.mark.complete("luac ") def test_1(self, completion): assert completion diff --git a/test/t/test_luseradd.py b/test/t/test_luseradd.py index d5fc233dab7..35c89e54a7f 100644 --- a/test/t/test_luseradd.py +++ b/test/t/test_luseradd.py @@ -2,7 +2,6 @@ class TestLuseradd: - @pytest.mark.complete("luseradd -") def test_1(self, completion): assert completion diff --git a/test/t/test_luserdel.py b/test/t/test_luserdel.py index 8a7285e85de..cdca2a57b0b 100644 --- a/test/t/test_luserdel.py +++ b/test/t/test_luserdel.py @@ -2,7 +2,6 @@ class TestLuserdel: - @pytest.mark.complete("luserdel ") def test_1(self, completion): assert completion diff --git a/test/t/test_lusermod.py b/test/t/test_lusermod.py index 794d7194b71..69ef07c2205 100644 --- a/test/t/test_lusermod.py +++ b/test/t/test_lusermod.py @@ -2,7 +2,6 @@ class TestLusermod: - @pytest.mark.complete("lusermod ") def test_1(self, completion): assert completion diff --git a/test/t/test_lvchange.py b/test/t/test_lvchange.py index 07837df4df6..5722a581b44 100644 --- a/test/t/test_lvchange.py +++ b/test/t/test_lvchange.py @@ -2,8 +2,8 @@ class TestLvchange: - - @pytest.mark.complete("lvchange --", - skipif="! lvchange --help &>/dev/null") + @pytest.mark.complete( + "lvchange --", skipif="! lvchange --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvcreate.py b/test/t/test_lvcreate.py index 93efdc102f4..e60432f6bb6 100644 --- a/test/t/test_lvcreate.py +++ b/test/t/test_lvcreate.py @@ -2,8 +2,8 @@ class TestLvcreate: - - @pytest.mark.complete("lvcreate --", - skipif="! lvcreate --help &>/dev/null") + @pytest.mark.complete( + "lvcreate --", skipif="! lvcreate --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvdisplay.py b/test/t/test_lvdisplay.py index c123e43c40f..e9a955edfbb 100644 --- a/test/t/test_lvdisplay.py +++ b/test/t/test_lvdisplay.py @@ -2,8 +2,8 @@ class TestLvdisplay: - - @pytest.mark.complete("lvdisplay --", - skipif="! lvdisplay --help &>/dev/null") + @pytest.mark.complete( + "lvdisplay --", skipif="! lvdisplay --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvextend.py b/test/t/test_lvextend.py index 77d8f922824..68e17848199 100644 --- a/test/t/test_lvextend.py +++ b/test/t/test_lvextend.py @@ -2,8 +2,8 @@ class TestLvextend: - - @pytest.mark.complete("lvextend --", - skipif="! lvextend --help &>/dev/null") + @pytest.mark.complete( + "lvextend --", skipif="! lvextend --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvm.py b/test/t/test_lvm.py index ec8fc8f5789..ea25b977c7b 100644 --- a/test/t/test_lvm.py +++ b/test/t/test_lvm.py @@ -2,7 +2,6 @@ class TestLvm: - @pytest.mark.complete("lvm pv") def test_1(self, completion): assert completion diff --git a/test/t/test_lvmdiskscan.py b/test/t/test_lvmdiskscan.py index e4f954a8354..0716d5c49fd 100644 --- a/test/t/test_lvmdiskscan.py +++ b/test/t/test_lvmdiskscan.py @@ -2,8 +2,8 @@ class TestLvmdiskscan: - - @pytest.mark.complete("lvmdiskscan --", - skipif="! lvmdiskscan --help &>/dev/null") + @pytest.mark.complete( + "lvmdiskscan --", skipif="! lvmdiskscan --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvreduce.py b/test/t/test_lvreduce.py index 5bf917534ad..50b038fddb7 100644 --- a/test/t/test_lvreduce.py +++ b/test/t/test_lvreduce.py @@ -2,8 +2,8 @@ class TestLvreduce: - - @pytest.mark.complete("lvreduce --", - skipif="! lvreduce --help &>/dev/null") + @pytest.mark.complete( + "lvreduce --", skipif="! lvreduce --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvremove.py b/test/t/test_lvremove.py index a888a07f476..53950aecf80 100644 --- a/test/t/test_lvremove.py +++ b/test/t/test_lvremove.py @@ -2,8 +2,8 @@ class TestLvremove: - - @pytest.mark.complete("lvremove --", - skipif="! lvremove --help &>/dev/null") + @pytest.mark.complete( + "lvremove --", skipif="! lvremove --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvrename.py b/test/t/test_lvrename.py index 68b2302ae06..c60469f5757 100644 --- a/test/t/test_lvrename.py +++ b/test/t/test_lvrename.py @@ -2,8 +2,8 @@ class TestLvrename: - - @pytest.mark.complete("lvrename --", - skipif="! lvrename --help &>/dev/null") + @pytest.mark.complete( + "lvrename --", skipif="! lvrename --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvresize.py b/test/t/test_lvresize.py index c87f5ce07de..aecc8bf4d88 100644 --- a/test/t/test_lvresize.py +++ b/test/t/test_lvresize.py @@ -2,8 +2,8 @@ class TestLvresize: - - @pytest.mark.complete("lvresize --", - skipif="! lvresize --help &>/dev/null") + @pytest.mark.complete( + "lvresize --", skipif="! lvresize --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvs.py b/test/t/test_lvs.py index 5703a0bcfa8..456368b9a84 100644 --- a/test/t/test_lvs.py +++ b/test/t/test_lvs.py @@ -2,8 +2,6 @@ class TestLvs: - - @pytest.mark.complete("lvs --", - skipif="! lvs --help &>/dev/null") + @pytest.mark.complete("lvs --", skipif="! lvs --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_lvscan.py b/test/t/test_lvscan.py index 7ebaf6b1f20..4848fe4c1c8 100644 --- a/test/t/test_lvscan.py +++ b/test/t/test_lvscan.py @@ -2,8 +2,6 @@ class TestLvscan: - - @pytest.mark.complete("lvscan --", - skipif="! lvscan --help &>/dev/null") + @pytest.mark.complete("lvscan --", skipif="! lvscan --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_lz4.py b/test/t/test_lz4.py index 88643a96945..0d873b661a4 100644 --- a/test/t/test_lz4.py +++ b/test/t/test_lz4.py @@ -2,7 +2,6 @@ class TestLz4: - @pytest.mark.complete("lz4 ") def test_1(self, completion): assert completion diff --git a/test/t/test_lzip.py b/test/t/test_lzip.py index 485fb1e1eaf..6f1dc023e54 100644 --- a/test/t/test_lzip.py +++ b/test/t/test_lzip.py @@ -2,7 +2,6 @@ class TestLzip: - @pytest.mark.complete("lzip ") def test_1(self, completion): assert completion diff --git a/test/t/test_lzma.py b/test/t/test_lzma.py index 0649dcc764e..f9d89926622 100644 --- a/test/t/test_lzma.py +++ b/test/t/test_lzma.py @@ -2,7 +2,6 @@ class TestLzma: - @pytest.mark.complete("lzma ") def test_1(self, completion): assert completion diff --git a/test/t/test_lzop.py b/test/t/test_lzop.py index 6031ee88047..bd010fde4e3 100644 --- a/test/t/test_lzop.py +++ b/test/t/test_lzop.py @@ -2,7 +2,6 @@ class TestLzop: - @pytest.mark.complete("lzop ") def test_1(self, completion): assert completion diff --git a/test/t/test_m4.py b/test/t/test_m4.py index f146d0b68ce..d80a7538965 100644 --- a/test/t/test_m4.py +++ b/test/t/test_m4.py @@ -2,8 +2,6 @@ class TestM4: - - @pytest.mark.complete("m4 --", - skipif="! m4 --help &>/dev/null") + @pytest.mark.complete("m4 --", skipif="! m4 --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_macof.py b/test/t/test_macof.py index 89d7678fe5c..8030c379585 100644 --- a/test/t/test_macof.py +++ b/test/t/test_macof.py @@ -2,7 +2,6 @@ class TestMacof: - @pytest.mark.complete("macof -") def test_1(self, completion): assert completion diff --git a/test/t/test_mailmanctl.py b/test/t/test_mailmanctl.py index 2b3181b249f..2baa0500fdd 100644 --- a/test/t/test_mailmanctl.py +++ b/test/t/test_mailmanctl.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "PATH=/usr/lib/mailman/bin:$PATH", - ), -) +@pytest.mark.bashcomp(pre_cmds=("PATH=/usr/lib/mailman/bin:$PATH",)) class TestMailmanctl: - @pytest.mark.complete("mailmanctl ") def test_1(self, completion): assert completion diff --git a/test/t/test_mailsnarf.py b/test/t/test_mailsnarf.py index c6510fee3b7..4e264a6ed66 100644 --- a/test/t/test_mailsnarf.py +++ b/test/t/test_mailsnarf.py @@ -2,7 +2,6 @@ class TestMailsnarf: - @pytest.mark.complete("mailsnarf -") def test_1(self, completion): assert completion diff --git a/test/t/test_make.py b/test/t/test_make.py index c1e8031c3d8..cbd4a118d2a 100644 --- a/test/t/test_make.py +++ b/test/t/test_make.py @@ -6,7 +6,6 @@ class TestMake: - @pytest.mark.complete("make -f Ma", cwd="make") def test_1(self, completion): assert completion == "Makefile" @@ -35,9 +34,11 @@ def test_6(self, bash, completion): assert completion == "all clean extra_makefile install sample".split() os.remove("%s/make/%s" % (bash.cwd, "extra_makefile")) - @pytest.mark.xfail(in_docker() and os.environ.get("DIST") == "centos6", - reason="Fails for some unknown reason on CentOS 6, " - "even though the behavior appears to be correct") + @pytest.mark.xfail( + in_docker() and os.environ.get("DIST") == "centos6", + reason="Fails for some unknown reason on CentOS 6, " + "even though the behavior appears to be correct", + ) @pytest.mark.complete("make .cache/.", cwd="make") def test_7(self, bash, completion): assert completion == ".1 .2".split() diff --git a/test/t/test_makepkg.py b/test/t/test_makepkg.py index 30e98adc754..65f49ea8243 100644 --- a/test/t/test_makepkg.py +++ b/test/t/test_makepkg.py @@ -1,16 +1,14 @@ import pytest -@pytest.mark.bashcomp( - skipif="! makepkg --help 2>&1 | grep -qiF slackware", -) +@pytest.mark.bashcomp(skipif="! makepkg --help 2>&1 | grep -qiF slackware") class TestMakepkg: - @pytest.mark.complete("makepkg ") def test_1(self, completion): assert completion @pytest.mark.complete("makepkg --") def test_2(self, completion): - assert all(x in completion - for x in "--chown --linkadd --prepend".split()) + assert all( + x in completion for x in "--chown --linkadd --prepend".split() + ) diff --git a/test/t/test_man.py b/test/t/test_man.py index 07d25567473..60021d9958c 100644 --- a/test/t/test_man.py +++ b/test/t/test_man.py @@ -22,12 +22,15 @@ def colonpath(self, request, bash): return assert_bash_exec(bash, "mkdir -p $TESTDIR/../tmp/man/man3") assert_bash_exec( - bash, "touch $TESTDIR/../tmp/man/man3/Bash::Completion.3pm.gz") + bash, "touch $TESTDIR/../tmp/man/man3/Bash::Completion.3pm.gz" + ) request.addfinalizer( - lambda: assert_bash_exec(bash, "rm -r $TESTDIR/../tmp/man")) + lambda: assert_bash_exec(bash, "rm -r $TESTDIR/../tmp/man") + ) - @pytest.mark.complete("man bash-completion-testcas", - env=dict(MANPATH=manpath)) + @pytest.mark.complete( + "man bash-completion-testcas", env=dict(MANPATH=manpath) + ) def test_1(self, completion): assert completion == "bash-completion-testcase" @@ -39,14 +42,19 @@ def test_2(self, completion): def test_3(self, completion): assert completion == "man/quux.8" - @pytest.mark.xfail(in_docker() and os.environ.get("DIST") == "centos6", - reason="TODO: Fails in CentOS for some reason, unknown " - "how to trigger same behavior as tests show (is " - "different and correct when tried manually, but here " - "at least in CI completes things it should not with " - "this MANPATH setting)") - @pytest.mark.complete("man %s" % assumed_present, cwd="shared/empty_dir", - env=dict(MANPATH=manpath)) + @pytest.mark.xfail( + in_docker() and os.environ.get("DIST") == "centos6", + reason="TODO: Fails in CentOS for some reason, unknown " + "how to trigger same behavior as tests show (is " + "different and correct when tried manually, but here " + "at least in CI completes things it should not with " + "this MANPATH setting)", + ) + @pytest.mark.complete( + "man %s" % assumed_present, + cwd="shared/empty_dir", + env=dict(MANPATH=manpath), + ) def test_4(self, completion): """ Assumed present should not be completed complete when there's no @@ -54,38 +62,47 @@ def test_4(self, completion): """ assert not completion - @pytest.mark.complete("man %s" % assumed_present, - cwd="shared/empty_dir", - env=dict(MANPATH="%s:" % manpath)) + @pytest.mark.complete( + "man %s" % assumed_present, + cwd="shared/empty_dir", + env=dict(MANPATH="%s:" % manpath), + ) def test_5(self, completion): """Trailing colon appends system man path.""" assert completion @pytest.mark.complete( - "man bash-completion-testcas", env=dict(MANPATH="%s:" % manpath)) + "man bash-completion-testcas", env=dict(MANPATH="%s:" % manpath) + ) def test_6(self, completion): assert completion == "bash-completion-testcase" - @pytest.mark.complete("man %s" % assumed_present, - cwd="shared/empty_dir", - env=dict(MANPATH=":%s" % manpath)) + @pytest.mark.complete( + "man %s" % assumed_present, + cwd="shared/empty_dir", + env=dict(MANPATH=":%s" % manpath), + ) def test_7(self, completion): """Leading colon prepends system man path.""" assert completion @pytest.mark.complete( - "man bash-completion-testcas", env=dict(MANPATH=":%s" % manpath)) + "man bash-completion-testcas", env=dict(MANPATH=":%s" % manpath) + ) def test_8(self, completion): assert completion == "bash-completion-testcase" - @pytest.mark.complete("man %s" % assumed_present, - cwd="shared/empty_dir", - pre_cmds=("shopt -s failglob",)) + @pytest.mark.complete( + "man %s" % assumed_present, + cwd="shared/empty_dir", + pre_cmds=("shopt -s failglob",), + ) def test_9(self, bash, completion): assert self.assumed_present in completion assert_bash_exec(bash, "shopt -u failglob") - @pytest.mark.complete("man Bash::C", - env=dict(MANPATH="%s:../tmp/man" % manpath)) + @pytest.mark.complete( + "man Bash::C", env=dict(MANPATH="%s:../tmp/man" % manpath) + ) def test_10(self, bash, colonpath, completion): assert completion == "Bash::Completion" diff --git a/test/t/test_mc.py b/test/t/test_mc.py index fddc0310014..9632d6a9d6f 100644 --- a/test/t/test_mc.py +++ b/test/t/test_mc.py @@ -2,7 +2,6 @@ class TestMc: - @pytest.mark.complete("mc -") def test_1(self, completion): assert completion diff --git a/test/t/test_mcrypt.py b/test/t/test_mcrypt.py index 6f434b310a9..da80ef5d9db 100644 --- a/test/t/test_mcrypt.py +++ b/test/t/test_mcrypt.py @@ -2,7 +2,6 @@ class TestMcrypt: - @pytest.mark.complete("mcrypt ") def test_1(self, completion): assert completion diff --git a/test/t/test_md5sum.py b/test/t/test_md5sum.py index 6e9d14d5671..fa364ea140e 100644 --- a/test/t/test_md5sum.py +++ b/test/t/test_md5sum.py @@ -2,7 +2,6 @@ class TestMd5sum: - @pytest.mark.complete("md5sum ") def test_1(self, completion): assert completion diff --git a/test/t/test_mdadm.py b/test/t/test_mdadm.py index d2c47f48217..143007b322b 100644 --- a/test/t/test_mdadm.py +++ b/test/t/test_mdadm.py @@ -2,7 +2,6 @@ class TestMdadm: - @pytest.mark.complete("mdadm ") def test_1(self, completion): assert completion diff --git a/test/t/test_mdecrypt.py b/test/t/test_mdecrypt.py index 4092c6896e3..f6f4c8edc4d 100644 --- a/test/t/test_mdecrypt.py +++ b/test/t/test_mdecrypt.py @@ -2,7 +2,6 @@ class TestMdecrypt: - @pytest.mark.complete("mdecrypt ") def test_1(self, completion): assert completion diff --git a/test/t/test_mdtool.py b/test/t/test_mdtool.py index 2b29a344213..356e907d3f2 100644 --- a/test/t/test_mdtool.py +++ b/test/t/test_mdtool.py @@ -2,7 +2,6 @@ class TestMdtool: - @pytest.mark.complete("mdtool ") def test_1(self, completion): assert completion diff --git a/test/t/test_medusa.py b/test/t/test_medusa.py index 74ee7a34157..bffa1c460f7 100644 --- a/test/t/test_medusa.py +++ b/test/t/test_medusa.py @@ -2,7 +2,6 @@ class TestMedusa: - @pytest.mark.complete("medusa -") def test_1(self, completion): assert completion diff --git a/test/t/test_mencoder.py b/test/t/test_mencoder.py index ddba57b866d..ba946c7eae1 100644 --- a/test/t/test_mencoder.py +++ b/test/t/test_mencoder.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "HOME=$PWD/mplayer", - ), -) +@pytest.mark.bashcomp(pre_cmds=("HOME=$PWD/mplayer",)) class TestMencoder: - @pytest.mark.complete("mencoder ") def test_1(self, completion): assert completion diff --git a/test/t/test_mii_diag.py b/test/t/test_mii_diag.py index 3c4113084a8..fa527e9472a 100644 --- a/test/t/test_mii_diag.py +++ b/test/t/test_mii_diag.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="mii-diag", -) +@pytest.mark.bashcomp(cmd="mii-diag") class TestMiiDiag: - @pytest.mark.complete("mii-diag ") def test_1(self, completion): assert completion diff --git a/test/t/test_mii_tool.py b/test/t/test_mii_tool.py index 7d11bc285a5..32568f8252a 100644 --- a/test/t/test_mii_tool.py +++ b/test/t/test_mii_tool.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="mii-tool", -) +@pytest.mark.bashcomp(cmd="mii-tool") class TestMiiTool: - @pytest.mark.complete("mii-tool ") def test_1(self, completion): assert completion diff --git a/test/t/test_minicom.py b/test/t/test_minicom.py index d04bd1be220..c004faddc40 100644 --- a/test/t/test_minicom.py +++ b/test/t/test_minicom.py @@ -2,7 +2,6 @@ class TestMinicom: - @pytest.mark.complete("minicom -") def test_1(self, completion): assert completion diff --git a/test/t/test_mkdir.py b/test/t/test_mkdir.py index 3019c3bc62e..a5eb1a549ff 100644 --- a/test/t/test_mkdir.py +++ b/test/t/test_mkdir.py @@ -2,7 +2,6 @@ class TestMkdir: - @pytest.mark.complete("mkdir ") def test_1(self, completion): assert completion diff --git a/test/t/test_mkfifo.py b/test/t/test_mkfifo.py index 1853c150a10..b9e0013c3cf 100644 --- a/test/t/test_mkfifo.py +++ b/test/t/test_mkfifo.py @@ -2,7 +2,6 @@ class TestMkfifo: - @pytest.mark.complete("mkfifo ") def test_1(self, completion): assert completion diff --git a/test/t/test_mkinitrd.py b/test/t/test_mkinitrd.py index c404150bc4b..7305925d1bb 100644 --- a/test/t/test_mkinitrd.py +++ b/test/t/test_mkinitrd.py @@ -2,7 +2,6 @@ class TestMkinitrd: - @pytest.mark.complete("mkinitrd ") def test_1(self, completion): assert completion diff --git a/test/t/test_mkisofs.py b/test/t/test_mkisofs.py index 5d330cb717e..541c6e7eacc 100644 --- a/test/t/test_mkisofs.py +++ b/test/t/test_mkisofs.py @@ -2,7 +2,6 @@ class TestMkisofs: - @pytest.mark.complete("mkisofs ") def test_1(self, completion): assert completion diff --git a/test/t/test_mknod.py b/test/t/test_mknod.py index 3e0d4b60a07..46cb2284d41 100644 --- a/test/t/test_mknod.py +++ b/test/t/test_mknod.py @@ -2,7 +2,6 @@ class TestMknod: - @pytest.mark.complete("mknod ") def test_1(self, completion): assert completion diff --git a/test/t/test_mktemp.py b/test/t/test_mktemp.py index fd99a4d1662..9f61be1cc7f 100644 --- a/test/t/test_mktemp.py +++ b/test/t/test_mktemp.py @@ -2,7 +2,6 @@ class TestMktemp: - @pytest.mark.complete("mktemp -") def test_1(self, completion): assert completion diff --git a/test/t/test_mmsitepass.py b/test/t/test_mmsitepass.py index 7bedcc2aaa9..4dcd9fb05b7 100644 --- a/test/t/test_mmsitepass.py +++ b/test/t/test_mmsitepass.py @@ -2,7 +2,6 @@ class TestMmsitepass: - @pytest.mark.complete("mmsitepass -") def test_1(self, completion): assert completion diff --git a/test/t/test_mock.py b/test/t/test_mock.py index 2bdcf8ef051..7dc5de2a3fd 100644 --- a/test/t/test_mock.py +++ b/test/t/test_mock.py @@ -2,7 +2,6 @@ class TestMock: - @pytest.mark.complete("mock ") def test_1(self, completion): assert completion diff --git a/test/t/test_modinfo.py b/test/t/test_modinfo.py index c8fbbb209ad..4c96eef0291 100644 --- a/test/t/test_modinfo.py +++ b/test/t/test_modinfo.py @@ -4,18 +4,20 @@ class TestModinfo: - @pytest.mark.complete("modinfo -") def test_1(self, completion): assert completion # "in": intel*, ... - @pytest.mark.complete("modinfo in", - skipif="! ls /lib/modules/%s &>/dev/null" % - subprocess.check_output( - "uname -r 2>/dev/null || " - "echo non-existent-kernel", - shell=True).decode().strip()) + @pytest.mark.complete( + "modinfo in", + skipif="! ls /lib/modules/%s &>/dev/null" + % subprocess.check_output( + "uname -r 2>/dev/null || " "echo non-existent-kernel", shell=True + ) + .decode() + .strip(), + ) def test_2(self, completion): assert completion diff --git a/test/t/test_modprobe.py b/test/t/test_modprobe.py index 33b8bfecb75..339240f6ffe 100644 --- a/test/t/test_modprobe.py +++ b/test/t/test_modprobe.py @@ -4,18 +4,20 @@ class TestModprobe: - @pytest.mark.complete("modprobe --al") def test_1(self, completion): assert completion == "--all" # "in": intel*, ... - @pytest.mark.complete("modprobe in", - skipif="! ls /lib/modules/%s &>/dev/null" % - subprocess.check_output( - "uname -r 2>/dev/null || " - "echo non-existent-kernel", - shell=True).decode().strip()) + @pytest.mark.complete( + "modprobe in", + skipif="! ls /lib/modules/%s &>/dev/null" + % subprocess.check_output( + "uname -r 2>/dev/null || " "echo non-existent-kernel", shell=True + ) + .decode() + .strip(), + ) def test_2(self, completion): assert completion diff --git a/test/t/test_module.py b/test/t/test_module.py index 7f2f75e603b..a66dea748db 100644 --- a/test/t/test_module.py +++ b/test/t/test_module.py @@ -2,7 +2,6 @@ class TestModule: - @pytest.mark.complete("module ") def test_1(self, completion): assert completion diff --git a/test/t/test_mogrify.py b/test/t/test_mogrify.py index 1884bb1c1a8..22d84a89178 100644 --- a/test/t/test_mogrify.py +++ b/test/t/test_mogrify.py @@ -2,7 +2,6 @@ class TestMogrify: - @pytest.mark.complete("mogrify ") def test_1(self, completion): assert completion diff --git a/test/t/test_monodevelop.py b/test/t/test_monodevelop.py index dfdad07a1e4..472b1abafc0 100644 --- a/test/t/test_monodevelop.py +++ b/test/t/test_monodevelop.py @@ -2,7 +2,6 @@ class TestMonodevelop: - @pytest.mark.complete("monodevelop ") def test_1(self, completion): assert completion diff --git a/test/t/test_montage.py b/test/t/test_montage.py index 521e82f32e2..1237c7df364 100644 --- a/test/t/test_montage.py +++ b/test/t/test_montage.py @@ -2,7 +2,6 @@ class TestMontage: - @pytest.mark.complete("montage ") def test_1(self, completion): assert completion diff --git a/test/t/test_mount.py b/test/t/test_mount.py index b36d92b3d54..fbd6dcae9f9 100644 --- a/test/t/test_mount.py +++ b/test/t/test_mount.py @@ -2,7 +2,6 @@ class TestMount: - @pytest.mark.complete("mount ") def test_1(self, completion): assert completion @@ -16,7 +15,8 @@ def test_3(self, completion): assert completion == "default/" assert not completion.endswith(" ") - @pytest.mark.complete("mount mocksrv:/", - env=dict(PATH="$PWD/mount/bin:$PATH")) + @pytest.mark.complete( + "mount mocksrv:/", env=dict(PATH="$PWD/mount/bin:$PATH") + ) def test_4(self, completion): assert completion == "/second/path /test/path /test/path2".split() diff --git a/test/t/test_mplayer.py b/test/t/test_mplayer.py index 24c2bc98486..88d7b9f1ea0 100644 --- a/test/t/test_mplayer.py +++ b/test/t/test_mplayer.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "HOME=$PWD/mplayer", - ), -) +@pytest.mark.bashcomp(pre_cmds=("HOME=$PWD/mplayer",)) class TestMplayer: - @pytest.mark.complete("mplayer ") def test_1(self, completion): assert completion diff --git a/test/t/test_mr.py b/test/t/test_mr.py index 41bec5d0860..ab45350bc46 100644 --- a/test/t/test_mr.py +++ b/test/t/test_mr.py @@ -2,7 +2,6 @@ class TestMr: - @pytest.mark.complete("mr ") def test_1(self, completion): assert completion @@ -14,13 +13,15 @@ def test_1(self, completion): def test_2(self, completion): assert completion - @pytest.mark.complete("mr -c shared/default/foo.d/", - skipif="! man -h &>/dev/null") + @pytest.mark.complete( + "mr -c shared/default/foo.d/", skipif="! man -h &>/dev/null" + ) def test_3(self, completion): assert completion == "shared/default/foo.d/foo" - @pytest.mark.complete("mr bootstrap shared/default/", - skipif="! man -h &>/dev/null") + @pytest.mark.complete( + "mr bootstrap shared/default/", skipif="! man -h &>/dev/null" + ) def test_4(self, completion): assert completion == ["bar", "bar bar.d/", "foo", "foo.d/"] diff --git a/test/t/test_msgsnarf.py b/test/t/test_msgsnarf.py index 17a3ea2620f..5ef0fcb7225 100644 --- a/test/t/test_msgsnarf.py +++ b/test/t/test_msgsnarf.py @@ -2,7 +2,6 @@ class TestMsgsnarf: - @pytest.mark.complete("msgsnarf -") def test_1(self, completion): assert completion diff --git a/test/t/test_msynctool.py b/test/t/test_msynctool.py index 3e0a219974f..530d751b6ce 100644 --- a/test/t/test_msynctool.py +++ b/test/t/test_msynctool.py @@ -2,7 +2,6 @@ class TestMsynctool: - @pytest.mark.complete("msynctool ") def test_1(self, completion): assert completion diff --git a/test/t/test_mtx.py b/test/t/test_mtx.py index 6db7ff026b5..6b6f59b55fb 100644 --- a/test/t/test_mtx.py +++ b/test/t/test_mtx.py @@ -2,7 +2,6 @@ class TestMtx: - @pytest.mark.complete("mtx ") def test_1(self, completion): assert completion diff --git a/test/t/test_munin_node_configure.py b/test/t/test_munin_node_configure.py index c99d85aca75..f3f23e7d5dc 100644 --- a/test/t/test_munin_node_configure.py +++ b/test/t/test_munin_node_configure.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="munin-node-configure", -) +@pytest.mark.bashcomp(cmd="munin-node-configure") class TestMuninNodeConfigure: - @pytest.mark.complete("munin-node-configure --libdir ") def test_1(self, completion): assert completion diff --git a/test/t/test_munin_run.py b/test/t/test_munin_run.py index 233ef7735ed..1bcb4d85341 100644 --- a/test/t/test_munin_run.py +++ b/test/t/test_munin_run.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="munin-run", -) +@pytest.mark.bashcomp(cmd="munin-run") class TestMuninRun: - @pytest.mark.complete("munin-run -") def test_1(self, completion): assert completion diff --git a/test/t/test_mussh.py b/test/t/test_mussh.py index cad36be3c58..87dd52a18d8 100644 --- a/test/t/test_mussh.py +++ b/test/t/test_mussh.py @@ -2,7 +2,6 @@ class TestMussh: - @pytest.mark.complete("mussh -") def test_1(self, completion): assert completion diff --git a/test/t/test_mutt.py b/test/t/test_mutt.py index 735337896eb..b490c88b669 100644 --- a/test/t/test_mutt.py +++ b/test/t/test_mutt.py @@ -3,13 +3,8 @@ from conftest import assert_bash_exec -@pytest.mark.bashcomp( - pre_cmds=( - "HOME=$PWD/mutt", - ), -) +@pytest.mark.bashcomp(pre_cmds=("HOME=$PWD/mutt",)) class TestMutt: - @pytest.mark.complete("mutt -") def test_1(self, completion): assert completion @@ -23,9 +18,16 @@ def test_3(self, completion): assert completion == "a1 a2".split() def test_4(self, bash): - got = assert_bash_exec( - bash, - '_muttconffiles "$HOME/muttrc" "$HOME/muttrc"', - want_output=True).strip().split() - assert got == ["%s/mutt/%s" % (bash.cwd, x) for x in - ("muttrc", "bar/muttrc_b", "foo/muttrc_f")] + got = ( + assert_bash_exec( + bash, + '_muttconffiles "$HOME/muttrc" "$HOME/muttrc"', + want_output=True, + ) + .strip() + .split() + ) + assert got == [ + "%s/mutt/%s" % (bash.cwd, x) + for x in ("muttrc", "bar/muttrc_b", "foo/muttrc_f") + ] diff --git a/test/t/test_muttng.py b/test/t/test_muttng.py index 2cf38f07cf4..3ce19ac9ca1 100644 --- a/test/t/test_muttng.py +++ b/test/t/test_muttng.py @@ -2,7 +2,6 @@ class TestMuttng: - @pytest.mark.complete("muttng -") def test_1(self, completion): assert completion diff --git a/test/t/test_mv.py b/test/t/test_mv.py index 21277659c04..a9fc969daa8 100644 --- a/test/t/test_mv.py +++ b/test/t/test_mv.py @@ -2,7 +2,6 @@ class TestMv: - @pytest.mark.complete("mv ") def test_1(self, completion): assert completion diff --git a/test/t/test_mypy.py b/test/t/test_mypy.py index 2a731058acf..2dd1bbc477c 100644 --- a/test/t/test_mypy.py +++ b/test/t/test_mypy.py @@ -2,7 +2,6 @@ class TestMypy: - @pytest.mark.complete("mypy ") def test_1(self, completion): assert completion diff --git a/test/t/test_mysql.py b/test/t/test_mysql.py index d04570e4d4e..67b58e328ca 100644 --- a/test/t/test_mysql.py +++ b/test/t/test_mysql.py @@ -2,7 +2,6 @@ class TestMysql: - @pytest.mark.complete("mysql --") def test_1(self, completion): assert completion diff --git a/test/t/test_mysqladmin.py b/test/t/test_mysqladmin.py index b63f586bb0c..74db63b03b4 100644 --- a/test/t/test_mysqladmin.py +++ b/test/t/test_mysqladmin.py @@ -2,7 +2,6 @@ class TestMysqladmin: - @pytest.mark.complete("mysqladmin -") def test_1(self, completion): assert completion diff --git a/test/t/test_nc.py b/test/t/test_nc.py index 7c07ffa3f3f..6a50106e869 100644 --- a/test/t/test_nc.py +++ b/test/t/test_nc.py @@ -2,7 +2,6 @@ class TestNc: - @pytest.mark.complete("nc -") def test_1(self, completion): assert completion diff --git a/test/t/test_ncftp.py b/test/t/test_ncftp.py index 23b8218ca36..470f6a764ea 100644 --- a/test/t/test_ncftp.py +++ b/test/t/test_ncftp.py @@ -2,7 +2,6 @@ class TestNcftp: - @pytest.mark.complete("ncftp ") def test_1(self, completion): assert completion diff --git a/test/t/test_nethogs.py b/test/t/test_nethogs.py index c45a5946628..a36c587feba 100644 --- a/test/t/test_nethogs.py +++ b/test/t/test_nethogs.py @@ -2,7 +2,6 @@ class TestNethogs: - @pytest.mark.complete("nethogs ") def test_1(self, completion): assert completion diff --git a/test/t/test_netstat.py b/test/t/test_netstat.py index 011b61fe3d7..6bcbd4d2ac4 100644 --- a/test/t/test_netstat.py +++ b/test/t/test_netstat.py @@ -2,7 +2,6 @@ class TestNetstat: - @pytest.mark.complete("netstat ") def test_1(self, completion): assert completion diff --git a/test/t/test_newgrp.py b/test/t/test_newgrp.py index 8f4a14c0c00..7d65a167215 100644 --- a/test/t/test_newgrp.py +++ b/test/t/test_newgrp.py @@ -2,7 +2,6 @@ class TestNewgrp: - @pytest.mark.complete("newgrp ") def test_1(self, completion): assert completion diff --git a/test/t/test_newlist.py b/test/t/test_newlist.py index 17c957fe11f..d51dab26e84 100644 --- a/test/t/test_newlist.py +++ b/test/t/test_newlist.py @@ -2,7 +2,6 @@ class TestNewlist: - @pytest.mark.complete("newlist -") def test_1(self, completion): assert completion diff --git a/test/t/test_newusers.py b/test/t/test_newusers.py index a88411f916e..acd93ad2a2c 100644 --- a/test/t/test_newusers.py +++ b/test/t/test_newusers.py @@ -2,7 +2,6 @@ class TestNewusers: - @pytest.mark.complete("newusers ") def test_1(self, completion): assert completion diff --git a/test/t/test_ngrep.py b/test/t/test_ngrep.py index 63c869041e1..0d29abd7c0c 100644 --- a/test/t/test_ngrep.py +++ b/test/t/test_ngrep.py @@ -2,7 +2,6 @@ class TestNgrep: - @pytest.mark.complete("ngrep -") def test_1(self, completion): assert completion diff --git a/test/t/test_nl.py b/test/t/test_nl.py index fa9c1440800..c3e35b42017 100644 --- a/test/t/test_nl.py +++ b/test/t/test_nl.py @@ -2,7 +2,6 @@ class TestNl: - @pytest.mark.complete("nl ") def test_1(self, completion): assert completion diff --git a/test/t/test_nm.py b/test/t/test_nm.py index fc12ed70343..49ff167ef46 100644 --- a/test/t/test_nm.py +++ b/test/t/test_nm.py @@ -2,7 +2,6 @@ class TestNm: - @pytest.mark.complete("nm ") def test_1(self, completion): assert completion diff --git a/test/t/test_nmap.py b/test/t/test_nmap.py index 198524fc608..a4d8a8990df 100644 --- a/test/t/test_nmap.py +++ b/test/t/test_nmap.py @@ -2,7 +2,6 @@ class TestNmap: - @pytest.mark.complete("nmap --v") def test_1(self, completion): assert completion diff --git a/test/t/test_nmcli.py b/test/t/test_nmcli.py index 8a3a1e44ed0..f2b7950449c 100644 --- a/test/t/test_nmcli.py +++ b/test/t/test_nmcli.py @@ -2,7 +2,6 @@ class TestNmcli: - @pytest.mark.complete("nmcli ") def test_1(self, completion): assert completion diff --git a/test/t/test_nproc.py b/test/t/test_nproc.py index f32ca2d11a6..6ab8017c9c2 100644 --- a/test/t/test_nproc.py +++ b/test/t/test_nproc.py @@ -2,7 +2,6 @@ class TestNproc: - @pytest.mark.complete("nproc ") def test_1(self, completion): assert not completion diff --git a/test/t/test_nslookup.py b/test/t/test_nslookup.py index 1270eac1285..0286509e5c2 100644 --- a/test/t/test_nslookup.py +++ b/test/t/test_nslookup.py @@ -2,7 +2,6 @@ class TestNslookup: - @pytest.mark.complete("nslookup -") def test_1(self, completion): assert completion diff --git a/test/t/test_nsupdate.py b/test/t/test_nsupdate.py index 0fe43608ad3..5bae97075cb 100644 --- a/test/t/test_nsupdate.py +++ b/test/t/test_nsupdate.py @@ -2,7 +2,6 @@ class TestNsupdate: - @pytest.mark.complete("nsupdate ") def test_1(self, completion): assert completion diff --git a/test/t/test_ntpdate.py b/test/t/test_ntpdate.py index dc810f422b2..dc1d5b48ec2 100644 --- a/test/t/test_ntpdate.py +++ b/test/t/test_ntpdate.py @@ -2,7 +2,6 @@ class TestNtpdate: - @pytest.mark.complete("ntpdate -") def test_1(self, completion): assert completion diff --git a/test/t/test_objcopy.py b/test/t/test_objcopy.py index a757197107c..13a93df587f 100644 --- a/test/t/test_objcopy.py +++ b/test/t/test_objcopy.py @@ -2,7 +2,6 @@ class TestObjcopy: - @pytest.mark.complete("objcopy ") def test_1(self, completion): assert completion diff --git a/test/t/test_objdump.py b/test/t/test_objdump.py index f2d5c48b883..6b8bc7442c1 100644 --- a/test/t/test_objdump.py +++ b/test/t/test_objdump.py @@ -2,7 +2,6 @@ class TestObjdump: - @pytest.mark.complete("objdump ") def test_1(self, completion): assert completion diff --git a/test/t/test_od.py b/test/t/test_od.py index 9a9312d53bc..a1e648a864b 100644 --- a/test/t/test_od.py +++ b/test/t/test_od.py @@ -2,7 +2,6 @@ class TestOd: - @pytest.mark.complete("od ") def test_1(self, completion): assert completion diff --git a/test/t/test_oggdec.py b/test/t/test_oggdec.py index fde8b08f08a..8cabe5cd47e 100644 --- a/test/t/test_oggdec.py +++ b/test/t/test_oggdec.py @@ -2,7 +2,6 @@ class TestOggdec: - @pytest.mark.complete("oggdec ") def test_1(self, completion): assert completion diff --git a/test/t/test_op.py b/test/t/test_op.py index 6f24abc0955..e09c98c8f60 100644 --- a/test/t/test_op.py +++ b/test/t/test_op.py @@ -2,7 +2,6 @@ class TestOp: - @pytest.mark.complete("op ") def test_1(self, completion): assert completion diff --git a/test/t/test_openssl.py b/test/t/test_openssl.py index 69b7af150c2..e3af35307ef 100644 --- a/test/t/test_openssl.py +++ b/test/t/test_openssl.py @@ -2,7 +2,6 @@ class TestOpenssl: - @pytest.mark.complete("openssl ") def test_1(self, completion): assert completion diff --git a/test/t/test_opera.py b/test/t/test_opera.py index d6573e311e1..5ab056f4cfa 100644 --- a/test/t/test_opera.py +++ b/test/t/test_opera.py @@ -2,7 +2,6 @@ class TestOpera: - @pytest.mark.complete("opera ") def test_1(self, completion): assert completion diff --git a/test/t/test_optipng.py b/test/t/test_optipng.py index cac14805987..393b0645af9 100644 --- a/test/t/test_optipng.py +++ b/test/t/test_optipng.py @@ -2,7 +2,6 @@ class TestOptipng: - @pytest.mark.complete("optipng ") def test_1(self, completion): assert completion diff --git a/test/t/test_p4.py b/test/t/test_p4.py index 691ad465644..876d261e90a 100644 --- a/test/t/test_p4.py +++ b/test/t/test_p4.py @@ -2,7 +2,6 @@ class TestP4: - @pytest.mark.complete("p4 ") def test_1(self, completion): assert completion diff --git a/test/t/test_pack200.py b/test/t/test_pack200.py index 35b2b122ccb..0960133a404 100644 --- a/test/t/test_pack200.py +++ b/test/t/test_pack200.py @@ -2,7 +2,6 @@ class TestPack200: - @pytest.mark.complete("pack200 ") def test_1(self, completion): assert completion diff --git a/test/t/test_passwd.py b/test/t/test_passwd.py index 4f75d65de3c..60441de9d49 100644 --- a/test/t/test_passwd.py +++ b/test/t/test_passwd.py @@ -2,7 +2,6 @@ class TestPasswd: - @pytest.mark.complete("passwd ") def test_1(self, completion): assert completion diff --git a/test/t/test_paste.py b/test/t/test_paste.py index fa30abe0f18..2d551322973 100644 --- a/test/t/test_paste.py +++ b/test/t/test_paste.py @@ -2,7 +2,6 @@ class TestPaste: - @pytest.mark.complete("paste ") def test_1(self, completion): assert completion diff --git a/test/t/test_patch.py b/test/t/test_patch.py index dec96de0c7d..455ebd9a33f 100644 --- a/test/t/test_patch.py +++ b/test/t/test_patch.py @@ -2,7 +2,6 @@ class TestPatch: - @pytest.mark.complete("patch ") def test_1(self, completion): assert completion diff --git a/test/t/test_pdftotext.py b/test/t/test_pdftotext.py index 10876dcead0..9e332f06d5e 100644 --- a/test/t/test_pdftotext.py +++ b/test/t/test_pdftotext.py @@ -2,7 +2,6 @@ class TestPdftotext: - @pytest.mark.complete("pdftotext ") def test_1(self, completion): assert completion diff --git a/test/t/test_perl.py b/test/t/test_perl.py index a13ab7d9297..7c0c6094024 100644 --- a/test/t/test_perl.py +++ b/test/t/test_perl.py @@ -3,7 +3,6 @@ @pytest.mark.bashcomp(ignore_env=r"^\+PERL5LIB=") class TestPerl: - @pytest.mark.complete("perl ") def test_1(self, completion): assert completion diff --git a/test/t/test_perlcritic.py b/test/t/test_perlcritic.py index e22f2e48384..cc4ef25fd7a 100644 --- a/test/t/test_perlcritic.py +++ b/test/t/test_perlcritic.py @@ -2,7 +2,6 @@ class TestPerlcritic: - @pytest.mark.complete("perlcritic ") def test_1(self, completion): assert completion diff --git a/test/t/test_perldoc.py b/test/t/test_perldoc.py index f350e4e0680..9f772944ade 100644 --- a/test/t/test_perldoc.py +++ b/test/t/test_perldoc.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "export PERL5LIB=$PWD/perldoc", - ), -) +@pytest.mark.bashcomp(pre_cmds=("export PERL5LIB=$PWD/perldoc",)) class TestPerldoc: - @pytest.mark.complete("perldoc File::") def test_1(self, completion): assert "Path" in completion # Assume File::Path always installed diff --git a/test/t/test_perltidy.py b/test/t/test_perltidy.py index c1c40549461..3bafd6e4ddb 100644 --- a/test/t/test_perltidy.py +++ b/test/t/test_perltidy.py @@ -2,7 +2,6 @@ class TestPerltidy: - @pytest.mark.complete("perltidy ") def test_1(self, completion): assert completion diff --git a/test/t/test_phing.py b/test/t/test_phing.py index 33ffd977851..6caef26d715 100644 --- a/test/t/test_phing.py +++ b/test/t/test_phing.py @@ -2,7 +2,6 @@ class TestPhing: - @pytest.mark.complete("phing -") def test_1(self, completion): assert completion diff --git a/test/t/test_pine.py b/test/t/test_pine.py index 055e6779c63..2c5549e05ba 100644 --- a/test/t/test_pine.py +++ b/test/t/test_pine.py @@ -2,7 +2,6 @@ class TestPine: - @pytest.mark.complete("pine -") def test_1(self, completion): assert completion diff --git a/test/t/test_pinfo.py b/test/t/test_pinfo.py index 24da55393e7..b502273f765 100644 --- a/test/t/test_pinfo.py +++ b/test/t/test_pinfo.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "INFOPATH+=:$PWD/info:", - ), -) +@pytest.mark.bashcomp(pre_cmds=("INFOPATH+=:$PWD/info:",)) class TestPinfo: - @pytest.mark.complete("pinfo -") def test_1(self, completion): assert completion diff --git a/test/t/test_ping.py b/test/t/test_ping.py index 86f1318c43b..e7c77365e99 100644 --- a/test/t/test_ping.py +++ b/test/t/test_ping.py @@ -2,7 +2,6 @@ class TestPing: - @pytest.mark.complete("ping ") def test_1(self, completion): assert completion diff --git a/test/t/test_pkg_config.py b/test/t/test_pkg_config.py index e38d5380808..a0703e09eb2 100644 --- a/test/t/test_pkg_config.py +++ b/test/t/test_pkg_config.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="pkg-config", -) +@pytest.mark.bashcomp(cmd="pkg-config") class TestPkgConfig: - @pytest.mark.complete("pkg-config ") def test_1(self, completion): assert completion diff --git a/test/t/test_pkg_deinstall.py b/test/t/test_pkg_deinstall.py index 825ed05a1db..5ce6d13ee31 100644 --- a/test/t/test_pkg_deinstall.py +++ b/test/t/test_pkg_deinstall.py @@ -3,15 +3,13 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "PKG_DBDIR=$PWD/pkgtools/db", - ), -) +@pytest.mark.bashcomp(pre_cmds=("PKG_DBDIR=$PWD/pkgtools/db",)) class TestPkgDeinstall: - @pytest.mark.complete("pkg_deinstall ") def test_1(self, completion): - dirs = sorted(x for x in os.listdir("pkgtools/db") - if os.path.isdir("pkgtools/db/%s" % x)) + dirs = sorted( + x + for x in os.listdir("pkgtools/db") + if os.path.isdir("pkgtools/db/%s" % x) + ) assert completion == dirs diff --git a/test/t/test_pkg_delete.py b/test/t/test_pkg_delete.py index c0f255ad449..a4b0d8552aa 100644 --- a/test/t/test_pkg_delete.py +++ b/test/t/test_pkg_delete.py @@ -2,7 +2,6 @@ class TestPkgDelete: - @pytest.mark.complete("pkg_delete ") def test_1(self, completion): assert completion diff --git a/test/t/test_pkg_get.py b/test/t/test_pkg_get.py index c07d2dbd8e1..cb2d2834450 100644 --- a/test/t/test_pkg_get.py +++ b/test/t/test_pkg_get.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="pkg-get", -) +@pytest.mark.bashcomp(cmd="pkg-get") class TestPkgGet: - @pytest.mark.complete("pkg-get ") def test_1(self, completion): assert completion diff --git a/test/t/test_pkg_info.py b/test/t/test_pkg_info.py index 6496f0cff77..6011f814a25 100644 --- a/test/t/test_pkg_info.py +++ b/test/t/test_pkg_info.py @@ -2,7 +2,6 @@ class TestPkgInfo: - @pytest.mark.complete("pkg_info ") def test_1(self, completion): assert completion diff --git a/test/t/test_pkgadd.py b/test/t/test_pkgadd.py index 4ed73a87eaa..ca6baf27d3e 100644 --- a/test/t/test_pkgadd.py +++ b/test/t/test_pkgadd.py @@ -2,7 +2,6 @@ class TestPkgadd: - @pytest.mark.complete("pkgadd ") def test_1(self, completion): assert completion diff --git a/test/t/test_pkgrm.py b/test/t/test_pkgrm.py index 477eb6d5208..9cb73571abd 100644 --- a/test/t/test_pkgrm.py +++ b/test/t/test_pkgrm.py @@ -2,7 +2,6 @@ class TestPkgrm: - @pytest.mark.complete("pkgrm ") def test_1(self, completion): assert completion diff --git a/test/t/test_pkgtool.py b/test/t/test_pkgtool.py index c0adeef98b4..7d3563778aa 100644 --- a/test/t/test_pkgtool.py +++ b/test/t/test_pkgtool.py @@ -2,7 +2,6 @@ class TestPkgtool: - @pytest.mark.complete("pkgtool -") def test_1(self, completion): assert completion diff --git a/test/t/test_pkgutil.py b/test/t/test_pkgutil.py index b370eadb9ef..9664728558e 100644 --- a/test/t/test_pkgutil.py +++ b/test/t/test_pkgutil.py @@ -2,7 +2,6 @@ class TestPkgutil: - @pytest.mark.complete("pkgutil ") def test_1(self, completion): assert completion diff --git a/test/t/test_pkill.py b/test/t/test_pkill.py index 1c193fe0d9b..b0af6c3dc9b 100644 --- a/test/t/test_pkill.py +++ b/test/t/test_pkill.py @@ -2,7 +2,6 @@ class TestPkill: - @pytest.mark.complete("pkill ") def test_1(self, completion): assert completion diff --git a/test/t/test_plague_client.py b/test/t/test_plague_client.py index 47e56ca7f23..39eac93d148 100644 --- a/test/t/test_plague_client.py +++ b/test/t/test_plague_client.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="plague-client", -) +@pytest.mark.bashcomp(cmd="plague-client") class TestPlagueClient: - @pytest.mark.complete("plague-client ") def test_1(self, completion): assert completion diff --git a/test/t/test_pm_hibernate.py b/test/t/test_pm_hibernate.py index d6b0cbe10a5..31b4625e32c 100644 --- a/test/t/test_pm_hibernate.py +++ b/test/t/test_pm_hibernate.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="pm-hibernate", -) +@pytest.mark.bashcomp(cmd="pm-hibernate") class TestPmHibernate: - @pytest.mark.complete("pm-hibernate -") def test_1(self, completion): assert completion diff --git a/test/t/test_pm_is_supported.py b/test/t/test_pm_is_supported.py index 19ebed97dd6..47f064a4ce9 100644 --- a/test/t/test_pm_is_supported.py +++ b/test/t/test_pm_is_supported.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="pm-is-supported", -) +@pytest.mark.bashcomp(cmd="pm-is-supported") class TestPmIsSupported: - @pytest.mark.complete("pm-is-supported -") def test_1(self, completion): assert completion diff --git a/test/t/test_pm_powersave.py b/test/t/test_pm_powersave.py index 96d5407014f..7630a412090 100644 --- a/test/t/test_pm_powersave.py +++ b/test/t/test_pm_powersave.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="pm-powersave", -) +@pytest.mark.bashcomp(cmd="pm-powersave") class TestPmPowersave: - @pytest.mark.complete("pm-powersave ") def test_1(self, completion): assert completion diff --git a/test/t/test_pngfix.py b/test/t/test_pngfix.py index f8099c8efe5..e27f3293770 100644 --- a/test/t/test_pngfix.py +++ b/test/t/test_pngfix.py @@ -2,7 +2,6 @@ class TestPngfix: - @pytest.mark.complete("pngfix ") def test_1(self, completion): assert completion diff --git a/test/t/test_portinstall.py b/test/t/test_portinstall.py index a4ddde4a13a..62fddbfbe30 100644 --- a/test/t/test_portinstall.py +++ b/test/t/test_portinstall.py @@ -4,18 +4,23 @@ class TestPortinstall: - @pytest.fixture(scope="class") def portsdir(self, request, bash): assert_bash_exec(bash, "PORTSDIR=$TESTDIR/tmp") - assert_bash_exec(bash, "command sed -e s,PORTSDIR,$PORTSDIR,g " - "pkgtools/ports/INDEX.dist >$PORTSDIR/INDEX") + assert_bash_exec( + bash, + "command sed -e s,PORTSDIR,$PORTSDIR,g " + "pkgtools/ports/INDEX.dist >$PORTSDIR/INDEX", + ) assert_bash_exec(bash, "cp $PORTSDIR/INDEX $PORTSDIR/INDEX-5") request.addfinalizer( - lambda: assert_bash_exec(bash, "rm $PORTSDIR/INDEX{,-5}")) + lambda: assert_bash_exec(bash, "rm $PORTSDIR/INDEX{,-5}") + ) @pytest.mark.complete("portinstall ", env=dict(PORTSDIR="$TESTDIR/tmp")) def test_1(self, completion, portsdir): - assert completion == \ - "bash-2.05b.007_6 bash-3.1.17 bash-completion-20060301_2 " \ + assert ( + completion + == "bash-2.05b.007_6 bash-3.1.17 bash-completion-20060301_2 " "shells/bash shells/bash-completion shells/bash2".split() + ) diff --git a/test/t/test_portsnap.py b/test/t/test_portsnap.py index 572dd409792..4f5878e97ba 100644 --- a/test/t/test_portsnap.py +++ b/test/t/test_portsnap.py @@ -2,7 +2,6 @@ class TestPortsnap: - @pytest.mark.complete("portsnap ") def test_1(self, completion): assert completion diff --git a/test/t/test_portupgrade.py b/test/t/test_portupgrade.py index 0125916d6b5..aaff5c10198 100644 --- a/test/t/test_portupgrade.py +++ b/test/t/test_portupgrade.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "PKG_DBDIR=$PWD/dbtools/db", - ), -) +@pytest.mark.bashcomp(pre_cmds=("PKG_DBDIR=$PWD/dbtools/db",)) class TestPortupgrade: - @pytest.mark.complete("portupgrade ") def test_1(self, completion): assert completion == "a b-c-d".split() diff --git a/test/t/test_postcat.py b/test/t/test_postcat.py index 6409ef29c94..653cca2522c 100644 --- a/test/t/test_postcat.py +++ b/test/t/test_postcat.py @@ -2,7 +2,6 @@ class TestPostcat: - @pytest.mark.complete("postcat ") def test_1(self, completion): assert completion diff --git a/test/t/test_postconf.py b/test/t/test_postconf.py index df917fb9da2..641b27340dd 100644 --- a/test/t/test_postconf.py +++ b/test/t/test_postconf.py @@ -2,7 +2,6 @@ class TestPostconf: - @pytest.mark.complete("postconf -") def test_1(self, completion): assert len(completion) > 1 diff --git a/test/t/test_postfix.py b/test/t/test_postfix.py index 2530992fb88..f7af7b4cce9 100644 --- a/test/t/test_postfix.py +++ b/test/t/test_postfix.py @@ -2,7 +2,6 @@ class TestPostfix: - @pytest.mark.complete("postfix ") def test_1(self, completion): assert completion diff --git a/test/t/test_postmap.py b/test/t/test_postmap.py index fc248d4f28f..f3430fbdbcc 100644 --- a/test/t/test_postmap.py +++ b/test/t/test_postmap.py @@ -2,7 +2,6 @@ class TestPostmap: - @pytest.mark.complete("postmap ") def test_1(self, completion): assert completion diff --git a/test/t/test_postsuper.py b/test/t/test_postsuper.py index a22b6d59ddb..b74de8ec433 100644 --- a/test/t/test_postsuper.py +++ b/test/t/test_postsuper.py @@ -2,7 +2,6 @@ class TestPostsuper: - @pytest.mark.complete("postsuper ") def test_1(self, completion): assert completion diff --git a/test/t/test_povray.py b/test/t/test_povray.py index d7dbc7b5a14..99d08ea0f13 100644 --- a/test/t/test_povray.py +++ b/test/t/test_povray.py @@ -2,7 +2,6 @@ class TestPovray: - @pytest.mark.complete("povray ") def test_1(self, completion): assert completion diff --git a/test/t/test_pr.py b/test/t/test_pr.py index 843084e8e8e..cb023ea089b 100644 --- a/test/t/test_pr.py +++ b/test/t/test_pr.py @@ -2,7 +2,6 @@ class TestPr: - @pytest.mark.complete("pr ") def test_1(self, completion): assert completion diff --git a/test/t/test_prelink.py b/test/t/test_prelink.py index 504c78aae6b..ef8baecedcb 100644 --- a/test/t/test_prelink.py +++ b/test/t/test_prelink.py @@ -2,7 +2,6 @@ class TestPrelink: - @pytest.mark.complete("prelink ") def test_1(self, completion): assert completion diff --git a/test/t/test_protoc.py b/test/t/test_protoc.py index cba7e313a7a..65549d357d5 100644 --- a/test/t/test_protoc.py +++ b/test/t/test_protoc.py @@ -2,7 +2,6 @@ class TestProtoc: - @pytest.mark.complete("protoc ") def test_1(self, completion): assert completion diff --git a/test/t/test_psql.py b/test/t/test_psql.py index 3b115d776e4..60ed097c8d7 100644 --- a/test/t/test_psql.py +++ b/test/t/test_psql.py @@ -4,7 +4,6 @@ class TestPsql: # --help can fail due to missing package dependencies, e.g. on Ubuntu 14 - @pytest.mark.complete("psql -", - skipif="! psql --help &>/dev/null") + @pytest.mark.complete("psql -", skipif="! psql --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_ptx.py b/test/t/test_ptx.py index e40e0c75778..2eea63bca1a 100644 --- a/test/t/test_ptx.py +++ b/test/t/test_ptx.py @@ -2,7 +2,6 @@ class TestPtx: - @pytest.mark.complete("ptx ") def test_1(self, completion): assert completion diff --git a/test/t/test_puppet.py b/test/t/test_puppet.py index 8cf67281a0d..470f33a2769 100644 --- a/test/t/test_puppet.py +++ b/test/t/test_puppet.py @@ -2,7 +2,6 @@ class TestPuppet: - @pytest.mark.complete("puppet ") def test_1(self, completion): assert completion diff --git a/test/t/test_pushd.py b/test/t/test_pushd.py index 19d2d9c781e..290e1d1d485 100644 --- a/test/t/test_pushd.py +++ b/test/t/test_pushd.py @@ -2,7 +2,6 @@ class TestPushd: - @pytest.mark.complete("pushd ") def test_1(self, completion): assert completion diff --git a/test/t/test_pv.py b/test/t/test_pv.py index e9bb7051f00..ffca68df564 100644 --- a/test/t/test_pv.py +++ b/test/t/test_pv.py @@ -2,7 +2,6 @@ class TestPv: - @pytest.mark.complete("pv ") def test_1(self, completion): assert completion diff --git a/test/t/test_pvchange.py b/test/t/test_pvchange.py index d3cac47b7a4..78e534ac720 100644 --- a/test/t/test_pvchange.py +++ b/test/t/test_pvchange.py @@ -2,8 +2,8 @@ class TestPvchange: - - @pytest.mark.complete("pvchange --", - skipif="! pvchange --help &>/dev/null") + @pytest.mark.complete( + "pvchange --", skipif="! pvchange --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_pvcreate.py b/test/t/test_pvcreate.py index 87cda0df679..372b9e39cdf 100644 --- a/test/t/test_pvcreate.py +++ b/test/t/test_pvcreate.py @@ -2,8 +2,8 @@ class TestPvcreate: - - @pytest.mark.complete("pvcreate --", - skipif="! pvcreate --help &>/dev/null") + @pytest.mark.complete( + "pvcreate --", skipif="! pvcreate --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_pvdisplay.py b/test/t/test_pvdisplay.py index ad71e900fbe..e5fa07f62a5 100644 --- a/test/t/test_pvdisplay.py +++ b/test/t/test_pvdisplay.py @@ -2,8 +2,8 @@ class TestPvdisplay: - - @pytest.mark.complete("pvdisplay --", - skipif="! pvdisplay --help &>/dev/null") + @pytest.mark.complete( + "pvdisplay --", skipif="! pvdisplay --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_pvmove.py b/test/t/test_pvmove.py index c7f8bb24ff6..e1b06dd6547 100644 --- a/test/t/test_pvmove.py +++ b/test/t/test_pvmove.py @@ -2,7 +2,6 @@ class TestPvmove: - @pytest.mark.complete("pvmove --") def test_1(self, completion): assert completion diff --git a/test/t/test_pvremove.py b/test/t/test_pvremove.py index 421c4657868..08bf63b0070 100644 --- a/test/t/test_pvremove.py +++ b/test/t/test_pvremove.py @@ -2,8 +2,8 @@ class TestPvremove: - - @pytest.mark.complete("pvremove --", - skipif="! pvremove --help &>/dev/null") + @pytest.mark.complete( + "pvremove --", skipif="! pvremove --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_pvs.py b/test/t/test_pvs.py index a2ce84f0506..6063888e587 100644 --- a/test/t/test_pvs.py +++ b/test/t/test_pvs.py @@ -2,8 +2,6 @@ class TestPvs: - - @pytest.mark.complete("pvs --", - skipif="! pvs --help &>/dev/null") + @pytest.mark.complete("pvs --", skipif="! pvs --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_pvscan.py b/test/t/test_pvscan.py index 8f2021dc3eb..1ae237fc5af 100644 --- a/test/t/test_pvscan.py +++ b/test/t/test_pvscan.py @@ -2,7 +2,6 @@ class TestPvscan: - @pytest.mark.complete("pvscan --") def test_1(self, completion): assert completion diff --git a/test/t/test_pwck.py b/test/t/test_pwck.py index 777d9d0602d..143c76f13f7 100644 --- a/test/t/test_pwck.py +++ b/test/t/test_pwck.py @@ -2,7 +2,6 @@ class TestPwck: - @pytest.mark.complete("pwck ") def test_1(self, completion): assert completion diff --git a/test/t/test_pwd.py b/test/t/test_pwd.py index b2de0d84f88..b1ec337829b 100644 --- a/test/t/test_pwd.py +++ b/test/t/test_pwd.py @@ -2,7 +2,6 @@ class TestPwd: - @pytest.mark.complete("pwd -") def test_1(self, completion): assert completion diff --git a/test/t/test_pwdx.py b/test/t/test_pwdx.py index ecf2d8973f5..411d7a59cb4 100644 --- a/test/t/test_pwdx.py +++ b/test/t/test_pwdx.py @@ -2,7 +2,6 @@ class TestPwdx: - @pytest.mark.complete("pwdx ") def test_1(self, completion): assert completion diff --git a/test/t/test_pwgen.py b/test/t/test_pwgen.py index 9ed61e13512..54c194cfb8b 100644 --- a/test/t/test_pwgen.py +++ b/test/t/test_pwgen.py @@ -2,7 +2,6 @@ class TestPwgen: - @pytest.mark.complete("pwgen -") def test_1(self, completion): assert completion diff --git a/test/t/test_pycodestyle.py b/test/t/test_pycodestyle.py index 1c3211a166e..03c58eec161 100644 --- a/test/t/test_pycodestyle.py +++ b/test/t/test_pycodestyle.py @@ -2,7 +2,6 @@ class TestPycodestyle: - @pytest.mark.complete("pycodestyle ") def test_1(self, completion): assert completion diff --git a/test/t/test_pydoc.py b/test/t/test_pydoc.py index 3ffe19dc262..e61736765e9 100644 --- a/test/t/test_pydoc.py +++ b/test/t/test_pydoc.py @@ -2,7 +2,6 @@ class TestPydoc: - @pytest.mark.complete("pydoc r") def test_1(self, completion): assert completion diff --git a/test/t/test_pydocstyle.py b/test/t/test_pydocstyle.py index 7b7a6f29118..4deb45fe168 100644 --- a/test/t/test_pydocstyle.py +++ b/test/t/test_pydocstyle.py @@ -2,7 +2,6 @@ class TestPydocstyle: - @pytest.mark.complete("pydocstyle ") def test_1(self, completion): assert completion diff --git a/test/t/test_pyflakes.py b/test/t/test_pyflakes.py index 06d3d65698e..ae3853a7e37 100644 --- a/test/t/test_pyflakes.py +++ b/test/t/test_pyflakes.py @@ -2,7 +2,6 @@ class TestPyflakes: - @pytest.mark.complete("pyflakes ") def test_1(self, completion): assert completion diff --git a/test/t/test_pylint.py b/test/t/test_pylint.py index 975024a369d..e08507aa597 100644 --- a/test/t/test_pylint.py +++ b/test/t/test_pylint.py @@ -2,7 +2,6 @@ class TestPylint: - @pytest.mark.complete("pylint --v") def test_1(self, completion): assert completion diff --git a/test/t/test_pylint_3.py b/test/t/test_pylint_3.py index a071c900446..305db7d36e0 100644 --- a/test/t/test_pylint_3.py +++ b/test/t/test_pylint_3.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="pylint-3", -) +@pytest.mark.bashcomp(cmd="pylint-3") class TestPylint3: - @pytest.mark.complete("pylint-3 --v") def test_1(self, completion): assert completion diff --git a/test/t/test_pytest.py b/test/t/test_pytest.py index 32889c11c85..69d01820984 100644 --- a/test/t/test_pytest.py +++ b/test/t/test_pytest.py @@ -2,7 +2,6 @@ class TestPytest: - @pytest.mark.complete("pytest ") def test_1(self, completion): assert completion diff --git a/test/t/test_python.py b/test/t/test_python.py index b06eb36bf4b..4990f957b49 100644 --- a/test/t/test_python.py +++ b/test/t/test_python.py @@ -2,7 +2,6 @@ class TestPython: - @pytest.mark.complete("python ") def test_1(self, completion): assert completion diff --git a/test/t/test_python3.py b/test/t/test_python3.py index ef0c546bc66..3f2b5f9e235 100644 --- a/test/t/test_python3.py +++ b/test/t/test_python3.py @@ -2,7 +2,6 @@ class TestPython3: - @pytest.mark.complete("python3 ") def test_1(self, completion): assert completion diff --git a/test/t/test_pyvenv.py b/test/t/test_pyvenv.py index 9661e396795..5e9152a59b1 100644 --- a/test/t/test_pyvenv.py +++ b/test/t/test_pyvenv.py @@ -2,7 +2,6 @@ class TestPyvenv: - @pytest.mark.complete("pyvenv ") def test_1(self, completion): assert completion diff --git a/test/t/test_qemu.py b/test/t/test_qemu.py index ca6b16fac6b..3be6f64bf3e 100644 --- a/test/t/test_qemu.py +++ b/test/t/test_qemu.py @@ -2,7 +2,6 @@ class TestQemu: - @pytest.mark.complete("qemu ") def test_1(self, completion): assert completion diff --git a/test/t/test_qrunner.py b/test/t/test_qrunner.py index b3b7bca358d..4e4cdd8dc4b 100644 --- a/test/t/test_qrunner.py +++ b/test/t/test_qrunner.py @@ -2,7 +2,6 @@ class TestQrunner: - @pytest.mark.complete("qrunner -") def test_1(self, completion): assert completion diff --git a/test/t/test_querybts.py b/test/t/test_querybts.py index 267a4e5bc47..dd3af4f9184 100644 --- a/test/t/test_querybts.py +++ b/test/t/test_querybts.py @@ -2,7 +2,6 @@ class TestQuerybts: - @pytest.mark.complete("querybts --") def test_1(self, completion): assert completion diff --git a/test/t/test_quota.py b/test/t/test_quota.py index 538c7a8ac79..750988759b2 100644 --- a/test/t/test_quota.py +++ b/test/t/test_quota.py @@ -2,7 +2,6 @@ class TestQuota: - @pytest.mark.complete("quota ") def test_1(self, completion): assert completion diff --git a/test/t/test_quotacheck.py b/test/t/test_quotacheck.py index fb60653f644..0311befb442 100644 --- a/test/t/test_quotacheck.py +++ b/test/t/test_quotacheck.py @@ -2,7 +2,6 @@ class TestQuotacheck: - @pytest.mark.complete("quotacheck -") def test_1(self, completion): assert completion diff --git a/test/t/test_quotaon.py b/test/t/test_quotaon.py index 3cb6ca0181a..46bf55460ee 100644 --- a/test/t/test_quotaon.py +++ b/test/t/test_quotaon.py @@ -2,7 +2,6 @@ class TestQuotaon: - @pytest.mark.complete("quotaon -") def test_1(self, completion): assert completion diff --git a/test/t/test_radvdump.py b/test/t/test_radvdump.py index 11b52a4f669..e3d9242d485 100644 --- a/test/t/test_radvdump.py +++ b/test/t/test_radvdump.py @@ -2,7 +2,6 @@ class TestRadvdump: - @pytest.mark.complete("radvdump ") def test_1(self, completion): assert completion diff --git a/test/t/test_rcs.py b/test/t/test_rcs.py index e15abf21fa6..985bb44fae7 100644 --- a/test/t/test_rcs.py +++ b/test/t/test_rcs.py @@ -2,7 +2,6 @@ class TestRcs: - @pytest.mark.complete("rcs ") def test_1(self, completion): assert completion diff --git a/test/t/test_rcsdiff.py b/test/t/test_rcsdiff.py index d569f0a6830..d54934c7e41 100644 --- a/test/t/test_rcsdiff.py +++ b/test/t/test_rcsdiff.py @@ -2,7 +2,6 @@ class TestRcsdiff: - @pytest.mark.complete("rcsdiff ") def test_1(self, completion): assert completion diff --git a/test/t/test_rdesktop.py b/test/t/test_rdesktop.py index 2bc76c07261..b82b471ed21 100644 --- a/test/t/test_rdesktop.py +++ b/test/t/test_rdesktop.py @@ -2,7 +2,6 @@ class TestRdesktop: - @pytest.mark.complete("rdesktop -") def test_1(self, completion): assert completion diff --git a/test/t/test_rdict.py b/test/t/test_rdict.py index 3c7a76b94ee..86d7c087d97 100644 --- a/test/t/test_rdict.py +++ b/test/t/test_rdict.py @@ -2,7 +2,6 @@ class TestRdict: - @pytest.mark.complete("rdict --") def test_1(self, completion): assert completion diff --git a/test/t/test_readelf.py b/test/t/test_readelf.py index 9cfca05bb9f..5c5dff371b5 100644 --- a/test/t/test_readelf.py +++ b/test/t/test_readelf.py @@ -2,7 +2,6 @@ class TestReadelf: - @pytest.mark.complete("readelf --") def test_1(self, completion): assert completion diff --git a/test/t/test_readonly.py b/test/t/test_readonly.py index 32a5b9db7c9..0ac310c25e0 100644 --- a/test/t/test_readonly.py +++ b/test/t/test_readonly.py @@ -2,7 +2,6 @@ class TestReadonly: - @pytest.mark.complete("readonly BASH_ARG") def test_1(self, completion): assert completion diff --git a/test/t/test_remove_members.py b/test/t/test_remove_members.py index 0521def1a1c..a3b0afd69ce 100644 --- a/test/t/test_remove_members.py +++ b/test/t/test_remove_members.py @@ -2,7 +2,6 @@ class TestRemoveMembers: - @pytest.mark.complete("remove_members --") def test_1(self, completion): assert completion diff --git a/test/t/test_removepkg.py b/test/t/test_removepkg.py index e706a8e2b36..9fd7a9d8d8a 100644 --- a/test/t/test_removepkg.py +++ b/test/t/test_removepkg.py @@ -5,7 +5,6 @@ @pytest.mark.bashcomp(ignore_env=r"^\+ROOT=") class TestRemovepkg: - @pytest.mark.complete("removepkg -") def test_1(self, completion): assert completion == "-copy -keep -preserve -warn".split() diff --git a/test/t/test_renice.py b/test/t/test_renice.py index 723124f0951..20d59a3387f 100644 --- a/test/t/test_renice.py +++ b/test/t/test_renice.py @@ -2,7 +2,6 @@ class TestRenice: - @pytest.mark.complete("renice 1") def test_1(self, completion): assert completion diff --git a/test/t/test_repomanage.py b/test/t/test_repomanage.py index f50025f71de..6def4a8c17d 100644 --- a/test/t/test_repomanage.py +++ b/test/t/test_repomanage.py @@ -2,7 +2,6 @@ class TestRepomanage: - @pytest.mark.complete("repomanage ") def test_1(self, completion): assert completion diff --git a/test/t/test_reportbug.py b/test/t/test_reportbug.py index 79e7a729662..612a96b8149 100644 --- a/test/t/test_reportbug.py +++ b/test/t/test_reportbug.py @@ -2,7 +2,6 @@ class TestReportbug: - @pytest.mark.complete("reportbug --m") def test_1(self, completion): assert completion diff --git a/test/t/test_reptyr.py b/test/t/test_reptyr.py index c737f1b24a1..62a9b1c5f0b 100644 --- a/test/t/test_reptyr.py +++ b/test/t/test_reptyr.py @@ -2,7 +2,6 @@ class TestReptyr: - @pytest.mark.complete("reptyr ") def test_1(self, completion): assert completion diff --git a/test/t/test_resolvconf.py b/test/t/test_resolvconf.py index 45ea053279e..fdcf584fdaa 100644 --- a/test/t/test_resolvconf.py +++ b/test/t/test_resolvconf.py @@ -2,7 +2,6 @@ class TestResolvconf: - @pytest.mark.complete("resolvconf -") def test_1(self, completion): assert completion diff --git a/test/t/test_rfcomm.py b/test/t/test_rfcomm.py index 4c3ab1526df..c30d23b135a 100644 --- a/test/t/test_rfcomm.py +++ b/test/t/test_rfcomm.py @@ -2,7 +2,6 @@ class TestRfcomm: - @pytest.mark.complete("rfcomm ") def test_1(self, completion): assert completion diff --git a/test/t/test_rfkill.py b/test/t/test_rfkill.py index 06b7e4bfcf0..f8248ff9dc5 100644 --- a/test/t/test_rfkill.py +++ b/test/t/test_rfkill.py @@ -2,7 +2,6 @@ class TestRfkill: - @pytest.mark.complete("rfkill ") def test_1(self, completion): assert completion diff --git a/test/t/test_ri.py b/test/t/test_ri.py index 70b1a8f163c..e54f18bb961 100644 --- a/test/t/test_ri.py +++ b/test/t/test_ri.py @@ -1,13 +1,8 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "export RI='-d ri'", - ), -) +@pytest.mark.bashcomp(pre_cmds=("export RI='-d ri'",)) class TestRi: - @pytest.mark.complete("ri -") def test_1(self, completion): assert completion diff --git a/test/t/test_rlog.py b/test/t/test_rlog.py index 6ee3343624b..87a4da10fd1 100644 --- a/test/t/test_rlog.py +++ b/test/t/test_rlog.py @@ -2,7 +2,6 @@ class TestRlog: - @pytest.mark.complete("rlog ") def test_1(self, completion): assert completion diff --git a/test/t/test_rm.py b/test/t/test_rm.py index 410e52a6809..622ef13c94a 100644 --- a/test/t/test_rm.py +++ b/test/t/test_rm.py @@ -2,7 +2,6 @@ class TestRm: - @pytest.mark.complete("rm ") def test_1(self, completion): assert completion diff --git a/test/t/test_rmdir.py b/test/t/test_rmdir.py index ff26a65a20d..f6bd9b6aaa3 100644 --- a/test/t/test_rmdir.py +++ b/test/t/test_rmdir.py @@ -2,7 +2,6 @@ class TestRmdir: - @pytest.mark.complete("rmdir ") def test_1(self, completion): assert completion diff --git a/test/t/test_rmlist.py b/test/t/test_rmlist.py index 58db7f7fe2e..3a6c6ece0cb 100644 --- a/test/t/test_rmlist.py +++ b/test/t/test_rmlist.py @@ -2,7 +2,6 @@ class TestRmlist: - @pytest.mark.complete("rmlist -") def test_1(self, completion): assert completion diff --git a/test/t/test_rmmod.py b/test/t/test_rmmod.py index cda9e404fc0..dfeb00900b0 100644 --- a/test/t/test_rmmod.py +++ b/test/t/test_rmmod.py @@ -2,7 +2,6 @@ class TestRmmod: - @pytest.mark.complete("rmmod -") def test_1(self, completion): assert completion diff --git a/test/t/test_route.py b/test/t/test_route.py index a981271ab78..741ef5855e0 100644 --- a/test/t/test_route.py +++ b/test/t/test_route.py @@ -2,7 +2,6 @@ class TestRoute: - @pytest.mark.complete("route ") def test_1(self, completion): assert completion diff --git a/test/t/test_rpcdebug.py b/test/t/test_rpcdebug.py index aefed3af4b4..e92bdee13b0 100644 --- a/test/t/test_rpcdebug.py +++ b/test/t/test_rpcdebug.py @@ -2,7 +2,6 @@ class TestRpcdebug: - @pytest.mark.complete("rpcdebug -") def test_1(self, completion): assert completion diff --git a/test/t/test_rpm.py b/test/t/test_rpm.py index 7d06f4d51e9..939090dd727 100644 --- a/test/t/test_rpm.py +++ b/test/t/test_rpm.py @@ -2,12 +2,10 @@ class TestRpm: - @pytest.mark.complete("rpm ") def test_1(self, completion): assert completion - @pytest.mark.complete("rpm -q ", - skipif='test -z "$(rpm -qa 2>/dev/null)"') + @pytest.mark.complete("rpm -q ", skipif='test -z "$(rpm -qa 2>/dev/null)"') def test_2(self, completion): assert completion diff --git a/test/t/test_rpm2tgz.py b/test/t/test_rpm2tgz.py index 3a07cb166ce..366faedc436 100644 --- a/test/t/test_rpm2tgz.py +++ b/test/t/test_rpm2tgz.py @@ -4,18 +4,23 @@ class TestRpm2tgz: - @pytest.mark.complete("rpm2tgz -") def test_1(self, completion): assert completion @pytest.mark.complete("rpm2tgz ", cwd="slackware/home") def test_2(self, completion): - expected = sorted([ - "%s/" for x in os.listdir("slackware/home") - if os.path.isdir("shared/bin/%s" % x) - ] + [ - x for x in os.listdir("slackware/home") - if os.path.isfile("slackware/home/%s" % x) and x.endswith(".rpm") - ]) + expected = sorted( + [ + "%s/" + for x in os.listdir("slackware/home") + if os.path.isdir("shared/bin/%s" % x) + ] + + [ + x + for x in os.listdir("slackware/home") + if os.path.isfile("slackware/home/%s" % x) + and x.endswith(".rpm") + ] + ) assert completion == expected diff --git a/test/t/test_rpmbuild.py b/test/t/test_rpmbuild.py index c47286524f9..13f164ba452 100644 --- a/test/t/test_rpmbuild.py +++ b/test/t/test_rpmbuild.py @@ -2,7 +2,6 @@ class TestRpmbuild: - @pytest.mark.complete("rpmbuild -") def test_1(self, completion): assert completion diff --git a/test/t/test_rrdtool.py b/test/t/test_rrdtool.py index c62400a9781..9da83100cae 100644 --- a/test/t/test_rrdtool.py +++ b/test/t/test_rrdtool.py @@ -2,7 +2,6 @@ class TestRrdtool: - @pytest.mark.complete("rrdtool ") def test_1(self, completion): assert completion diff --git a/test/t/test_rsync.py b/test/t/test_rsync.py index ff7be00d2a9..d54ce6fcb32 100644 --- a/test/t/test_rsync.py +++ b/test/t/test_rsync.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - ignore_env=r"^[+-]_scp_path_esc=", -) +@pytest.mark.bashcomp(ignore_env=r"^[+-]_scp_path_esc=") class TestRsync: - @pytest.mark.complete("rsync ") def test_1(self, completion): assert completion diff --git a/test/t/test_rtcwake.py b/test/t/test_rtcwake.py index a8dfee8204d..e9c12d07e20 100644 --- a/test/t/test_rtcwake.py +++ b/test/t/test_rtcwake.py @@ -2,7 +2,6 @@ class TestRtcwake: - @pytest.mark.complete("rtcwake ") def test_1(self, completion): assert completion diff --git a/test/t/test_runuser.py b/test/t/test_runuser.py index b873c62ca78..01a6d8845fc 100644 --- a/test/t/test_runuser.py +++ b/test/t/test_runuser.py @@ -2,7 +2,6 @@ class TestRunuser: - @pytest.mark.complete("runuser ") def test_1(self, completion): assert completion diff --git a/test/t/test_sbcl.py b/test/t/test_sbcl.py index 2dbcf823f66..cce4cba3b84 100644 --- a/test/t/test_sbcl.py +++ b/test/t/test_sbcl.py @@ -2,7 +2,6 @@ class TestSbcl: - @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("sbcl shared/default/") def test_1(self, completion): diff --git a/test/t/test_sbcl_mt.py b/test/t/test_sbcl_mt.py index 01759a38e9a..860acc2f49a 100644 --- a/test/t/test_sbcl_mt.py +++ b/test/t/test_sbcl_mt.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="sbcl-mt", -) +@pytest.mark.bashcomp(cmd="sbcl-mt") class TestSbclMt: - @pytest.mark.complete("sbcl-mt shared/default/") def test_1(self, completion): assert completion == ["bar", "bar bar.d/", "foo", "foo foo.d/"] diff --git a/test/t/test_sbopkg.py b/test/t/test_sbopkg.py index a1a2e094c60..cb1f73602e5 100644 --- a/test/t/test_sbopkg.py +++ b/test/t/test_sbopkg.py @@ -2,7 +2,6 @@ class TestSbopkg: - @pytest.mark.complete("sbopkg -") def test_1(self, completion): assert completion diff --git a/test/t/test_screen.py b/test/t/test_screen.py index e1b44621692..c05e0ce0170 100644 --- a/test/t/test_screen.py +++ b/test/t/test_screen.py @@ -2,7 +2,6 @@ class TestScreen: - @pytest.mark.complete("screen -") def test_1(self, completion): assert completion diff --git a/test/t/test_scrub.py b/test/t/test_scrub.py index a762477725f..0a521fafd5e 100644 --- a/test/t/test_scrub.py +++ b/test/t/test_scrub.py @@ -2,7 +2,6 @@ class TestScrub: - @pytest.mark.complete("scrub ") def test_1(self, completion): assert completion @@ -12,8 +11,9 @@ def test_2(self, completion): assert completion # Not all scrub versions list available patterns in --help output - @pytest.mark.complete("scrub -p ", - skipif="! (scrub --help 2>&1 || :) | " - "command grep -q ^Available") + @pytest.mark.complete( + "scrub -p ", + skipif="! (scrub --help 2>&1 || :) | " "command grep -q ^Available", + ) def test_3(self, completion): assert completion diff --git a/test/t/test_sdptool.py b/test/t/test_sdptool.py index 906cc7e964e..095d90e6cdb 100644 --- a/test/t/test_sdptool.py +++ b/test/t/test_sdptool.py @@ -2,7 +2,6 @@ class TestSdptool: - @pytest.mark.complete("sdptool ") def test_1(self, completion): assert completion diff --git a/test/t/test_sed.py b/test/t/test_sed.py index 6b6c21fa176..3fc0559ffdc 100644 --- a/test/t/test_sed.py +++ b/test/t/test_sed.py @@ -2,8 +2,6 @@ class TestSed: - - @pytest.mark.complete("sed --", - skipif="! sed --help &>/dev/null") + @pytest.mark.complete("sed --", skipif="! sed --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_seq.py b/test/t/test_seq.py index f27b41dbef7..9658045040d 100644 --- a/test/t/test_seq.py +++ b/test/t/test_seq.py @@ -2,7 +2,6 @@ class TestSeq: - @pytest.mark.complete("seq --") def test_1(self, completion): assert completion diff --git a/test/t/test_service.py b/test/t/test_service.py index afc7c2baef7..7ce43125229 100644 --- a/test/t/test_service.py +++ b/test/t/test_service.py @@ -2,7 +2,6 @@ class TestService: - @pytest.mark.complete("service ") def test_1(self, completion): assert completion diff --git a/test/t/test_set.py b/test/t/test_set.py index 751760fcdd2..08c1671e7f1 100644 --- a/test/t/test_set.py +++ b/test/t/test_set.py @@ -2,7 +2,6 @@ class TestSet: - @pytest.mark.complete("set no") def test_1(self, completion): assert completion diff --git a/test/t/test_setquota.py b/test/t/test_setquota.py index 54b35dee0d0..a2822bca1fb 100644 --- a/test/t/test_setquota.py +++ b/test/t/test_setquota.py @@ -2,7 +2,6 @@ class TestSetquota: - @pytest.mark.complete("setquota ") def test_1(self, completion): assert completion diff --git a/test/t/test_sftp.py b/test/t/test_sftp.py index f5a815c4538..e76a6f59c09 100644 --- a/test/t/test_sftp.py +++ b/test/t/test_sftp.py @@ -2,7 +2,6 @@ class TestSftp: - @pytest.mark.complete("sftp -Fsp", cwd="sftp") def test_1(self, completion): assert completion == "-Fspaced conf" diff --git a/test/t/test_sh.py b/test/t/test_sh.py index 47d809f8d11..f49a1685807 100644 --- a/test/t/test_sh.py +++ b/test/t/test_sh.py @@ -2,7 +2,6 @@ class TestSh: - @pytest.mark.complete("sh -") def test_1(self, completion): assert completion diff --git a/test/t/test_sha1sum.py b/test/t/test_sha1sum.py index b398476fcb6..efe8dfec198 100644 --- a/test/t/test_sha1sum.py +++ b/test/t/test_sha1sum.py @@ -2,7 +2,6 @@ class TestSha1sum: - @pytest.mark.complete("sha1sum --") def test_1(self, completion): assert completion diff --git a/test/t/test_shar.py b/test/t/test_shar.py index 51358affd94..f73c4b8704f 100644 --- a/test/t/test_shar.py +++ b/test/t/test_shar.py @@ -2,7 +2,6 @@ class TestShar: - @pytest.mark.complete("shar --") def test_1(self, completion): assert completion diff --git a/test/t/test_shellcheck.py b/test/t/test_shellcheck.py index fd8599b5279..54bc46369f5 100644 --- a/test/t/test_shellcheck.py +++ b/test/t/test_shellcheck.py @@ -2,7 +2,6 @@ class TestShellcheck: - @pytest.mark.complete("shellcheck ") def test_1(self, completion): assert completion diff --git a/test/t/test_sitecopy.py b/test/t/test_sitecopy.py index 071f73a676b..de66a5dc824 100644 --- a/test/t/test_sitecopy.py +++ b/test/t/test_sitecopy.py @@ -2,7 +2,6 @@ class TestSitecopy: - @pytest.mark.complete("sitecopy --") def test_1(self, completion): assert completion diff --git a/test/t/test_slackpkg.py b/test/t/test_slackpkg.py index e99116ed18d..3997bb020e1 100644 --- a/test/t/test_slackpkg.py +++ b/test/t/test_slackpkg.py @@ -2,7 +2,6 @@ class TestSlackpkg: - @pytest.mark.complete("slackpkg -") def test_1(self, completion): assert completion diff --git a/test/t/test_slapt_get.py b/test/t/test_slapt_get.py index 8790b665af5..1254d5b4cfb 100644 --- a/test/t/test_slapt_get.py +++ b/test/t/test_slapt_get.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="slapt-get", -) +@pytest.mark.bashcomp(cmd="slapt-get") class TestSlaptGet: - @pytest.mark.complete("slapt-get -") def test_1(self, completion): assert completion diff --git a/test/t/test_slapt_src.py b/test/t/test_slapt_src.py index 7edbd11ba99..df5f4da0503 100644 --- a/test/t/test_slapt_src.py +++ b/test/t/test_slapt_src.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="slapt-src", -) +@pytest.mark.bashcomp(cmd="slapt-src") class TestSlaptSrc: - @pytest.mark.complete("slapt-src -") def test_1(self, completion): assert completion diff --git a/test/t/test_smartctl.py b/test/t/test_smartctl.py index afa8c6e2ae3..ac6dc68d0f5 100644 --- a/test/t/test_smartctl.py +++ b/test/t/test_smartctl.py @@ -2,7 +2,6 @@ class TestSmartctl: - @pytest.mark.complete("smartctl --") def test_1(self, completion): assert completion diff --git a/test/t/test_smbcacls.py b/test/t/test_smbcacls.py index 41863c134d2..1ff16e2bbaf 100644 --- a/test/t/test_smbcacls.py +++ b/test/t/test_smbcacls.py @@ -2,7 +2,6 @@ class TestSmbcacls: - @pytest.mark.complete("smbcacls -") def test_1(self, completion): assert completion diff --git a/test/t/test_smbclient.py b/test/t/test_smbclient.py index ccca25ec5ec..ed2da4b015d 100644 --- a/test/t/test_smbclient.py +++ b/test/t/test_smbclient.py @@ -2,7 +2,6 @@ class TestSmbclient: - @pytest.mark.complete("smbclient -") def test_1(self, completion): assert completion diff --git a/test/t/test_smbcquotas.py b/test/t/test_smbcquotas.py index c540c438b0d..b7e01d29eb5 100644 --- a/test/t/test_smbcquotas.py +++ b/test/t/test_smbcquotas.py @@ -2,7 +2,6 @@ class TestSmbcquotas: - @pytest.mark.complete("smbcquotas -") def test_1(self, completion): assert completion diff --git a/test/t/test_smbget.py b/test/t/test_smbget.py index 7a5b89a9800..a360bd3c92d 100644 --- a/test/t/test_smbget.py +++ b/test/t/test_smbget.py @@ -2,7 +2,6 @@ class TestSmbget: - @pytest.mark.complete("smbget -") def test_1(self, completion): assert completion diff --git a/test/t/test_smbpasswd.py b/test/t/test_smbpasswd.py index e205133acb4..4d0e76bae26 100644 --- a/test/t/test_smbpasswd.py +++ b/test/t/test_smbpasswd.py @@ -2,7 +2,6 @@ class TestSmbpasswd: - @pytest.mark.complete("smbpasswd -") def test_1(self, completion): assert completion diff --git a/test/t/test_smbtar.py b/test/t/test_smbtar.py index f9278af7917..44b424bcfdd 100644 --- a/test/t/test_smbtar.py +++ b/test/t/test_smbtar.py @@ -2,7 +2,6 @@ class TestSmbtar: - @pytest.mark.complete("smbtar -") def test_1(self, completion): assert completion diff --git a/test/t/test_smbtree.py b/test/t/test_smbtree.py index 959ded84ee5..0eba4b546f8 100644 --- a/test/t/test_smbtree.py +++ b/test/t/test_smbtree.py @@ -2,7 +2,6 @@ class TestSmbtree: - @pytest.mark.complete("smbtree -") def test_1(self, completion): assert completion diff --git a/test/t/test_snownews.py b/test/t/test_snownews.py index df78d403fdf..24ed2dfef3d 100644 --- a/test/t/test_snownews.py +++ b/test/t/test_snownews.py @@ -2,7 +2,6 @@ class TestSnownews: - @pytest.mark.complete("snownews --") def test_1(self, completion): assert completion diff --git a/test/t/test_sort.py b/test/t/test_sort.py index 818178814f3..7dbb5b9d914 100644 --- a/test/t/test_sort.py +++ b/test/t/test_sort.py @@ -2,7 +2,6 @@ class TestSort: - @pytest.mark.complete("sort --") def test_1(self, completion): assert completion diff --git a/test/t/test_split.py b/test/t/test_split.py index d625b3a506d..79013663f1d 100644 --- a/test/t/test_split.py +++ b/test/t/test_split.py @@ -2,8 +2,6 @@ class TestSplit: - - @pytest.mark.complete("split --", - skipif="! split --help &>/dev/null") + @pytest.mark.complete("split --", skipif="! split --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_spovray.py b/test/t/test_spovray.py index b39b0e30e3f..9033f835bc7 100644 --- a/test/t/test_spovray.py +++ b/test/t/test_spovray.py @@ -2,7 +2,6 @@ class TestSpovray: - @pytest.mark.complete("spovray ") def test_1(self, completion): assert completion diff --git a/test/t/test_sqlite3.py b/test/t/test_sqlite3.py index 8d3e264d612..466281a902f 100644 --- a/test/t/test_sqlite3.py +++ b/test/t/test_sqlite3.py @@ -2,7 +2,6 @@ class TestSqlite3: - @pytest.mark.complete("sqlite3 ") def test_1(self, completion): assert completion diff --git a/test/t/test_ss.py b/test/t/test_ss.py index 5fa6f2c752c..3e515dde723 100644 --- a/test/t/test_ss.py +++ b/test/t/test_ss.py @@ -2,7 +2,6 @@ class TestSs: - @pytest.mark.complete("ss -") def test_1(self, completion): assert completion diff --git a/test/t/test_ssh.py b/test/t/test_ssh.py index 472d6d1e072..9126b91de19 100644 --- a/test/t/test_ssh.py +++ b/test/t/test_ssh.py @@ -2,7 +2,6 @@ class TestSsh: - @pytest.mark.complete("ssh -Fsp", cwd="ssh") def test_1(self, completion): assert completion == "-Fspaced conf" diff --git a/test/t/test_ssh_add.py b/test/t/test_ssh_add.py index a84ffd7320f..33e679c71d1 100644 --- a/test/t/test_ssh_add.py +++ b/test/t/test_ssh_add.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="ssh-add", -) +@pytest.mark.bashcomp(cmd="ssh-add") class TestSshAdd: - @pytest.mark.complete("ssh-add ") def test_1(self, completion): assert completion diff --git a/test/t/test_ssh_copy_id.py b/test/t/test_ssh_copy_id.py index ae488e84425..cb607715d89 100644 --- a/test/t/test_ssh_copy_id.py +++ b/test/t/test_ssh_copy_id.py @@ -11,7 +11,6 @@ ignore_env=r"^[+-]_scp_path_esc=", ) class TestSshCopyId: - @pytest.mark.complete("ssh-copy-id -") def test_1(self, completion): assert completion diff --git a/test/t/test_ssh_keygen.py b/test/t/test_ssh_keygen.py index 63e46dc4f29..628672d4517 100644 --- a/test/t/test_ssh_keygen.py +++ b/test/t/test_ssh_keygen.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="ssh-keygen", -) +@pytest.mark.bashcomp(cmd="ssh-keygen") class TestSshKeygen: - @pytest.mark.complete("ssh-keygen -") def test_1(self, completion): assert completion diff --git a/test/t/test_sshfs.py b/test/t/test_sshfs.py index 1805ef59b86..44daed3e73d 100644 --- a/test/t/test_sshfs.py +++ b/test/t/test_sshfs.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - ignore_env=r"^[+-]_scp_path_esc=", -) +@pytest.mark.bashcomp(ignore_env=r"^[+-]_scp_path_esc=") class TestSshfs: - @pytest.mark.complete("sshfs ./") def test_1(self, completion): assert completion diff --git a/test/t/test_sshmitm.py b/test/t/test_sshmitm.py index 208de77269b..9964c5b5644 100644 --- a/test/t/test_sshmitm.py +++ b/test/t/test_sshmitm.py @@ -2,7 +2,6 @@ class TestSshmitm: - @pytest.mark.complete("sshmitm -") def test_1(self, completion): assert completion diff --git a/test/t/test_sshow.py b/test/t/test_sshow.py index 0519e2f4f0e..b6811e0cbd7 100644 --- a/test/t/test_sshow.py +++ b/test/t/test_sshow.py @@ -2,7 +2,6 @@ class TestSshow: - @pytest.mark.complete("sshow -") def test_1(self, completion): assert completion diff --git a/test/t/test_strace.py b/test/t/test_strace.py index 059b9018a22..b9dbfacabce 100644 --- a/test/t/test_strace.py +++ b/test/t/test_strace.py @@ -2,7 +2,6 @@ class TestStrace: - @pytest.mark.complete("strace -") def test_1(self, completion): assert completion diff --git a/test/t/test_stream.py b/test/t/test_stream.py index 879ee700e09..a46e90155cf 100644 --- a/test/t/test_stream.py +++ b/test/t/test_stream.py @@ -2,7 +2,6 @@ class TestStream: - @pytest.mark.complete("stream ") def test_1(self, completion): assert completion diff --git a/test/t/test_strings.py b/test/t/test_strings.py index e905f92db4a..3922ecef785 100644 --- a/test/t/test_strings.py +++ b/test/t/test_strings.py @@ -2,7 +2,6 @@ class TestStrings: - @pytest.mark.complete("strings ") def test_1(self, completion): assert completion diff --git a/test/t/test_strip.py b/test/t/test_strip.py index ce3cd846851..c756fe03149 100644 --- a/test/t/test_strip.py +++ b/test/t/test_strip.py @@ -2,7 +2,6 @@ class TestStrip: - @pytest.mark.complete("strip --") def test_1(self, completion): assert completion diff --git a/test/t/test_su.py b/test/t/test_su.py index 373dcd51442..e6c5ef4bf9c 100644 --- a/test/t/test_su.py +++ b/test/t/test_su.py @@ -2,7 +2,6 @@ class TestSu: - @pytest.mark.complete("su ") def test_1(self, completion): assert completion diff --git a/test/t/test_sudo.py b/test/t/test_sudo.py index 001b23e1d63..761c56048ed 100644 --- a/test/t/test_sudo.py +++ b/test/t/test_sudo.py @@ -4,7 +4,6 @@ class TestSudo: - @pytest.mark.complete("sudo -") def test_1(self, completion): assert completion @@ -38,7 +37,8 @@ def test_7(self, bash, part_full_user, part_full_group): _, user = part_full_user partgroup, fullgroup = part_full_group completion = assert_complete( - bash, "sudo chown %s:%s" % (user, partgroup)) + bash, "sudo chown %s:%s" % (user, partgroup) + ) assert completion == "%s:%s" % (user, fullgroup) assert completion.endswith(" ") @@ -52,11 +52,17 @@ def test_8(self, bash, part_full_group): def test_9(self, bash, part_full_group): """Test preserving special chars in $prefix$partgroup.""" part, full = part_full_group - for prefix in (r"funky\ user:", "funky.user:", r"funky\.user:", - r"fu\ nky.user:", r"f\ o\ o\.\bar:", - r"foo\_b\ a\.r\ :"): + for prefix in ( + r"funky\ user:", + "funky.user:", + r"funky\.user:", + r"fu\ nky.user:", + r"f\ o\ o\.\bar:", + r"foo\_b\ a\.r\ :", + ): completion = assert_complete( - bash, "sudo chown %s%s" % (prefix, part)) + bash, "sudo chown %s%s" % (prefix, part) + ) assert completion == "%s%s" % (prefix, full) assert completion.endswith(" ") @@ -66,7 +72,8 @@ def test_10(self, bash, part_full_user, part_full_group): partgroup, _ = part_full_group for x in range(2, 5): completion = assert_complete( - bash, "sudo chown %s%s:%s" % (user, x * "\\", partgroup)) + bash, "sudo chown %s%s:%s" % (user, x * "\\", partgroup) + ) assert not completion def test_11(self, bash, part_full_group): diff --git a/test/t/test_svcadm.py b/test/t/test_svcadm.py index 5851595ff77..76d86a4799f 100644 --- a/test/t/test_svcadm.py +++ b/test/t/test_svcadm.py @@ -2,7 +2,6 @@ class TestSvcadm: - @pytest.mark.complete("svcadm ") def test_1(self, completion): assert completion diff --git a/test/t/test_svk.py b/test/t/test_svk.py index f7f824913b6..8014bb01314 100644 --- a/test/t/test_svk.py +++ b/test/t/test_svk.py @@ -2,7 +2,6 @@ class TestSvk: - @pytest.mark.complete("svk ") def test_1(self, completion): assert completion diff --git a/test/t/test_svn.py b/test/t/test_svn.py index 5f83530fd67..d8bbee7b56b 100644 --- a/test/t/test_svn.py +++ b/test/t/test_svn.py @@ -2,7 +2,6 @@ class TestSvn: - @pytest.mark.complete("svn ") def test_1(self, completion): assert completion diff --git a/test/t/test_svnadmin.py b/test/t/test_svnadmin.py index 53438b83ae9..2dc7c6c725e 100644 --- a/test/t/test_svnadmin.py +++ b/test/t/test_svnadmin.py @@ -2,7 +2,6 @@ class TestSvnadmin: - @pytest.mark.complete("svnadmin ") def test_1(self, completion): assert completion diff --git a/test/t/test_svnlook.py b/test/t/test_svnlook.py index 932b5d0e62d..26761b085a2 100644 --- a/test/t/test_svnlook.py +++ b/test/t/test_svnlook.py @@ -2,7 +2,6 @@ class TestSvnlook: - @pytest.mark.complete("svnlook ") def test_1(self, completion): assert completion diff --git a/test/t/test_sync_members.py b/test/t/test_sync_members.py index 4bf96ebb9e5..f0d2dcf0610 100644 --- a/test/t/test_sync_members.py +++ b/test/t/test_sync_members.py @@ -2,7 +2,6 @@ class TestSyncMembers: - @pytest.mark.complete("sync_members --") def test_1(self, completion): assert completion diff --git a/test/t/test_sysbench.py b/test/t/test_sysbench.py index a1af17e3da7..afe21eca050 100644 --- a/test/t/test_sysbench.py +++ b/test/t/test_sysbench.py @@ -2,7 +2,6 @@ class TestSysbench: - @pytest.mark.complete("sysbench ") def test_1(self, completion): assert completion diff --git a/test/t/test_sysctl.py b/test/t/test_sysctl.py index 66be6b58c1e..773b59107f2 100644 --- a/test/t/test_sysctl.py +++ b/test/t/test_sysctl.py @@ -2,13 +2,13 @@ class TestSysctl: - @pytest.mark.complete("sysctl -") def test_1(self, completion): assert completion - @pytest.mark.complete("sysctl kern", - skipif="! sysctl -N -a 2>/dev/null | " - "command grep -q ^kern") + @pytest.mark.complete( + "sysctl kern", + skipif="! sysctl -N -a 2>/dev/null | " "command grep -q ^kern", + ) def test_2(self, completion): assert completion diff --git a/test/t/test_tac.py b/test/t/test_tac.py index 86072f6059b..f612cc907d5 100644 --- a/test/t/test_tac.py +++ b/test/t/test_tac.py @@ -2,7 +2,6 @@ class TestTac: - @pytest.mark.complete("tac --") def test_1(self, completion): assert completion diff --git a/test/t/test_tail.py b/test/t/test_tail.py index cd03e9d3705..1b818f7d7a4 100644 --- a/test/t/test_tail.py +++ b/test/t/test_tail.py @@ -2,8 +2,6 @@ class TestTail: - - @pytest.mark.complete("tail --", - skipif="! tail --help &>/dev/null") + @pytest.mark.complete("tail --", skipif="! tail --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_tar.py b/test/t/test_tar.py index 91118ac3e92..309bcc762ad 100644 --- a/test/t/test_tar.py +++ b/test/t/test_tar.py @@ -7,7 +7,6 @@ @pytest.mark.bashcomp(ignore_env=r"^-declare -f _tar$") class TestTar: - @pytest.fixture(scope="class") def gnu_tar(self, bash): got = assert_bash_exec(bash, "tar --version || :", want_output=True) @@ -33,13 +32,11 @@ def test_4(self, completion): @pytest.mark.complete("tar cTfvv NOT_EXISTS DONT_CREATE.tar ", cwd="tar") def test_5(self, completion): - assert completion == \ - "archive.tar.xz dir/ dir2/ escape.tar".split() + assert completion == "archive.tar.xz dir/ dir2/ escape.tar".split() @pytest.mark.complete("tar xvf ", cwd="tar") def test_6(self, completion): - assert completion == \ - "archive.tar.xz dir/ dir2/ escape.tar".split() + assert completion == "archive.tar.xz dir/ dir2/ escape.tar".split() @pytest.mark.complete("tar -c") def test_7(self, completion, gnu_tar): @@ -90,14 +87,18 @@ def test_16(self, completion, gnu_tar): @pytest.mark.complete("tar --owner=") def test_17(self, bash, completion, gnu_tar): - users = sorted(assert_bash_exec( - bash, "compgen -A user", want_output=True).split()) + users = sorted( + assert_bash_exec(bash, "compgen -A user", want_output=True).split() + ) assert completion == users @pytest.mark.complete("tar --group=") def test_18(self, bash, completion, gnu_tar): - groups = sorted(assert_bash_exec( - bash, "compgen -A group", want_output=True).split()) + groups = sorted( + assert_bash_exec( + bash, "compgen -A group", want_output=True + ).split() + ) assert completion == groups # Use -b for this as -b is still not handled by tar's completion diff --git a/test/t/test_tcpdump.py b/test/t/test_tcpdump.py index 8178df38414..ec26187fdf6 100644 --- a/test/t/test_tcpdump.py +++ b/test/t/test_tcpdump.py @@ -2,7 +2,6 @@ class TestTcpdump: - @pytest.mark.complete("tcpdump -") def test_1(self, completion): assert completion diff --git a/test/t/test_tcpkill.py b/test/t/test_tcpkill.py index ea1b58c56be..4581a3461df 100644 --- a/test/t/test_tcpkill.py +++ b/test/t/test_tcpkill.py @@ -2,7 +2,6 @@ class TestTcpkill: - @pytest.mark.complete("tcpkill -") def test_1(self, completion): assert completion diff --git a/test/t/test_tcpnice.py b/test/t/test_tcpnice.py index 5e167d2e675..c7d208d1e1d 100644 --- a/test/t/test_tcpnice.py +++ b/test/t/test_tcpnice.py @@ -2,7 +2,6 @@ class TestTcpnice: - @pytest.mark.complete("tcpnice -") def test_1(self, completion): assert completion diff --git a/test/t/test_tee.py b/test/t/test_tee.py index 69f70ff7d1c..b0914624bfd 100644 --- a/test/t/test_tee.py +++ b/test/t/test_tee.py @@ -2,7 +2,6 @@ class TestTee: - @pytest.mark.complete("tee ") def test_1(self, completion): assert completion diff --git a/test/t/test_texindex.py b/test/t/test_texindex.py index 671e0f32cb7..4a2387ff688 100644 --- a/test/t/test_texindex.py +++ b/test/t/test_texindex.py @@ -2,7 +2,6 @@ class TestTexindex: - @pytest.mark.complete("texindex --") def test_1(self, completion): assert completion diff --git a/test/t/test_tightvncviewer.py b/test/t/test_tightvncviewer.py index a9504bddf02..04ebece5e23 100644 --- a/test/t/test_tightvncviewer.py +++ b/test/t/test_tightvncviewer.py @@ -2,7 +2,6 @@ class TestTightvncviewer: - @pytest.mark.complete("tightvncviewer ") def test_1(self, completion): assert completion diff --git a/test/t/test_time.py b/test/t/test_time.py index 6ca8ab2b9b4..231f14eb2d4 100644 --- a/test/t/test_time.py +++ b/test/t/test_time.py @@ -4,7 +4,6 @@ class TestTime: - @pytest.mark.complete("time set") def test_1(self, completion): assert completion @@ -16,7 +15,9 @@ def test_2(self, completion): @pytest.mark.complete("time shared/bin/") def test_3(self, completion): execs = sorted( - x for x in os.listdir("shared/bin") + x + for x in os.listdir("shared/bin") if os.path.isfile("shared/bin/%s" % x) - and os.access("shared/bin/%s" % x, os.X_OK)) + and os.access("shared/bin/%s" % x, os.X_OK) + ) assert completion == execs diff --git a/test/t/test_timeout.py b/test/t/test_timeout.py index 0159d1276fa..6b5ac5f0153 100644 --- a/test/t/test_timeout.py +++ b/test/t/test_timeout.py @@ -2,7 +2,6 @@ class TestTimeout: - @pytest.mark.complete("timeout ") def test_1(self, completion): assert not completion diff --git a/test/t/test_tipc.py b/test/t/test_tipc.py index d975665f521..17b2bfda73a 100644 --- a/test/t/test_tipc.py +++ b/test/t/test_tipc.py @@ -2,7 +2,6 @@ class TestTipc: - @pytest.mark.complete("tipc ") def test_1(self, completion): assert completion diff --git a/test/t/test_touch.py b/test/t/test_touch.py index b96d6e1adc2..cc398d81f51 100644 --- a/test/t/test_touch.py +++ b/test/t/test_touch.py @@ -2,8 +2,6 @@ class TestTouch: - - @pytest.mark.complete("touch --", - skipif="! touch --help &>/dev/null") + @pytest.mark.complete("touch --", skipif="! touch --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_tox.py b/test/t/test_tox.py index 231304cf42b..b6149362257 100644 --- a/test/t/test_tox.py +++ b/test/t/test_tox.py @@ -2,7 +2,6 @@ class TestTox: - @pytest.mark.complete("tox -") def test_1(self, completion): assert completion diff --git a/test/t/test_tr.py b/test/t/test_tr.py index 86fe2b887b8..845970126b5 100644 --- a/test/t/test_tr.py +++ b/test/t/test_tr.py @@ -2,8 +2,6 @@ class TestTr: - - @pytest.mark.complete("tr --", - skipif="! tr --help &>/dev/null") + @pytest.mark.complete("tr --", skipif="! tr --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_tracepath.py b/test/t/test_tracepath.py index f83127845d3..a6ef7a4185d 100644 --- a/test/t/test_tracepath.py +++ b/test/t/test_tracepath.py @@ -2,7 +2,6 @@ class TestTracepath: - @pytest.mark.complete("tracepath ") def test_1(self, completion): assert completion diff --git a/test/t/test_tshark.py b/test/t/test_tshark.py index 9d3ab8bc90c..5513d9c6e98 100644 --- a/test/t/test_tshark.py +++ b/test/t/test_tshark.py @@ -3,7 +3,6 @@ @pytest.mark.bashcomp(ignore_env=r"^\+_tshark_prefs=") class TestTshark: - @pytest.mark.complete("tshark -") def test_1(self, completion): assert completion diff --git a/test/t/test_tune2fs.py b/test/t/test_tune2fs.py index 6a0b578e80c..c8f4e8737af 100644 --- a/test/t/test_tune2fs.py +++ b/test/t/test_tune2fs.py @@ -2,7 +2,6 @@ class TestTune2fs: - @pytest.mark.complete("tune2fs ") def test_1(self, completion): assert completion diff --git a/test/t/test_udevadm.py b/test/t/test_udevadm.py index b89a5277184..d5dcddbb224 100644 --- a/test/t/test_udevadm.py +++ b/test/t/test_udevadm.py @@ -2,7 +2,6 @@ class TestUdevadm: - @pytest.mark.complete("udevadm ") def test_1(self, completion): assert completion diff --git a/test/t/test_ulimit.py b/test/t/test_ulimit.py index 1fb40e26916..24785beba9c 100644 --- a/test/t/test_ulimit.py +++ b/test/t/test_ulimit.py @@ -2,7 +2,6 @@ class TestUlimit: - @pytest.mark.complete("ulimit ") def test_1(self, completion): assert completion diff --git a/test/t/test_umount.py b/test/t/test_umount.py index 709d20bcfb9..dd4ae0b5d45 100644 --- a/test/t/test_umount.py +++ b/test/t/test_umount.py @@ -2,7 +2,6 @@ class TestUmount: - @pytest.mark.complete("umount ") def test_1(self, completion): assert completion diff --git a/test/t/test_unace.py b/test/t/test_unace.py index 481a1405d63..e4d5acb76d1 100644 --- a/test/t/test_unace.py +++ b/test/t/test_unace.py @@ -2,7 +2,6 @@ class TestUnace: - @pytest.mark.complete("unace -") def test_1(self, completion): assert completion diff --git a/test/t/test_uname.py b/test/t/test_uname.py index 25f08090670..743f317c620 100644 --- a/test/t/test_uname.py +++ b/test/t/test_uname.py @@ -2,8 +2,6 @@ class TestUname: - - @pytest.mark.complete("uname --", - skipif="! uname --help &>/dev/null") + @pytest.mark.complete("uname --", skipif="! uname --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_unexpand.py b/test/t/test_unexpand.py index 034d9a4e4bc..6b77b3bbf15 100644 --- a/test/t/test_unexpand.py +++ b/test/t/test_unexpand.py @@ -2,8 +2,8 @@ class TestUnexpand: - - @pytest.mark.complete("unexpand --", - skipif="! unexpand --help &>/dev/null") + @pytest.mark.complete( + "unexpand --", skipif="! unexpand --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_uniq.py b/test/t/test_uniq.py index 853aa70f7ee..8647c615f66 100644 --- a/test/t/test_uniq.py +++ b/test/t/test_uniq.py @@ -2,8 +2,6 @@ class TestUniq: - - @pytest.mark.complete("uniq --", - skipif="! uniq --help &>/dev/null") + @pytest.mark.complete("uniq --", skipif="! uniq --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_units.py b/test/t/test_units.py index 22d4136f294..aa1f89c821a 100644 --- a/test/t/test_units.py +++ b/test/t/test_units.py @@ -2,8 +2,6 @@ class TestUnits: - - @pytest.mark.complete("units --", - skipif="! units --help &>/dev/null") + @pytest.mark.complete("units --", skipif="! units --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_unpack200.py b/test/t/test_unpack200.py index 6014b3eab8d..16c04025cbe 100644 --- a/test/t/test_unpack200.py +++ b/test/t/test_unpack200.py @@ -2,7 +2,6 @@ class TestUnpack200: - @pytest.mark.complete("unpack200 ") def test_1(self, completion): assert completion diff --git a/test/t/test_unrar.py b/test/t/test_unrar.py index 76b382de79c..45e336efa48 100644 --- a/test/t/test_unrar.py +++ b/test/t/test_unrar.py @@ -2,7 +2,6 @@ class TestUnrar: - @pytest.mark.complete("unrar -") def test_1(self, completion): assert completion diff --git a/test/t/test_unset.py b/test/t/test_unset.py index 69710e0f5e3..9f3eadedc5e 100644 --- a/test/t/test_unset.py +++ b/test/t/test_unset.py @@ -2,7 +2,6 @@ class TestUnset: - @pytest.mark.complete("unset BASH_ARG") def test_1(self, completion): assert completion diff --git a/test/t/test_unshunt.py b/test/t/test_unshunt.py index 615fb9e9451..966312edaa3 100644 --- a/test/t/test_unshunt.py +++ b/test/t/test_unshunt.py @@ -2,7 +2,6 @@ class TestUnshunt: - @pytest.mark.complete("unshunt --") def test_1(self, completion): assert completion diff --git a/test/t/test_update_alternatives.py b/test/t/test_update_alternatives.py index 21d5a73971d..1209bebfd56 100644 --- a/test/t/test_update_alternatives.py +++ b/test/t/test_update_alternatives.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="update-alternatives", -) +@pytest.mark.bashcomp(cmd="update-alternatives") class TestUpdateAlternatives: - @pytest.mark.complete("update-alternatives --") def test_1(self, completion): assert completion diff --git a/test/t/test_update_rc_d.py b/test/t/test_update_rc_d.py index f166ee5803e..6f57416819d 100644 --- a/test/t/test_update_rc_d.py +++ b/test/t/test_update_rc_d.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="update-rc.d", -) +@pytest.mark.bashcomp(cmd="update-rc.d") class TestUpdateRcD: - @pytest.mark.complete("update-rc.d -") def test_1(self, completion): assert completion diff --git a/test/t/test_upgradepkg.py b/test/t/test_upgradepkg.py index 439c6383c82..ada84f1c442 100644 --- a/test/t/test_upgradepkg.py +++ b/test/t/test_upgradepkg.py @@ -5,23 +5,30 @@ class TestUpgradepkg: - @pytest.mark.complete("upgradepkg -") def test_1(self, completion): assert completion @pytest.mark.complete("upgradepkg --") def test_2(self, completion): - assert completion == "--dry-run --install-new --reinstall " \ + assert ( + completion == "--dry-run --install-new --reinstall " "--verbose".split() + ) @pytest.mark.complete("upgradepkg ", cwd="slackware/home") def test_4(self, completion): - expected = sorted([ - "%s/" % x for x in os.listdir("slackware/home") - if os.path.isdir("./%s" % x) - ] + [ - x for x in os.listdir("slackware/home") - if os.path.isfile("./%s" % x) and fnmatch.fnmatch(x, "*.t[bglx]z") - ]) + expected = sorted( + [ + "%s/" % x + for x in os.listdir("slackware/home") + if os.path.isdir("./%s" % x) + ] + + [ + x + for x in os.listdir("slackware/home") + if os.path.isfile("./%s" % x) + and fnmatch.fnmatch(x, "*.t[bglx]z") + ] + ) assert completion == expected diff --git a/test/t/test_urlsnarf.py b/test/t/test_urlsnarf.py index e6b528ffa79..a9482113639 100644 --- a/test/t/test_urlsnarf.py +++ b/test/t/test_urlsnarf.py @@ -2,7 +2,6 @@ class TestUrlsnarf: - @pytest.mark.complete("urlsnarf -") def test_1(self, completion): assert completion diff --git a/test/t/test_uscan.py b/test/t/test_uscan.py index b328a55056c..5f4c684a05a 100644 --- a/test/t/test_uscan.py +++ b/test/t/test_uscan.py @@ -2,7 +2,6 @@ class TestUscan: - @pytest.mark.complete("uscan -") def test_1(self, completion): assert completion diff --git a/test/t/test_useradd.py b/test/t/test_useradd.py index 46b80c9b412..557d4a916b4 100644 --- a/test/t/test_useradd.py +++ b/test/t/test_useradd.py @@ -2,7 +2,6 @@ class TestUseradd: - @pytest.mark.complete("useradd ") def test_1(self, completion): assert not completion diff --git a/test/t/test_userdel.py b/test/t/test_userdel.py index 776601bc0a5..74003eb18e0 100644 --- a/test/t/test_userdel.py +++ b/test/t/test_userdel.py @@ -2,7 +2,6 @@ class TestUserdel: - @pytest.mark.complete("userdel -") def test_1(self, completion): assert completion diff --git a/test/t/test_usermod.py b/test/t/test_usermod.py index 1cc4d6d1b5e..1eb169c7534 100644 --- a/test/t/test_usermod.py +++ b/test/t/test_usermod.py @@ -2,7 +2,6 @@ class TestUsermod: - @pytest.mark.complete("usermod ") def test_1(self, completion): assert completion diff --git a/test/t/test_valgrind.py b/test/t/test_valgrind.py index 06bbf7e1358..2b03d6f9b99 100644 --- a/test/t/test_valgrind.py +++ b/test/t/test_valgrind.py @@ -25,11 +25,16 @@ def test_4(self, completion): @pytest.mark.complete(r"valgrind --log-file=v\ 0.log ./bin/", cwd="shared") def test_5(self, completion): - expected = sorted([ - "%s/" for x in os.listdir("shared/bin") - if os.path.isdir("shared/bin/%s" % x) - ] + [ - x for x in os.listdir("shared/bin") - if os.path.isfile("shared/bin/%s" % x) - ]) + expected = sorted( + [ + "%s/" + for x in os.listdir("shared/bin") + if os.path.isdir("shared/bin/%s" % x) + ] + + [ + x + for x in os.listdir("shared/bin") + if os.path.isfile("shared/bin/%s" % x) + ] + ) assert completion == expected diff --git a/test/t/test_vdir.py b/test/t/test_vdir.py index 75a7d53956a..2f6a744ee65 100644 --- a/test/t/test_vdir.py +++ b/test/t/test_vdir.py @@ -2,7 +2,6 @@ class TestVdir: - @pytest.mark.complete("vdir ") def test_1(self, completion): assert completion diff --git a/test/t/test_vgcfgbackup.py b/test/t/test_vgcfgbackup.py index 6cab73bc3e9..20ef09cc4e1 100644 --- a/test/t/test_vgcfgbackup.py +++ b/test/t/test_vgcfgbackup.py @@ -2,8 +2,8 @@ class TestVgcfgbackup: - - @pytest.mark.complete("vgcfgbackup -", - skipif="! vgcfgbackup --help &>/dev/null") + @pytest.mark.complete( + "vgcfgbackup -", skipif="! vgcfgbackup --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgcfgrestore.py b/test/t/test_vgcfgrestore.py index e27f00cf139..260965556d7 100644 --- a/test/t/test_vgcfgrestore.py +++ b/test/t/test_vgcfgrestore.py @@ -2,8 +2,8 @@ class TestVgcfgrestore: - - @pytest.mark.complete("vgcfgrestore -", - skipif="! vgcfgrestore --help &>/dev/null") + @pytest.mark.complete( + "vgcfgrestore -", skipif="! vgcfgrestore --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgchange.py b/test/t/test_vgchange.py index 4c8ff29c382..0e268bad57c 100644 --- a/test/t/test_vgchange.py +++ b/test/t/test_vgchange.py @@ -2,7 +2,6 @@ class TestVgchange: - @pytest.mark.complete("vgchange -") def test_1(self, completion): assert completion diff --git a/test/t/test_vgck.py b/test/t/test_vgck.py index 9f85b70aa50..347f8f9b3a0 100644 --- a/test/t/test_vgck.py +++ b/test/t/test_vgck.py @@ -2,8 +2,6 @@ class TestVgck: - - @pytest.mark.complete("vgck -", - skipif="! vgck --help &>/dev/null") + @pytest.mark.complete("vgck -", skipif="! vgck --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgconvert.py b/test/t/test_vgconvert.py index a56a6263764..9810bc2fd19 100644 --- a/test/t/test_vgconvert.py +++ b/test/t/test_vgconvert.py @@ -2,8 +2,8 @@ class TestVgconvert: - - @pytest.mark.complete("vgconvert -", - skipif="! vgconvert --help &>/dev/null") + @pytest.mark.complete( + "vgconvert -", skipif="! vgconvert --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgcreate.py b/test/t/test_vgcreate.py index c17468e6b8f..07518e584df 100644 --- a/test/t/test_vgcreate.py +++ b/test/t/test_vgcreate.py @@ -2,7 +2,6 @@ class TestVgcreate: - @pytest.mark.complete("vgcreate -") def test_1(self, completion): assert completion diff --git a/test/t/test_vgdisplay.py b/test/t/test_vgdisplay.py index 404387682fe..a6919a6c66a 100644 --- a/test/t/test_vgdisplay.py +++ b/test/t/test_vgdisplay.py @@ -2,8 +2,8 @@ class TestVgdisplay: - - @pytest.mark.complete("vgdisplay -", - skipif="! vgdisplay --help &>/dev/null") + @pytest.mark.complete( + "vgdisplay -", skipif="! vgdisplay --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgexport.py b/test/t/test_vgexport.py index eae3ef2aa22..ce9a93bf85c 100644 --- a/test/t/test_vgexport.py +++ b/test/t/test_vgexport.py @@ -2,8 +2,6 @@ class TestVgexport: - - @pytest.mark.complete("vgexport -", - skipif="! vgexport --help &>/dev/null") + @pytest.mark.complete("vgexport -", skipif="! vgexport --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgextend.py b/test/t/test_vgextend.py index d28d069592e..3d3347f10a7 100644 --- a/test/t/test_vgextend.py +++ b/test/t/test_vgextend.py @@ -2,8 +2,6 @@ class TestVgextend: - - @pytest.mark.complete("vgextend -", - skipif="! vgextend --help &>/dev/null") + @pytest.mark.complete("vgextend -", skipif="! vgextend --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgimport.py b/test/t/test_vgimport.py index 5d3d9bc04b4..1a3efab0f70 100644 --- a/test/t/test_vgimport.py +++ b/test/t/test_vgimport.py @@ -2,8 +2,6 @@ class TestVgimport: - - @pytest.mark.complete("vgimport -", - skipif="! vgimport --help &>/dev/null") + @pytest.mark.complete("vgimport -", skipif="! vgimport --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgmerge.py b/test/t/test_vgmerge.py index a9a5f1aab94..971eb69a244 100644 --- a/test/t/test_vgmerge.py +++ b/test/t/test_vgmerge.py @@ -2,8 +2,6 @@ class TestVgmerge: - - @pytest.mark.complete("vgmerge -", - skipif="! vgmerge --help &>/dev/null") + @pytest.mark.complete("vgmerge -", skipif="! vgmerge --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgmknodes.py b/test/t/test_vgmknodes.py index d5b74bc9d2c..3209de9f51b 100644 --- a/test/t/test_vgmknodes.py +++ b/test/t/test_vgmknodes.py @@ -2,8 +2,8 @@ class TestVgmknodes: - - @pytest.mark.complete("vgmknodes -", - skipif="! vgmknodes --help &>/dev/null") + @pytest.mark.complete( + "vgmknodes -", skipif="! vgmknodes --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgreduce.py b/test/t/test_vgreduce.py index b9e81bb8f2b..97641b420d1 100644 --- a/test/t/test_vgreduce.py +++ b/test/t/test_vgreduce.py @@ -2,8 +2,6 @@ class TestVgreduce: - - @pytest.mark.complete("vgreduce -", - skipif="! vgreduce --help &>/dev/null") + @pytest.mark.complete("vgreduce -", skipif="! vgreduce --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgremove.py b/test/t/test_vgremove.py index afa4baa4b30..9c47752c69c 100644 --- a/test/t/test_vgremove.py +++ b/test/t/test_vgremove.py @@ -2,8 +2,6 @@ class TestVgremove: - - @pytest.mark.complete("vgremove -", - skipif="! vgremove --help &>/dev/null") + @pytest.mark.complete("vgremove -", skipif="! vgremove --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgrename.py b/test/t/test_vgrename.py index a335c479b12..ea5bc0507c1 100644 --- a/test/t/test_vgrename.py +++ b/test/t/test_vgrename.py @@ -2,8 +2,6 @@ class TestVgrename: - - @pytest.mark.complete("vgrename -", - skipif="! vgrename --help &>/dev/null") + @pytest.mark.complete("vgrename -", skipif="! vgrename --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgs.py b/test/t/test_vgs.py index c8fe2a82bde..d492fe8dc81 100644 --- a/test/t/test_vgs.py +++ b/test/t/test_vgs.py @@ -2,8 +2,6 @@ class TestVgs: - - @pytest.mark.complete("vgs -", - skipif="! vgs --help &>/dev/null") + @pytest.mark.complete("vgs -", skipif="! vgs --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgscan.py b/test/t/test_vgscan.py index b71488e650d..061ff4e2ba2 100644 --- a/test/t/test_vgscan.py +++ b/test/t/test_vgscan.py @@ -2,8 +2,6 @@ class TestVgscan: - - @pytest.mark.complete("vgscan -", - skipif="! vgscan --help &>/dev/null") + @pytest.mark.complete("vgscan -", skipif="! vgscan --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgsplit.py b/test/t/test_vgsplit.py index 9a3e1f25434..7b5a68697f5 100644 --- a/test/t/test_vgsplit.py +++ b/test/t/test_vgsplit.py @@ -2,7 +2,6 @@ class TestVgsplit: - @pytest.mark.complete("vgsplit -") def test_1(self, completion): assert completion diff --git a/test/t/test_vi.py b/test/t/test_vi.py index 3034a485300..4f7f4c2bd05 100644 --- a/test/t/test_vi.py +++ b/test/t/test_vi.py @@ -2,7 +2,6 @@ class TestVi: - @pytest.mark.complete("vi ") def test_1(self, completion): assert completion diff --git a/test/t/test_vipw.py b/test/t/test_vipw.py index 43b0a1b06ad..160cb11ba22 100644 --- a/test/t/test_vipw.py +++ b/test/t/test_vipw.py @@ -2,7 +2,6 @@ class TestVipw: - @pytest.mark.complete("vipw -") def test_1(self, completion): assert completion diff --git a/test/t/test_vmstat.py b/test/t/test_vmstat.py index 769f246e988..47b55f6f5bb 100644 --- a/test/t/test_vmstat.py +++ b/test/t/test_vmstat.py @@ -2,7 +2,6 @@ class TestVmstat: - @pytest.mark.complete("vmstat -") def test_1(self, completion): assert completion diff --git a/test/t/test_vncviewer.py b/test/t/test_vncviewer.py index 96b8878bf52..9e2f1486736 100644 --- a/test/t/test_vncviewer.py +++ b/test/t/test_vncviewer.py @@ -3,7 +3,6 @@ @pytest.mark.bashcomp(ignore_env=r"^-declare -f _vncviewer_bootstrap$") class TestVncviewer: - @pytest.mark.complete("vncviewer ") def test_1(self, completion): assert completion diff --git a/test/t/test_vpnc.py b/test/t/test_vpnc.py index f23a8b98833..29a120a4d0f 100644 --- a/test/t/test_vpnc.py +++ b/test/t/test_vpnc.py @@ -5,12 +5,9 @@ # On CentOS and Fedora, there's something fishy with consolehelper and # /usr/bin/vpnc going on at least when invoked as root; try to invoke the # one in /usr/sbin instead. - pre_cmds=( - "PATH=/usr/sbin:$PATH", - ), + pre_cmds=("PATH=/usr/sbin:$PATH",) ) class TestVpnc: - @pytest.mark.complete("vpnc -") def test_1(self, completion): assert completion diff --git a/test/t/test_watch.py b/test/t/test_watch.py index 4f8e3e2d34e..8387ae0a880 100644 --- a/test/t/test_watch.py +++ b/test/t/test_watch.py @@ -2,7 +2,6 @@ class TestWatch: - @pytest.mark.complete("watch -") def test_1(self, completion): assert completion diff --git a/test/t/test_wc.py b/test/t/test_wc.py index 929faad7ac7..eb7b5a855e6 100644 --- a/test/t/test_wc.py +++ b/test/t/test_wc.py @@ -2,8 +2,6 @@ class TestWc: - - @pytest.mark.complete("wc --", - skipif="! wc --help &>/dev/null") + @pytest.mark.complete("wc --", skipif="! wc --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_webmitm.py b/test/t/test_webmitm.py index 50658e8a13f..e9f85940cca 100644 --- a/test/t/test_webmitm.py +++ b/test/t/test_webmitm.py @@ -2,7 +2,6 @@ class TestWebmitm: - @pytest.mark.complete("webmitm -") def test_1(self, completion): assert completion diff --git a/test/t/test_wget.py b/test/t/test_wget.py index 61b84356439..f8af4fb37a7 100644 --- a/test/t/test_wget.py +++ b/test/t/test_wget.py @@ -2,7 +2,6 @@ class TestWget: - @pytest.mark.complete("wget ") def test_1(self, completion): assert not completion diff --git a/test/t/test_who.py b/test/t/test_who.py index 6554e4e96b7..d1f29ea77d0 100644 --- a/test/t/test_who.py +++ b/test/t/test_who.py @@ -2,8 +2,6 @@ class TestWho: - - @pytest.mark.complete("who --", - skipif="! who --help &>/dev/null") + @pytest.mark.complete("who --", skipif="! who --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_wine.py b/test/t/test_wine.py index 8ba133ced84..d0e5698b657 100644 --- a/test/t/test_wine.py +++ b/test/t/test_wine.py @@ -2,7 +2,6 @@ class TestWine: - @pytest.mark.complete("wine ", cwd="shared/default") def test_1(self, completion): assert completion == ["bar bar.d/", "foo.d/"] diff --git a/test/t/test_withlist.py b/test/t/test_withlist.py index bfa951ff8ed..752c3943c5e 100644 --- a/test/t/test_withlist.py +++ b/test/t/test_withlist.py @@ -2,7 +2,6 @@ class TestWithlist: - @pytest.mark.complete("withlist --") def test_1(self, completion): assert completion diff --git a/test/t/test_wodim.py b/test/t/test_wodim.py index 7e2b6dfb7ac..4b785b6d444 100644 --- a/test/t/test_wodim.py +++ b/test/t/test_wodim.py @@ -2,7 +2,6 @@ class TestWodim: - @pytest.mark.complete("wodim ") def test_1(self, completion): assert completion diff --git a/test/t/test_wol.py b/test/t/test_wol.py index d1287839286..8a6bea210e8 100644 --- a/test/t/test_wol.py +++ b/test/t/test_wol.py @@ -1,17 +1,14 @@ import pytest -@pytest.mark.bashcomp( - pre_cmds=( - "PATH=$PWD/shared/bin:$PATH", - ), -) +@pytest.mark.bashcomp(pre_cmds=("PATH=$PWD/shared/bin:$PATH",)) class TestWol: - @pytest.mark.complete("wol ") def test_1(self, completion): - assert completion == "00:00:00:00:00:00 11:11:11:11:11:11 " \ + assert ( + completion == "00:00:00:00:00:00 11:11:11:11:11:11 " "22:22:22:22:22:22 33:33:33:33:33:33".split() + ) @pytest.mark.complete("wol 00:") def test_2(self, completion): diff --git a/test/t/test_write.py b/test/t/test_write.py index 12646cd2543..8f0886e4a22 100644 --- a/test/t/test_write.py +++ b/test/t/test_write.py @@ -2,7 +2,6 @@ class TestWrite: - @pytest.mark.complete("write root") def test_1(self, completion): assert "root" in completion diff --git a/test/t/test_wsimport.py b/test/t/test_wsimport.py index c6ccd6c5a5d..b75bf0f738f 100644 --- a/test/t/test_wsimport.py +++ b/test/t/test_wsimport.py @@ -2,7 +2,6 @@ class TestWsimport: - @pytest.mark.complete("wsimport ") def test_1(self, completion): assert completion diff --git a/test/t/test_wtf.py b/test/t/test_wtf.py index cb3abc76dbd..6b2c9745ab2 100644 --- a/test/t/test_wtf.py +++ b/test/t/test_wtf.py @@ -2,7 +2,6 @@ class TestWtf: - @pytest.mark.complete("wtf A") def test_1(self, completion): assert completion diff --git a/test/t/test_wvdial.py b/test/t/test_wvdial.py index 1e0b1b2a29b..19043f6162e 100644 --- a/test/t/test_wvdial.py +++ b/test/t/test_wvdial.py @@ -2,7 +2,6 @@ class TestWvdial: - @pytest.mark.complete("wvdial -") def test_1(self, completion): assert completion diff --git a/test/t/test_xdg_mime.py b/test/t/test_xdg_mime.py index 89da5768bfb..432be0676bd 100644 --- a/test/t/test_xdg_mime.py +++ b/test/t/test_xdg_mime.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="xdg-mime", -) +@pytest.mark.bashcomp(cmd="xdg-mime") class TestXdgMime: - @pytest.mark.complete("xdg-mime ") def test_1(self, completion): assert completion diff --git a/test/t/test_xdg_settings.py b/test/t/test_xdg_settings.py index d3d231fcda2..a50df5794ac 100644 --- a/test/t/test_xdg_settings.py +++ b/test/t/test_xdg_settings.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="xdg-settings", -) +@pytest.mark.bashcomp(cmd="xdg-settings") class TestXdgSettings: - @pytest.mark.complete("xdg-settings ") def test_1(self, completion): assert completion diff --git a/test/t/test_xfreerdp.py b/test/t/test_xfreerdp.py index 6bb85491c93..fdad1926e1e 100644 --- a/test/t/test_xfreerdp.py +++ b/test/t/test_xfreerdp.py @@ -4,7 +4,6 @@ class TestXfreerdp: - def _help(self, bash): return assert_bash_exec(bash, "xfreerdp --help || :", want_output=True) diff --git a/test/t/test_xgamma.py b/test/t/test_xgamma.py index 49a474ecbcc..56c9440d655 100644 --- a/test/t/test_xgamma.py +++ b/test/t/test_xgamma.py @@ -2,7 +2,6 @@ class TestXgamma: - @pytest.mark.complete("xgamma -") def test_1(self, completion): assert completion diff --git a/test/t/test_xm.py b/test/t/test_xm.py index 180191d07af..42c4c53d682 100644 --- a/test/t/test_xm.py +++ b/test/t/test_xm.py @@ -2,7 +2,6 @@ class TestXm: - @pytest.mark.complete("xm ") def test_1(self, completion): assert completion diff --git a/test/t/test_xmllint.py b/test/t/test_xmllint.py index c666ccdd707..0c0ebbcde27 100644 --- a/test/t/test_xmllint.py +++ b/test/t/test_xmllint.py @@ -2,7 +2,6 @@ class TestXmllint: - @pytest.mark.complete("xmllint ") def test_1(self, completion): assert completion diff --git a/test/t/test_xmlwf.py b/test/t/test_xmlwf.py index 558b12e6ce9..8751f865084 100644 --- a/test/t/test_xmlwf.py +++ b/test/t/test_xmlwf.py @@ -2,7 +2,6 @@ class TestXmlwf: - @pytest.mark.complete("xmlwf ") def test_1(self, completion): assert completion diff --git a/test/t/test_xmms.py b/test/t/test_xmms.py index 1f7b74e329a..c99610964a4 100644 --- a/test/t/test_xmms.py +++ b/test/t/test_xmms.py @@ -2,7 +2,6 @@ class TestXmms: - @pytest.mark.complete("xmms --") def test_1(self, completion): assert completion diff --git a/test/t/test_xmodmap.py b/test/t/test_xmodmap.py index fabe1904940..d6d0ceae341 100644 --- a/test/t/test_xmodmap.py +++ b/test/t/test_xmodmap.py @@ -2,7 +2,6 @@ class TestXmodmap: - @pytest.mark.complete("xmodmap ") def test_1(self, completion): assert completion diff --git a/test/t/test_xpovray.py b/test/t/test_xpovray.py index 3603d96e656..4f603a7cce9 100644 --- a/test/t/test_xpovray.py +++ b/test/t/test_xpovray.py @@ -2,7 +2,6 @@ class TestXpovray: - @pytest.mark.complete("xpovray ") def test_1(self, completion): assert completion diff --git a/test/t/test_xrandr.py b/test/t/test_xrandr.py index 9712ddc3ada..e4e0d6b75ea 100644 --- a/test/t/test_xrandr.py +++ b/test/t/test_xrandr.py @@ -2,7 +2,6 @@ class TestXrandr: - @pytest.mark.complete("xrandr ") def test_1(self, completion): assert completion diff --git a/test/t/test_xrdb.py b/test/t/test_xrdb.py index 72445f5567e..8f675e6840d 100644 --- a/test/t/test_xrdb.py +++ b/test/t/test_xrdb.py @@ -2,7 +2,6 @@ class TestXrdb: - @pytest.mark.complete("xrdb ") def test_1(self, completion): assert completion diff --git a/test/t/test_xsltproc.py b/test/t/test_xsltproc.py index 5284141ac86..268987770f4 100644 --- a/test/t/test_xsltproc.py +++ b/test/t/test_xsltproc.py @@ -2,7 +2,6 @@ class TestXsltproc: - @pytest.mark.complete("xsltproc ") def test_1(self, completion): assert completion diff --git a/test/t/test_xvnc4viewer.py b/test/t/test_xvnc4viewer.py index 88635bd843d..72fe3f98eb9 100644 --- a/test/t/test_xvnc4viewer.py +++ b/test/t/test_xvnc4viewer.py @@ -2,7 +2,6 @@ class TestXvnc4viewer: - @pytest.mark.complete("xvnc4viewer -") def test_1(self, completion): assert completion diff --git a/test/t/test_xxd.py b/test/t/test_xxd.py index 57b0123fd7c..bd461eb72ba 100644 --- a/test/t/test_xxd.py +++ b/test/t/test_xxd.py @@ -2,7 +2,6 @@ class TestXxd: - @pytest.mark.complete("xxd ") def test_1(self, completion): assert completion diff --git a/test/t/test_xz.py b/test/t/test_xz.py index 03a51041ae3..6b92f480173 100644 --- a/test/t/test_xz.py +++ b/test/t/test_xz.py @@ -2,15 +2,16 @@ class TestXz: - @pytest.mark.complete("xz ") def test_1(self, completion): assert completion @pytest.mark.complete("xz -d xz/") def test_2(self, completion): - assert completion == "a/ bashcomp.lzma bashcomp.tar.xz " \ + assert ( + completion == "a/ bashcomp.lzma bashcomp.tar.xz " "bashcomp.tlz bashcomp.xz".split() + ) @pytest.mark.complete("xz xz/") def test_3(self, completion): diff --git a/test/t/test_xzdec.py b/test/t/test_xzdec.py index 8e2fa5970c2..e57c1b65ca2 100644 --- a/test/t/test_xzdec.py +++ b/test/t/test_xzdec.py @@ -2,7 +2,6 @@ class TestXzdec: - @pytest.mark.complete("xzdec ") def test_1(self, completion): assert completion diff --git a/test/t/test_ypcat.py b/test/t/test_ypcat.py index 14b7bf1c205..f743c5ad0ad 100644 --- a/test/t/test_ypcat.py +++ b/test/t/test_ypcat.py @@ -2,7 +2,6 @@ class TestYpcat: - @pytest.mark.complete("ypcat ") def test_1(self, completion): assert completion diff --git a/test/t/test_ypmatch.py b/test/t/test_ypmatch.py index dfbf2d1467b..db56320abcb 100644 --- a/test/t/test_ypmatch.py +++ b/test/t/test_ypmatch.py @@ -2,7 +2,6 @@ class TestYpmatch: - @pytest.mark.complete("ypmatch foo ") def test_1(self, completion): assert completion diff --git a/test/t/test_yum.py b/test/t/test_yum.py index 869784988ce..5d4a052b4d9 100644 --- a/test/t/test_yum.py +++ b/test/t/test_yum.py @@ -2,7 +2,6 @@ class TestYum: - @pytest.mark.complete("yum -") def test_1(self, completion): assert completion diff --git a/test/t/test_yum_arch.py b/test/t/test_yum_arch.py index f8f15e9dbd8..9bbc38ffab5 100644 --- a/test/t/test_yum_arch.py +++ b/test/t/test_yum_arch.py @@ -1,11 +1,8 @@ import pytest -@pytest.mark.bashcomp( - cmd="yum-arch", -) +@pytest.mark.bashcomp(cmd="yum-arch") class TestYumArch: - @pytest.mark.complete("yum-arch -") def test_1(self, completion): assert completion diff --git a/test/t/test_zopfli.py b/test/t/test_zopfli.py index b035f81f386..127eda28d4d 100644 --- a/test/t/test_zopfli.py +++ b/test/t/test_zopfli.py @@ -2,7 +2,6 @@ class TestZopfli: - @pytest.mark.complete("zopfli ") def test_1(self, completion): assert completion diff --git a/test/t/test_zopflipng.py b/test/t/test_zopflipng.py index a72efa6af21..a01e7bd7fed 100644 --- a/test/t/test_zopflipng.py +++ b/test/t/test_zopflipng.py @@ -2,7 +2,6 @@ class TestZopflipng: - @pytest.mark.complete("zopflipng ") def test_1(self, completion): assert completion diff --git a/test/t/unit/test_unit_count_args.py b/test/t/unit/test_unit_count_args.py index f458fee6458..c0afe736271 100644 --- a/test/t/unit/test_unit_count_args.py +++ b/test/t/unit/test_unit_count_args.py @@ -3,10 +3,10 @@ from conftest import assert_bash_exec, TestUnitBase -@pytest.mark.bashcomp(cmd=None, - ignore_env=r"^[+-](args|COMP_(WORDS|CWORD|LINE|POINT))=") +@pytest.mark.bashcomp( + cmd=None, ignore_env=r"^[+-](args|COMP_(WORDS|CWORD|LINE|POINT))=" +) class TestUnitCountArgs(TestUnitBase): - def _test(self, *args, **kwargs): return self._test_unit("_count_args %s; echo $args", *args, **kwargs) @@ -40,19 +40,27 @@ def test_6(self, bash): def test_7(self, bash): """a b -c d e| with -c arg excluded should set args to 2""" - output = self._test(bash, "(a b -c d e)", 4, "a b -c d e", 10, - arg='"" "@(-c|--foo)"') + output = self._test( + bash, "(a b -c d e)", 4, "a b -c d e", 10, arg='"" "@(-c|--foo)"' + ) assert output == "2" def test_8(self, bash): """a -b -c d e| with -c arg excluded and -b included should set args to 1""" - output = self._test(bash, "(a -b -c d e)", 4, "a -b -c d e", 11, - arg='"" "@(-c|--foo)" "-[b]"') + output = self._test( + bash, + "(a -b -c d e)", + 4, + "a -b -c d e", + 11, + arg='"" "@(-c|--foo)" "-[b]"', + ) assert output == "2" def test_9(self, bash): """a -b -c d e| with -b included should set args to 3""" - output = self._test(bash, "(a -b -c d e)", 4, "a -b -c d e", 11, - arg='"" "" "-b"') + output = self._test( + bash, "(a -b -c d e)", 4, "a -b -c d e", 11, arg='"" "" "-b"' + ) assert output == "3" diff --git a/test/t/unit/test_unit_expand.py b/test/t/unit/test_unit_expand.py index 1e5b1194aea..7c0a98364fe 100644 --- a/test/t/unit/test_unit_expand.py +++ b/test/t/unit/test_unit_expand.py @@ -5,11 +5,9 @@ @pytest.mark.bashcomp(cmd=None) class TestUnitExpand: - def test_1(self, bash): assert_bash_exec(bash, "_expand >/dev/null") def test_2(self, bash): """Test environment non-pollution, detected at teardown.""" - assert_bash_exec( - bash, 'foo() { _expand; }; foo; unset foo') + assert_bash_exec(bash, "foo() { _expand; }; foo; unset foo") diff --git a/test/t/unit/test_unit_expand_tilde_by_ref.py b/test/t/unit/test_unit_expand_tilde_by_ref.py index bde70ac2719..fbc172df3f7 100644 --- a/test/t/unit/test_unit_expand_tilde_by_ref.py +++ b/test/t/unit/test_unit_expand_tilde_by_ref.py @@ -5,7 +5,6 @@ @pytest.mark.bashcomp(cmd=None) class TestUnitExpandTildeByRef: - def test_1(self, bash): assert_bash_exec(bash, "__expand_tilde_by_ref >/dev/null") @@ -13,4 +12,5 @@ def test_2(self, bash): """Test environment non-pollution, detected at teardown.""" assert_bash_exec( bash, - '_x() { local aa="~"; __expand_tilde_by_ref aa; }; _x; unset _x') + '_x() { local aa="~"; __expand_tilde_by_ref aa; }; _x; unset _x', + ) diff --git a/test/t/unit/test_unit_filedir.py b/test/t/unit/test_unit_filedir.py index 88762dbcc09..dcd524031e2 100644 --- a/test/t/unit/test_unit_filedir.py +++ b/test/t/unit/test_unit_filedir.py @@ -5,6 +5,5 @@ @pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+COMPREPLY=") class TestUnitFiledir: - def test_1(self, bash): assert_bash_exec(bash, "_filedir >/dev/null") diff --git a/test/t/unit/test_unit_find_unique_completion_pair.py b/test/t/unit/test_unit_find_unique_completion_pair.py index bb062cf2f35..25cf9d3ba87 100644 --- a/test/t/unit/test_unit_find_unique_completion_pair.py +++ b/test/t/unit/test_unit_find_unique_completion_pair.py @@ -5,7 +5,6 @@ @pytest.mark.bashcomp(cmd=None) class TestUnitFindUniqueCompletionPair: - def _test(self, inp: str, exp: str) -> None: res = find_unique_completion_pair(inp.split()) if exp: @@ -36,13 +35,15 @@ def test_7(self): self._test("root username21 username2", "ro ot") def test_8(self): - self._test("long_user_name lang_user_name long_usor_name", - "lang_us er_name") + self._test( + "long_user_name lang_user_name long_usor_name", "lang_us er_name" + ) def test_9(self): self._test( "lang_user_name1 long_user_name lang_user_name long_usor_name", - "long_use r_name") + "long_use r_name", + ) def test_10(self): self._test("root username", "user name") diff --git a/test/t/unit/test_unit_get_comp_words_by_ref.py b/test/t/unit/test_unit_get_comp_words_by_ref.py index bf6b6d05be3..1603bad6591 100644 --- a/test/t/unit/test_unit_get_comp_words_by_ref.py +++ b/test/t/unit/test_unit_get_comp_words_by_ref.py @@ -4,14 +4,17 @@ @pytest.mark.bashcomp( - cmd=None, ignore_env=r"^(\+(cur|prev)|[+-]COMP_(WORDS|CWORD|LINE|POINT))=") + cmd=None, ignore_env=r"^(\+(cur|prev)|[+-]COMP_(WORDS|CWORD|LINE|POINT))=" +) class TestUnitGetCompWordsByRef(TestUnitBase): - def _test(self, bash, *args, **kwargs): assert_bash_exec(bash, "unset cur prev") output = self._test_unit( "_get_comp_words_by_ref %s cur prev; echo $cur,$prev", - bash, *args, **kwargs) + bash, + *args, + **kwargs + ) return output.strip() def test_1(self, bash): @@ -160,5 +163,5 @@ def test_28(self, bash): def test_29(self, bash): """a 'b&c|""" - output = self._test(bash, "(a \"'b&c\")", 1, "a 'b&c", 6) + output = self._test(bash, '(a "\'b&c")', 1, "a 'b&c", 6) assert output == "'b&c,a" diff --git a/test/t/unit/test_unit_get_cword.py b/test/t/unit/test_unit_get_cword.py index db46e733b64..3042dd290bd 100644 --- a/test/t/unit/test_unit_get_cword.py +++ b/test/t/unit/test_unit_get_cword.py @@ -3,10 +3,10 @@ from conftest import assert_bash_exec, TestUnitBase -@pytest.mark.bashcomp(cmd=None, - ignore_env=r"^[+-]COMP_(WORDS|CWORD|LINE|POINT)=") +@pytest.mark.bashcomp( + cmd=None, ignore_env=r"^[+-]COMP_(WORDS|CWORD|LINE|POINT)=" +) class TestUnitGetCword(TestUnitBase): - def _test(self, *args, **kwargs): return self._test_unit("_get_cword %s; echo", *args, **kwargs) @@ -55,7 +55,7 @@ def test_9(self, bash): def test_10(self, bash): r"""a 'b c| should return 'b c""" - output = self._test(bash, "(a \"'b c\")", 1, "a 'b c", 6) + output = self._test(bash, '(a "\'b c")', 1, "a 'b c", 6) assert output == "'b c" def test_11(self, bash): diff --git a/test/t/unit/test_unit_init_completion.py b/test/t/unit/test_unit_init_completion.py index 58eab6f4d5f..64f3b511fd2 100644 --- a/test/t/unit/test_unit_init_completion.py +++ b/test/t/unit/test_unit_init_completion.py @@ -6,16 +6,19 @@ @pytest.mark.bashcomp( cmd=None, ignore_env=r"^[+-](COMP(_(WORDS|CWORD|LINE|POINT)|REPLY)|" - r"cur|cword|words)=") + r"cur|cword|words)=", +) class TestUnitInitCompletion(TestUnitBase): - def test_1(self, bash): """Test environment non-pollution, detected at teardown.""" assert_bash_exec( - bash, 'foo() { local cur prev words cword; _init_completion; }; ' - 'foo; unset foo') + bash, + "foo() { local cur prev words cword; _init_completion; }; " + "foo; unset foo", + ) def test_2(self, bash): output = self._test_unit( - "_init_completion %s; echo $cur,$prev", bash, "(a)", 0, "a", 0) + "_init_completion %s; echo $cur,$prev", bash, "(a)", 0, "a", 0 + ) assert output == "," diff --git a/test/t/unit/test_unit_ip_addresses.py b/test/t/unit/test_unit_ip_addresses.py index a821a51e474..cd7a38abc19 100644 --- a/test/t/unit/test_unit_ip_addresses.py +++ b/test/t/unit/test_unit_ip_addresses.py @@ -5,20 +5,25 @@ @pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+COMPREPLY=") class TestUnitIpAddresses: - @pytest.fixture(scope="class") def functions(self, request, bash): - assert_bash_exec(bash, - "_ia() { local cur=$(_get_cword);unset COMPREPLY;" - "_ip_addresses; }") + assert_bash_exec( + bash, + "_ia() { local cur=$(_get_cword);unset COMPREPLY;" + "_ip_addresses; }", + ) assert_bash_exec(bash, "complete -F _ia ia") - assert_bash_exec(bash, - "_iaa() { local cur=$(_get_cword);unset COMPREPLY;" - "_ip_addresses -a; }") + assert_bash_exec( + bash, + "_iaa() { local cur=$(_get_cword);unset COMPREPLY;" + "_ip_addresses -a; }", + ) assert_bash_exec(bash, "complete -F _iaa iaa") - assert_bash_exec(bash, - " _ia6() { local cur=$(_get_cword);unset COMPREPLY;" - "_ip_addresses -6; }") + assert_bash_exec( + bash, + " _ia6() { local cur=$(_get_cword);unset COMPREPLY;" + "_ip_addresses -6; }", + ) assert_bash_exec(bash, "complete -F _ia6 ia6") def test_1(self, bash): diff --git a/test/t/unit/test_unit_longopt.py b/test/t/unit/test_unit_longopt.py index 94eb499d6d5..ac0ac836e24 100644 --- a/test/t/unit/test_unit_longopt.py +++ b/test/t/unit/test_unit_longopt.py @@ -7,19 +7,18 @@ @pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+COMPREPLY=") class TestUnitLongopt: - @pytest.fixture(scope="class") def functions(self, request, bash): - assert_bash_exec(bash, - "_grephelp() { cat _longopt/grep--help.txt; }") + assert_bash_exec(bash, "_grephelp() { cat _longopt/grep--help.txt; }") assert_bash_exec(bash, "complete -F _longopt _grephelp") @pytest.mark.complete("_grephelp --") def test_1(self, functions, completion): """First long option should be included""" assert completion - assert all(x in completion - for x in "--quiet --recursive --text".split()) + assert all( + x in completion for x in "--quiet --recursive --text".split() + ) @pytest.mark.complete("_grephelp -") def test_2(self, functions, completion): diff --git a/test/t/unit/test_unit_parse_help.py b/test/t/unit/test_unit_parse_help.py index 537e8fc1ba6..f75e6b37f49 100644 --- a/test/t/unit/test_unit_parse_help.py +++ b/test/t/unit/test_unit_parse_help.py @@ -7,7 +7,6 @@ @pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+declare -f fn$") class TestUnitParseHelp: - def test_1(self, bash): assert_bash_exec(bash, "fn() { echo; }") output = assert_bash_exec(bash, "_parse_help fn") @@ -153,12 +152,14 @@ def test_28(self, bash): def test_29(self, bash): """Test parsing from stdin.""" output = assert_bash_exec( - bash, "echo '-f or --foo' | _parse_help -", want_output=True) + bash, "echo '-f or --foo' | _parse_help -", want_output=True + ) assert output.split() == "--foo".split() def test_30(self, bash): """More than two dashes should not be treated as options.""" - assert_bash_exec(bash, - r"fn() { printf '%s\n' $'----\n---foo\n----- bar'; }") + assert_bash_exec( + bash, r"fn() { printf '%s\n' $'----\n---foo\n----- bar'; }" + ) output = assert_bash_exec(bash, "_parse_help fn") assert not output diff --git a/test/t/unit/test_unit_parse_usage.py b/test/t/unit/test_unit_parse_usage.py index f5b176ad14a..f0cb711479f 100644 --- a/test/t/unit/test_unit_parse_usage.py +++ b/test/t/unit/test_unit_parse_usage.py @@ -5,7 +5,6 @@ @pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+declare -f fn$") class TestUnitParseUsage: - def test_1(self, bash): assert_bash_exec(bash, "fn() { echo; }") output = assert_bash_exec(bash, "_parse_usage fn") @@ -57,12 +56,14 @@ def test_10(self, bash): assert output.split() == "--aa".split() def test_11(self, bash): - assert_bash_exec(bash, - "fn() { echo ----; echo ---foo; echo '----- bar'; }") + assert_bash_exec( + bash, "fn() { echo ----; echo ---foo; echo '----- bar'; }" + ) output = assert_bash_exec(bash, "_parse_usage fn") assert not output def test_12(self, bash): output = assert_bash_exec( - bash, "echo '[-duh]' | _parse_usage -", want_output=True) + bash, "echo '[-duh]' | _parse_usage -", want_output=True + ) assert output.split() == "-d -u -h".split() diff --git a/test/t/unit/test_unit_tilde.py b/test/t/unit/test_unit_tilde.py index 5a51da32b95..35a4e4c6f4f 100644 --- a/test/t/unit/test_unit_tilde.py +++ b/test/t/unit/test_unit_tilde.py @@ -5,26 +5,29 @@ @pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+COMPREPLY=") class TestUnitTilde: - def test_1(self, bash): assert_bash_exec(bash, "_tilde >/dev/null") def test_2(self, bash): """Test environment non-pollution, detected at teardown.""" assert_bash_exec( - bash, - 'foo() { local aa="~"; _tilde "$aa"; }; foo; unset foo') + bash, 'foo() { local aa="~"; _tilde "$aa"; }; foo; unset foo' + ) def test_3(self, bash): """Test for https://bugs.debian.org/766163""" - assert_bash_exec(bash, '_tilde ~-o') + assert_bash_exec(bash, "_tilde ~-o") def _test_part_full(self, bash, part, full): - res = assert_bash_exec( - bash, - '_tilde "~%s"; echo "${COMPREPLY[@]}"' % part, - want_output=True, - ).strip().split() + res = ( + assert_bash_exec( + bash, + '_tilde "~%s"; echo "${COMPREPLY[@]}"' % part, + want_output=True, + ) + .strip() + .split() + ) assert res assert res[0] == "~%s" % full From ee73bf7dce346d2ab20bd76d060c2906553c7792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 20 Apr 2019 11:32:39 +0300 Subject: [PATCH 0085/1094] *: format Perl code with perltidy --- .gitignore | 2 ++ .perltidyrc | 4 ++++ Makefile.am | 2 +- helpers/perl | 25 ++++++++++++++----------- 4 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 .perltidyrc diff --git a/.gitignore b/.gitignore index 31d577702a6..49e6ac22a88 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ __pycache__/ .pytest_cache/ .python-version pytestdebug.log +helpers/perl.bak +helpers/perl.tdy diff --git a/.perltidyrc b/.perltidyrc new file mode 100644 index 00000000000..d2c3838f7c4 --- /dev/null +++ b/.perltidyrc @@ -0,0 +1,4 @@ +--perl-best-practices +--maximum-line-length=79 +--paren-tightness=2 +--cuddled-else diff --git a/Makefile.am b/Makefile.am index 87862675f67..88bbc23482d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,7 +27,7 @@ CLEANFILES = bash_completion.sh bash-completion.pc \ bash-completion-config.cmake bash-completion-config-version.cmake EXTRA_DIST = CHANGES $(pkgdata_DATA) bash_completion.sh.in .dir-locals.el \ - .editorconfig README.md CONTRIBUTING.md pyproject.toml + .editorconfig README.md CONTRIBUTING.md pyproject.toml .perltidyrc install-data-hook: tmpfile=`mktemp $${TMPDIR:-/tmp}/bash_completion.XXXXXX` && \ diff --git a/helpers/perl b/helpers/perl index 2a01a09602e..af39fa29c52 100644 --- a/helpers/perl +++ b/helpers/perl @@ -15,16 +15,16 @@ sub print_modules_real { # (the shorter being the pattern to be used as the regexp) # word 'Fi', base 'File' -> match 'File' against 'Fi' # word 'File::Sp', base 'File' -> match 'File::Sp' against 'File' - return if - $base && - $word && - $base !~ /^\Q$word/ && - $word !~ /^\Q$base/; + return + if $base + && $word + && $base !~ /^\Q$word/ + && $word !~ /^\Q$base/; chdir($dir) or return; # print each file - foreach my $file (sort(glob('*.pm'),glob('*.pod'))) { + foreach my $file (sort(glob('*.pm'), glob('*.pod'))) { next if ($file =~ /\.pod$/ and not $include_pod); $file =~ s/\.(?:pm|pod)$//; my $module = $base . $file; @@ -34,14 +34,17 @@ sub print_modules_real { } # recurse in each subdirectory - foreach my $directory (grep { -d } glob('*')) { + foreach my $directory (grep {-d} glob('*')) { my $subdir = $dir . '/' . $directory; if ($directory =~ /^(?:[.\d]+|$Config{archname}|auto)$/) { + # exclude subdirectory name from base print_modules_real(undef, $subdir, $word, $include_pod); } else { + # add subdirectory name to base - print_modules_real($base . $directory . '::', $subdir, $word, $include_pod); + print_modules_real($base . $directory . '::', + $subdir, $word, $include_pod); } } } @@ -60,7 +63,7 @@ sub print_functions { my ($word) = @_; my $perlfunc; - for ( @INC, undef ) { + for (@INC, undef) { return if not defined; $perlfunc = catfile $_, qw( pod perlfunc.pod ); last if -r $perlfunc; @@ -69,11 +72,11 @@ sub print_functions { open my $fh, '<', $perlfunc or return; my $nest_level = -1; - while ( <$fh> ) { + while (<$fh>) { next if 1 .. /^=head2 Alphabetical Listing of Perl Functions$/; ++$nest_level if /^=over/; --$nest_level if /^=back/; - next if $nest_level; + next if $nest_level; next unless /^=item (-?\w+)/; my $function = $1; next if $function !~ /^\Q$word/; From 9be5de1e2ef3c9186c9cb317c12198073b50ed44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 20 Apr 2019 11:48:31 +0300 Subject: [PATCH 0086/1094] test: check for perltidy errors and warnings --- .gitignore | 1 + .perltidyrc | 1 + helpers/perl | 5 ++--- test/docker/docker-script.sh | 5 +++++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 49e6ac22a88..a7d66548a43 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ __pycache__/ pytestdebug.log helpers/perl.bak helpers/perl.tdy +helpers/perl.ERR diff --git a/.perltidyrc b/.perltidyrc index d2c3838f7c4..cf0a0e4c019 100644 --- a/.perltidyrc +++ b/.perltidyrc @@ -2,3 +2,4 @@ --maximum-line-length=79 --paren-tightness=2 --cuddled-else +--warning-output diff --git a/helpers/perl b/helpers/perl index af39fa29c52..83ab1a10e7e 100644 --- a/helpers/perl +++ b/helpers/perl @@ -30,7 +30,7 @@ sub print_modules_real { my $module = $base . $file; next if $module !~ /^\Q$word/; next if $seen{$module}++; - print $module . "\n"; + print $module, "\n"; } # recurse in each subdirectory @@ -81,7 +81,7 @@ sub print_functions { my $function = $1; next if $function !~ /^\Q$word/; next if $seen{$function}++; - print $function . "\n"; + print $function, "\n"; } } @@ -96,4 +96,3 @@ if ($type eq 'functions') { } elsif ($type eq 'perldocs') { print_modules($word, 1); } - diff --git a/test/docker/docker-script.sh b/test/docker/docker-script.sh index bd8ef446137..7d1bcff0845 100755 --- a/test/docker/docker-script.sh +++ b/test/docker/docker-script.sh @@ -2,6 +2,11 @@ if [ $DIST = tools ]; then perlcritic helpers/perl + perltidy -nst -nse helpers/perl + if [ -e helpers/perl.ERR ]; then + cat helpers/perl.ERR + exit 1 + fi flake8 helpers/python test test/generate black --check -t py27 -t py33 -t py34 -t py35 -t py36 -t py37 -t py38 \ helpers/python From 4ebda77e88fce26e7e88abe035a6daae33a6c72a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 20 Apr 2019 11:51:32 +0300 Subject: [PATCH 0087/1094] test/tools: run all tools, don't stop at first failure --- test/docker/docker-script.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/test/docker/docker-script.sh b/test/docker/docker-script.sh index 7d1bcff0845..fe3e7c348f5 100755 --- a/test/docker/docker-script.sh +++ b/test/docker/docker-script.sh @@ -1,17 +1,18 @@ #!/bin/sh -ex if [ $DIST = tools ]; then - perlcritic helpers/perl - perltidy -nst -nse helpers/perl + rc=0 + perlcritic helpers/perl; rc=$((rc+1)) + perltidy -nst -nse helpers/perl; rc=$((rc+1)) if [ -e helpers/perl.ERR ]; then cat helpers/perl.ERR - exit 1 + rc=$((rc+1)) fi - flake8 helpers/python test test/generate + flake8 helpers/python test test/generate; rc=$((rc+1)) black --check -t py27 -t py33 -t py34 -t py35 -t py36 -t py37 -t py38 \ - helpers/python - black --check test test/generate - exit 0 + helpers/python; rc=$((rc+1)) + black --check test test/generate; rc=$((rc+1)) + exit $rc fi if [ "$BSD" ]; then From 834339fafabf9cab22c7708ca3c964e3fa8b769b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 20 Apr 2019 13:51:07 +0300 Subject: [PATCH 0088/1094] *: arithmetic expression related cleanups --- bash_completion | 10 +++++----- completions/_mock | 2 +- completions/_renice | 2 +- completions/arch | 2 +- completions/cfrun | 2 +- completions/cvs | 2 +- completions/dict | 9 +++------ completions/dpkg | 3 +-- completions/ktutil | 2 +- completions/lvm | 2 +- completions/mplayer | 3 +-- completions/pkg-get | 3 +-- completions/pkgrm | 2 +- completions/postcat | 4 +--- completions/postconf | 5 ++--- completions/postmap | 7 +++---- completions/postsuper | 14 ++++---------- completions/strace | 2 +- 18 files changed, 30 insertions(+), 46 deletions(-) diff --git a/bash_completion b/bash_completion index 6a2520b9ff8..5d3cc7bac9b 100644 --- a/bash_completion +++ b/bash_completion @@ -318,7 +318,7 @@ __get_cword_at_cursor_by_ref() local old_size=${#cur} cur="${cur#"${words[i]}"}" local new_size=${#cur} - index=$(( index - old_size + new_size )) + (( index -= old_size - new_size )) fi done # Clear $cur if just space(s) @@ -448,7 +448,7 @@ _get_cword() local old_size="${#cur}" cur="${cur#${words[i]}}" local new_size="${#cur}" - index=$(( index - old_size + new_size )) + (( index -= old_size - new_size )) fi done @@ -737,9 +737,9 @@ _init_completion() # If "bare" redirect, remove also the next word (skip=2). [[ ${words[i]} == $redir ]] && skip=2 || skip=1 words=( "${words[@]:0:i}" "${words[@]:i+skip}" ) - [[ $i -le $cword ]] && cword=$(( cword - skip )) + [[ $i -le $cword ]] && (( cword -= skip )) else - i=$(( ++i )) + (( i++ )) fi done @@ -1364,7 +1364,7 @@ _count_args() for (( i=1; i < cword; i++ )); do if [[ ${words[i]} != -* && ${words[i-1]} != $2 || ${words[i]} == $3 ]]; then - args=$(($args+1)) + (( args++ )) fi done } diff --git a/completions/_mock b/completions/_mock index 2377e3a68b8..a7df9b4b66c 100644 --- a/completions/_mock +++ b/completions/_mock @@ -18,7 +18,7 @@ _mock() elif [[ "$i" == --configdir=* ]] ; then cfgdir=${i/*=/} fi - count=$((++count)) + (( count++ )) done case $prev in diff --git a/completions/_renice b/completions/_renice index 1f1a610211c..2598533de34 100644 --- a/completions/_renice +++ b/completions/_renice @@ -24,7 +24,7 @@ _renice() _pids ;; esac - i=$(( ++i )) + (( i++ )) done } && complete -F _renice renice diff --git a/completions/arch b/completions/arch index 9630c77f120..e275577bc00 100644 --- a/completions/arch +++ b/completions/arch @@ -27,7 +27,7 @@ _arch() local args=$cword for (( i=1; i < cword; i++ )); do if [[ "${words[i]}" == -* ]]; then - args=$(($args-1)) + (( args-- )) fi done case $args in diff --git a/completions/cfrun b/completions/cfrun index 01052f78aed..0a7d0542a7f 100644 --- a/completions/cfrun +++ b/completions/cfrun @@ -8,7 +8,7 @@ _cfrun() local i section=1 for (( i=1; i < cword; i++ )); do if [[ "${words[i]}" == -- ]]; then - section=$((section + 1)) + (( section++ )) fi done diff --git a/completions/cvs b/completions/cvs index be3b3b06df1..e134653e40d 100644 --- a/completions/cvs +++ b/completions/cvs @@ -134,7 +134,7 @@ _cvs() elif [[ "$i" == -* ]]; then flags+=( $i ) fi - count=$((++count)) + (( count++ )) done case $mode in diff --git a/completions/dict b/completions/dict index 44180d495cb..c3ea9906e72 100644 --- a/completions/dict +++ b/completions/dict @@ -16,19 +16,16 @@ _dict() for (( i=1; i < cword; i++ )); do case ${words[i]} in --host|-!(-*)h) - host=${words[i+1]} + host=${words[++i]} [[ -n $host ]] && host="-h $host" - i=$((++i)) ;; --port|-!(-*)p) - port=${words[i+1]} + port=${words[++i]} [[ -n $port ]] && port="-p $port" - i=$((++i)) ;; --database|-!(-*)d) - db=${words[i+1]} + db=${words[++i]} [[ -n $db ]] && host="-d $db" - i=$((++i)) ;; esac done diff --git a/completions/dpkg b/completions/dpkg index d5f7e6efe77..827d9cad9ff 100644 --- a/completions/dpkg +++ b/completions/dpkg @@ -44,8 +44,7 @@ _dpkg() # find the last option flag if [[ $cur != -* ]]; then while [[ $prev != -* && $i -ne 1 ]]; do - i=$((i-1)) - prev=${words[i-1]} + prev=${words[--i - 1]} done fi diff --git a/completions/ktutil b/completions/ktutil index 5ee5fdad8be..572a2ec4dcf 100644 --- a/completions/ktutil +++ b/completions/ktutil @@ -57,7 +57,7 @@ _ktutil() for (( i=1; i < cword; i++ )); do case ${words[i]} in -k|--keytab) - i=$(($i+1)) + (( i++ )) ;; -*) ;; diff --git a/completions/lvm b/completions/lvm index 266a1e1e386..2f2b0a3cb06 100644 --- a/completions/lvm +++ b/completions/lvm @@ -58,7 +58,7 @@ _lvm_count_args() local i prev=${words[$offset-1]} for (( i=$offset; i < cword; i++ )); do if [[ "${words[i]}" != -* && $prev != $1 ]]; then - args=$(($args + 1)) + (( args++ )) fi prev=${words[i]} done diff --git a/completions/mplayer b/completions/mplayer index f2d3532fdc8..4c5c947b788 100644 --- a/completions/mplayer +++ b/completions/mplayer @@ -87,8 +87,7 @@ _mplayer() for i in ~/.mplayer/skins ${dirs[@]}; do if [[ -d $i && -r $i ]]; then for j in $(compgen -d -- $i/$cur); do - COMPREPLY[$k]=${j#$i/} - k=$((++k)) + COMPREPLY[k++]=${j#$i/} done fi done diff --git a/completions/pkg-get b/completions/pkg-get index d5382eb2545..d6e66785845 100644 --- a/completions/pkg-get +++ b/completions/pkg-get @@ -38,8 +38,7 @@ _pkg_get() i=${#COMP_WORDS[*]} while [[ $i -gt 0 ]]; do - i=$((i-1)) - if [[ "${COMP_WORDS[$i]}" == -s ]]; then + if [[ "${COMP_WORDS[--i]}" == -s ]]; then url="${COMP_WORDS[$((i+1))]}" fi if [[ "${COMP_WORDS[$i]}" == @(-[aDdiUu]|available|describe|download|install|list|updatecatalog|upgrade) ]]; then diff --git a/completions/pkgrm b/completions/pkgrm index 891507f839c..ef3b2a8d1ba 100644 --- a/completions/pkgrm +++ b/completions/pkgrm @@ -13,7 +13,7 @@ _pkgrm () local spool=/var/sadm/pkg local i=$cword while [[ $((i--)) -gt 0 ]]; do - i=$((i-1)) + (( i-- )) case "${words[$i]}" in -s) spool="${words[$((i+1))]}" diff --git a/completions/postcat b/completions/postcat index 68e95b7322d..22006233e67 100644 --- a/completions/postcat +++ b/completions/postcat @@ -23,12 +23,10 @@ _postcat() done if [[ $qfile -eq 1 ]]; then local len=${#cur} pval - idx=0 for pval in $(mailq 2>/dev/null | \ command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//'); do if [[ "$cur" == "${pval:0:$len}" ]]; then - COMPREPLY[$idx]=$pval - idx=$(($idx+1)) + COMPREPLY+=( $pval ) fi done return diff --git a/completions/postconf b/completions/postconf index bb6cfbfa7db..45b376bec6c 100644 --- a/completions/postconf +++ b/completions/postconf @@ -27,11 +27,10 @@ _postconf() return fi - local len=${#cur} idx=0 pval + local len=${#cur} pval for pval in $(/usr/sbin/postconf 2>/dev/null | cut -d ' ' -f 1); do if [[ "$cur" == "${pval:0:$len}" ]]; then - COMPREPLY[$idx]="$pval$eqext" - idx=$(($idx+1)) + COMPREPLY+=( "$pval$eqext" ) fi done } && diff --git a/completions/postmap b/completions/postmap index 051ddc86acc..66756c1e62d 100644 --- a/completions/postmap +++ b/completions/postmap @@ -24,14 +24,13 @@ _postmap() compopt -o filenames COMPREPLY=( $(compgen -f -- "${cur#*:}") ) else - local len=${#cur} idx=0 pval + local len=${#cur} pval for pval in $(/usr/sbin/postconf -m 2>/dev/null); do if [[ "$cur" == "${pval:0:$len}" ]]; then - COMPREPLY[$idx]="$pval:" - idx=$(($idx+1)) + COMPREPLY+=( "$pval:" ) fi done - if [[ $idx -eq 0 ]]; then + if [[ ! $COMPREPLY ]]; then compopt -o filenames COMPREPLY=( $(compgen -f -- "$cur") ) fi diff --git a/completions/postsuper b/completions/postsuper index 633449033f6..509d2484fda 100644 --- a/completions/postsuper +++ b/completions/postsuper @@ -5,7 +5,7 @@ _postsuper() local cur prev words cword _init_completion || return - local pval len idx + local pval len case $prev in -c) @@ -14,36 +14,30 @@ _postsuper() ;; -[dr]) len=${#cur} - idx=0 for pval in ALL $(mailq 2>/dev/null | \ command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//'); do if [[ "$cur" == "${pval:0:$len}" ]]; then - COMPREPLY[$idx]=$pval - idx=$(($idx+1)) + COMPREPLY+=( $pval ) fi done return ;; -h) len=${#cur} - idx=0 for pval in ALL $(mailq 2>/dev/null | \ command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* ].*$//; /!$/d'); do if [[ "$cur" == "${pval:0:$len}" ]]; then - COMPREPLY[$idx]=$pval - idx=$(($idx+1)) + COMPREPLY+=( $pval ) fi done return ;; -H) len=${#cur} - idx=0 for pval in ALL $(mailq 2>/dev/null | \ command sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; /^[0-9A-Z]*[* ]/d; s/!.*$//'); do if [[ "$cur" == "${pval:0:$len}" ]]; then - COMPREPLY[$idx]=$pval - idx=$(($idx+1)) + COMPREPLY+=( $pval ) fi done return diff --git a/completions/strace b/completions/strace index 3ce2bd15a8e..339780b6784 100644 --- a/completions/strace +++ b/completions/strace @@ -10,7 +10,7 @@ _strace() for (( i=1; i <= cword; i++ )); do case ${words[$i]} in -o|-e|-p) - i=$((i+1)) + (( i++ )) continue ;; -*) From 9f4a18fa20944d2cd2f30e196ddc9495c28566ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 20 Apr 2019 14:09:04 +0300 Subject: [PATCH 0089/1094] test/tools: fix exit status incrementation --- test/docker/docker-script.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/docker/docker-script.sh b/test/docker/docker-script.sh index fe3e7c348f5..931119c0e84 100755 --- a/test/docker/docker-script.sh +++ b/test/docker/docker-script.sh @@ -2,16 +2,16 @@ if [ $DIST = tools ]; then rc=0 - perlcritic helpers/perl; rc=$((rc+1)) - perltidy -nst -nse helpers/perl; rc=$((rc+1)) + perlcritic helpers/perl; rc=$((rc+$?)) + perltidy -nst -nse helpers/perl; rc=$((rc+$?)) if [ -e helpers/perl.ERR ]; then cat helpers/perl.ERR rc=$((rc+1)) fi - flake8 helpers/python test test/generate; rc=$((rc+1)) + flake8 helpers/python test test/generate; rc=$((rc+$?)) black --check -t py27 -t py33 -t py34 -t py35 -t py36 -t py37 -t py38 \ - helpers/python; rc=$((rc+1)) - black --check test test/generate; rc=$((rc+1)) + helpers/python; rc=$((rc+$?)) + black --check test test/generate; rc=$((rc+$?)) exit $rc fi From c59a2d0950cb5b20da46598889f31bc17ac3658c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 20 Apr 2019 16:14:03 +0300 Subject: [PATCH 0090/1094] gdb: relax core filename pattern Closes #300 --- completions/gdb | 2 +- test/fixtures/gdb/core | 0 test/fixtures/gdb/core.12345 | 0 ...bc46148827504908898ad152f43bffb2.5308.1555362132000000 | 0 test/t/test_gdb.py | 8 ++++++++ 5 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/gdb/core create mode 100644 test/fixtures/gdb/core.12345 create mode 100644 test/fixtures/gdb/core.weston.1000.bc46148827504908898ad152f43bffb2.5308.1555362132000000 diff --git a/completions/gdb b/completions/gdb index 6157fbe5528..b37387e1219 100644 --- a/completions/gdb +++ b/completions/gdb @@ -37,7 +37,7 @@ _gdb() COMPREPLY=( $(compgen -W "$(command ps axo comm,pid | \ awk '{if ($1 ~ /^'"${prev##*/}"'/) print $2}')" -- "$cur") ) compopt -o filenames - COMPREPLY+=( $(compgen -f -X '!?(*/)core?(.+([0-9]))' -o plusdirs \ + COMPREPLY+=( $(compgen -f -X '!?(*/)core?(.?*)' -o plusdirs \ -- "$cur") ) fi } && diff --git a/test/fixtures/gdb/core b/test/fixtures/gdb/core new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/fixtures/gdb/core.12345 b/test/fixtures/gdb/core.12345 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/fixtures/gdb/core.weston.1000.bc46148827504908898ad152f43bffb2.5308.1555362132000000 b/test/fixtures/gdb/core.weston.1000.bc46148827504908898ad152f43bffb2.5308.1555362132000000 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/t/test_gdb.py b/test/t/test_gdb.py index af3b8bab7e3..e8c322038cc 100644 --- a/test/t/test_gdb.py +++ b/test/t/test_gdb.py @@ -5,3 +5,11 @@ class TestGdb: @pytest.mark.complete("gdb - ") def test_1(self, completion): assert completion + + @pytest.mark.complete("gdb foo ", cwd="gdb") + def test_2(self, completion): + assert completion == sorted( + "core core.12345 " + "core.weston.1000.bc46148827504908898ad152f43bffb2.5308." + "1555362132000000".split() + ) From 3f88944e550b082984c71175e7a09a5f7801285e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 20 Apr 2019 17:35:33 +0300 Subject: [PATCH 0091/1094] _parse_help: look for long options somewhat more eagerly --- bash_completion | 2 +- test/t/unit/test_unit_parse_help.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/bash_completion b/bash_completion index 5d3cc7bac9b..6c88ca7b8b7 100644 --- a/bash_completion +++ b/bash_completion @@ -801,7 +801,7 @@ _parse_help() [[ $line == *([[:blank:]])-* ]] || continue # transform "-f FOO, --foo=FOO" to "-f , --foo=FOO" etc while [[ $line =~ \ - ((^|[^-])-[A-Za-z0-9?][[:space:]]+)\[?[A-Z0-9]+\]? ]]; do + ((^|[^-])-[A-Za-z0-9?][[:space:]]+)\[?[A-Z0-9]+([,_-]+[A-Z0-9]+)?(\.\.+)?\]? ]]; do line=${line/"${BASH_REMATCH[0]}"/"${BASH_REMATCH[1]}"} done __parse_options "${line// or /, }" diff --git a/test/t/unit/test_unit_parse_help.py b/test/t/unit/test_unit_parse_help.py index f75e6b37f49..4a02155b259 100644 --- a/test/t/unit/test_unit_parse_help.py +++ b/test/t/unit/test_unit_parse_help.py @@ -163,3 +163,21 @@ def test_30(self, bash): ) output = assert_bash_exec(bash, "_parse_help fn") assert not output + + def test_31(self, bash): + assert_bash_exec( + bash, + r"fn() { printf '%s\n' " + r"'-F ERROR_FORMAT, --error-format ERROR_FORMAT'; }", + ) + output = assert_bash_exec(bash, "_parse_help fn", want_output=True) + assert output.split() == "--error-format".split() + + def test_32(self, bash): + assert_bash_exec( + bash, + r"fn() { printf '%s\n' " + r"'-e CODE1,CODE2.. --exclude=CODE1,CODE2..'; }", + ) + output = assert_bash_exec(bash, "_parse_help fn", want_output=True) + assert output.split() == "--exclude=".split() From 6fa745848937b9714ca58cd0675d44c0f0145ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 20 Apr 2019 17:36:04 +0300 Subject: [PATCH 0092/1094] test: add some gdb non-core files --- test/fixtures/gdb/core-NOT | 0 test/fixtures/gdb/corenot | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 test/fixtures/gdb/core-NOT create mode 100644 test/fixtures/gdb/corenot diff --git a/test/fixtures/gdb/core-NOT b/test/fixtures/gdb/core-NOT new file mode 100644 index 00000000000..e69de29bb2d diff --git a/test/fixtures/gdb/corenot b/test/fixtures/gdb/corenot new file mode 100644 index 00000000000..e69de29bb2d From d2bec62f609e4ce4117ba74d5a81a45ad8e23369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 20 Apr 2019 22:36:34 +0300 Subject: [PATCH 0093/1094] test: port some more ssh test case to pytest+pexpect --- test/lib/completions/ssh.exp | 24 ------------------------ test/t/test_ssh.py | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/test/lib/completions/ssh.exp b/test/lib/completions/ssh.exp index c15231660ee..1702371cbde 100644 --- a/test/lib/completions/ssh.exp +++ b/test/lib/completions/ssh.exp @@ -19,21 +19,6 @@ proc teardown {} { setup -set test "Tab should complete both commands and hostname" - # Try completion -set cmd "ssh -F config ls" -send "$cmd\t" -set expected "^$cmd\r\n.*ls.*ls_known_host.*\r\n/@$cmd$" -expect { - -re $expected { pass "$test" } - -re /@ { unresolved "$test at prompt" } - default { unresolved "$test" } -} - - -sync_after_int - - set test "-F without space shouldn't error" # Try completion set cmd "ssh -F" @@ -50,15 +35,6 @@ expect { sync_after_int -set test "First argument shouldn't complete with commands" -# NOTE: This test assumes there's a command "bash" and no host named "bash" -set cmd "ssh bas" -assert_complete [get_known_hosts "bas"] $cmd $test - - -sync_after_int - - set test "First argument should complete partial hostname" # Build string list of hostnames, starting with the character of the first # host, unless host starts with a COMP_WORDBREAKS character, e.g. a colon (:). diff --git a/test/t/test_ssh.py b/test/t/test_ssh.py index 9126b91de19..5c8718ff9f3 100644 --- a/test/t/test_ssh.py +++ b/test/t/test_ssh.py @@ -5,3 +5,17 @@ class TestSsh: @pytest.mark.complete("ssh -Fsp", cwd="ssh") def test_1(self, completion): assert completion == "-Fspaced conf" + + @pytest.mark.complete("ssh -F config ls", cwd="ssh") + def test_2(self, completion): + """Should complete both commands and hostname.""" + assert all(x in completion for x in "ls ls_known_host".split()) + + @pytest.mark.complete("ssh bash", cwd="ssh") + def test_3(self, completion): + """ + First arg should not complete with commands. + + Assumes there's no "bash" known host. + """ + assert "bash" not in completion From aba556019b7707e24093cc1c1ae082bec743ba3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 20 Apr 2019 22:39:20 +0300 Subject: [PATCH 0094/1094] ssh: don't offer protocol v1 specific options if it's not supported --- completions/ssh | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/completions/ssh b/completions/ssh index ae8f78c34fa..7bfae906a8a 100644 --- a/completions/ssh +++ b/completions/ssh @@ -31,13 +31,12 @@ _ssh_macs() _ssh_options() { - compopt -o nospace - COMPREPLY=( $(compgen -S = -W 'AddKeysToAgent AddressFamily BatchMode - BindAddress CanonicalDomains CanonicalizeFallbackLocal - CanonicalizeHostname CanonicalizeMaxDots CanonicalizePermittedCNAMEs - CertificateFile ChallengeResponseAuthentication CheckHostIP Cipher - Ciphers ClearAllForwardings Compression CompressionLevel - ConnectionAttempts ConnectTimeout ControlMaster ControlPath + local opts=( + AddKeysToAgent AddressFamily BatchMode BindAddress CanonicalDomains + CanonicalizeFallbackLocal CanonicalizeHostname CanonicalizeMaxDots + CanonicalizePermittedCNAMEs CertificateFile + ChallengeResponseAuthentication CheckHostIP Ciphers ClearAllForwardings + Compression ConnectionAttempts ConnectTimeout ControlMaster ControlPath ControlPersist DynamicForward EnableSSHKeysign EscapeChar ExitOnForwardFailure FingerprintHash ForwardAgent ForwardX11 ForwardX11Timeout ForwardX11Trusted GatewayPorts GlobalKnownHostsFile @@ -50,15 +49,21 @@ _ssh_options() LocalCommand LocalForward LogLevel MACs NoHostAuthenticationForLocalhost NumberOfPasswordPrompts PasswordAuthentication PermitLocalCommand PKCS11Provider Port - PreferredAuthentications Protocol ProxyCommand ProxyJump ProxyUseFdpass + PreferredAuthentications ProxyCommand ProxyJump ProxyUseFdpass PubkeyAcceptedKeyTypes PubkeyAuthentication RekeyLimit RemoteCommand - RemoteForward RequestTTY RevokedHostKeys RhostsRSAAuthentication - RSAAuthentication SendEnv ServerAliveCountMax ServerAliveInterval - SmartcardDevice StreamLocalBindMask StreamLocalBindUnlink - StrictHostKeyChecking SyslogFacility TCPKeepAlive Tunnel TunnelDevice - UpdateHostKeys UsePrivilegedPort User UserKnownHostsFile - VerifyHostKeyDNS VisualHostKey XAuthLocation' \ - -- "$cur") ) + RemoteForward RequestTTY RevokedHostKeys SendEnv ServerAliveCountMax + ServerAliveInterval SmartcardDevice StreamLocalBindMask + StreamLocalBindUnlink StrictHostKeyChecking SyslogFacility TCPKeepAlive + Tunnel TunnelDevice UpdateHostKeys UsePrivilegedPort User + UserKnownHostsFile VerifyHostKeyDNS VisualHostKey XAuthLocation ) + local protocols=$(_ssh_query "$1" protocol-version) + if [[ -z $protocols || $protocols == *1* ]]; then + opts+=( Cipher CompressionLevel Protocol RhostsRSAAuthentication + RSAAuthentication ) + fi + + compopt -o nospace + COMPREPLY=( $(compgen -S = -W '${opts[@]}' -- "$cur" ) ) } # Complete a ssh suboption (like ForwardAgent=y) @@ -245,7 +250,7 @@ _ssh() return ;; -*o) - _ssh_options + _ssh_options "$1" return ;; -*Q) From 2f71b27557b196888971f2ada06f71f238939f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 21 Apr 2019 10:47:20 +0300 Subject: [PATCH 0095/1094] *: whitespace tweaks --- completions/_mock | 6 +++--- completions/_nmcli | 2 +- completions/_repomanage | 2 +- completions/_svn | 2 +- completions/_svnadmin | 2 +- completions/_svnlook | 2 +- completions/_xm | 2 +- completions/_yum | 2 +- completions/autoreconf | 2 +- completions/autoscan | 2 +- completions/cvsps | 2 +- completions/fusermount | 2 +- completions/growisofs | 2 +- completions/iscsiadm | 2 +- completions/jarsigner | 4 ++-- completions/k3b | 2 +- completions/lftp | 2 +- completions/lftpget | 2 +- completions/mdadm | 2 +- completions/pack200 | 2 +- completions/pkg-get | 2 +- completions/pkgadd | 2 +- completions/smartctl | 2 +- completions/svk | 2 +- completions/unpack200 | 2 +- completions/yum-arch | 2 +- test/lib/completions/scp.exp | 6 +++--- test/lib/library.exp | 4 ++-- test/runLint | 2 +- 29 files changed, 35 insertions(+), 35 deletions(-) diff --git a/completions/_mock b/completions/_mock index a7df9b4b66c..e596a4c45d1 100644 --- a/completions/_mock +++ b/completions/_mock @@ -13,9 +13,9 @@ _mock() for i in "${words[@]}" ; do [[ $count -eq $cword ]] && break - if [[ "$i" == --configdir ]] ; then + if [[ "$i" == --configdir ]]; then cfgdir="${words[((count+1))]}" - elif [[ "$i" == --configdir=* ]] ; then + elif [[ "$i" == --configdir=* ]]; then cfgdir=${i/*=/} fi (( count++ )) @@ -57,7 +57,7 @@ _mock() $split && return - if [[ "$cur" == -* ]] ; then + if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else diff --git a/completions/_nmcli b/completions/_nmcli index f2da67d8585..780a477f834 100644 --- a/completions/_nmcli +++ b/completions/_nmcli @@ -74,7 +74,7 @@ _nmcli() ;; esac - if [[ $cword -eq 1 ]] ; then + if [[ $cword -eq 1 ]]; then if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '--terse --pretty --mode --fields --escape --version --help' -- "$cur") ) diff --git a/completions/_repomanage b/completions/_repomanage index 5967d25de28..ea27f07e35d 100644 --- a/completions/_repomanage +++ b/completions/_repomanage @@ -12,7 +12,7 @@ _repomanage() $split && return - if [[ "$cur" == -* ]] ; then + if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else diff --git a/completions/_svn b/completions/_svn index ca1a61744e7..42e2dbe79a6 100644 --- a/completions/_svn +++ b/completions/_svn @@ -16,7 +16,7 @@ _svn() proplist plist pl propset pset ps resolved revert \ status stat st switch sw unlock update up' - if [[ $cword -eq 1 ]] ; then + if [[ $cword -eq 1 ]]; then if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '--version' -- "$cur") ) else diff --git a/completions/_svnadmin b/completions/_svnadmin index be9316cc7d7..7a86c43ec5a 100644 --- a/completions/_svnadmin +++ b/completions/_svnadmin @@ -12,7 +12,7 @@ _svnadmin() commands='create deltify dump help ? hotcopy list-dblogs list-unused-dblogs load lslocks lstxns recover rmlocks rmtxns setlog verify' - if [[ $cword -eq 1 ]] ; then + if [[ $cword -eq 1 ]]; then if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '--version' -- "$cur") ) else diff --git a/completions/_svnlook b/completions/_svnlook index 01484391d69..2cbd134bd52 100644 --- a/completions/_svnlook +++ b/completions/_svnlook @@ -12,7 +12,7 @@ _svnlook() commands='author cat changed date diff dirs-changed help ? h history info lock log propget pget pg proplist plist pl tree uuid youngest' - if [[ $cword -eq 1 ]] ; then + if [[ $cword -eq 1 ]]; then if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '--version' -- "$cur") ) else diff --git a/completions/_xm b/completions/_xm index eb6ad6b1e2d..d7b74b890b0 100644 --- a/completions/_xm +++ b/completions/_xm @@ -36,7 +36,7 @@ _xm() labels addlabel rmlabel getlabel dry-run resources dumppolicy setpolicy resetpolicy getpolicy shell help' - if [[ $cword -eq 1 ]] ; then + if [[ $cword -eq 1 ]]; then COMPREPLY=( $(compgen -W "$commands" -- "$cur") ) else if [[ "$cur" == *=* ]]; then diff --git a/completions/_yum b/completions/_yum index b233255076b..d5e06eca011 100644 --- a/completions/_yum +++ b/completions/_yum @@ -5,7 +5,7 @@ _yum_list() { - if [[ "$1" == all ]] ; then + if [[ "$1" == all ]]; then # Try to strip in between headings like "Available Packages" # This will obviously only work for English :P COMPREPLY=( $(yum -d 0 -C list $1 "$cur*" 2>/dev/null | \ diff --git a/completions/autoreconf b/completions/autoreconf index 855293ce742..91f3db76a9e 100644 --- a/completions/autoreconf +++ b/completions/autoreconf @@ -30,7 +30,7 @@ _autoreconf() return fi - if [[ $1 == autoheader ]] ; then + if [[ $1 == autoheader ]]; then _filedir '@(ac|in)' else _filedir -d diff --git a/completions/autoscan b/completions/autoscan index 7cd34f433d0..7fa74f7220e 100644 --- a/completions/autoscan +++ b/completions/autoscan @@ -23,7 +23,7 @@ _autoscan() return fi - if [[ $1 == autoupdate ]] ; then + if [[ $1 == autoupdate ]]; then _filedir '@(ac|in)' else _filedir -d diff --git a/completions/cvsps b/completions/cvsps index c46df189434..721a5b736d5 100644 --- a/completions/cvsps +++ b/completions/cvsps @@ -47,7 +47,7 @@ _cvsps() ;; esac - if [[ "$cur" == -* ]] ; then + if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) else _xfunc cvs _cvs_roots diff --git a/completions/fusermount b/completions/fusermount index e4c29630994..c40c18ce22f 100644 --- a/completions/fusermount +++ b/completions/fusermount @@ -17,7 +17,7 @@ _fusermount() ;; esac - if [[ "$cur" == -* ]] ; then + if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) else _filedir -d diff --git a/completions/growisofs b/completions/growisofs index a36e169da55..7c4f5251feb 100644 --- a/completions/growisofs +++ b/completions/growisofs @@ -15,7 +15,7 @@ _growisofs() return ;; /?(r)dev/*) - if [[ $cur == =* ]] ; then + if [[ $cur == =* ]]; then # e.g. /dev/dvd=foo.iso, /dev/dvdrw=/dev/zero cur="${cur#=}" _filedir diff --git a/completions/iscsiadm b/completions/iscsiadm index 37961e63043..1fa30db62fa 100644 --- a/completions/iscsiadm +++ b/completions/iscsiadm @@ -28,7 +28,7 @@ _iscsiadm() $split && return local options - if [[ $cword -gt 1 ]] ; then + if [[ $cword -gt 1 ]]; then case ${words[2]} in discovery) diff --git a/completions/jarsigner b/completions/jarsigner index e05ec2818d7..171865b23d6 100644 --- a/completions/jarsigner +++ b/completions/jarsigner @@ -34,14 +34,14 @@ _jarsigner() local i jar=false for (( i=0; i < ${#words[@]}-1; i++ )) ; do if [[ "${words[i]}" == *.jar && \ - "${words[i-1]}" != -signedjar ]] ; then + "${words[i-1]}" != -signedjar ]]; then jar=true break fi done if ! $jar ; then - if [[ "$cur" == -* ]] ; then + if [[ "$cur" == -* ]]; then # Documented as "should not be used": -internalsf, -sectionsonly COMPREPLY=( $(compgen -W '-keystore -storepass -storetype -keypass -sigfile -signedjar -digestalg -sigalg -verify diff --git a/completions/k3b b/completions/k3b index 111ae7b462a..b52e6de05d7 100644 --- a/completions/k3b +++ b/completions/k3b @@ -36,7 +36,7 @@ _k3b() ;; esac - if [[ "$cur" == -* ]] ; then + if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W "$(_parse_help "$1")" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else diff --git a/completions/lftp b/completions/lftp index 427800ae13c..41fb1356c49 100644 --- a/completions/lftp +++ b/completions/lftp @@ -15,7 +15,7 @@ _lftp() ;; esac - if [[ "$cur" == -* ]] ; then + if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return fi diff --git a/completions/lftpget b/completions/lftpget index fd0157b78b9..1583500cef5 100644 --- a/completions/lftpget +++ b/completions/lftpget @@ -5,7 +5,7 @@ _lftpget() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]] ; then + if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '-c -d -v' -- "$cur") ) fi } && diff --git a/completions/mdadm b/completions/mdadm index 0986f5af977..5fbd9bf3cc7 100644 --- a/completions/mdadm +++ b/completions/mdadm @@ -102,7 +102,7 @@ _mdadm() --force --config= --scan --metadata= --homehost=' if [[ "$cur" == -* ]]; then - if [[ $cword -eq 1 ]] ; then + if [[ $cword -eq 1 ]]; then COMPREPLY=( $(compgen -W "$options --assemble --build --create --monitor --grow" -- "$cur") ) else diff --git a/completions/pack200 b/completions/pack200 index 3ccdf3a9135..f35840b0312 100644 --- a/completions/pack200 +++ b/completions/pack200 @@ -54,7 +54,7 @@ _pack200() done if ! $pack ; then - if [[ "$cur" == -* ]] ; then + if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '--no-gzip --gzip --strip-debug --no-keep-file-order --segment-limit= --effort= --deflate-hint= --modification-time= --pass-file= --unknown-attribute= diff --git a/completions/pkg-get b/completions/pkg-get index d6e66785845..ea300b8b2a2 100644 --- a/completions/pkg-get +++ b/completions/pkg-get @@ -57,7 +57,7 @@ _pkg_get() return fi - if [[ ${cur} == -* ]] ; then + if [[ ${cur} == -* ]]; then local opts="-c -d -D -f -i -l -s -S -u -U -v" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return diff --git a/completions/pkgadd b/completions/pkgadd index 009f3a25460..576b4114c14 100644 --- a/completions/pkgadd +++ b/completions/pkgadd @@ -35,7 +35,7 @@ _pkgadd () -P|-k|-x) ;; *) - if [[ ${cur} == -* ]] ; then + if [[ ${cur} == -* ]]; then local opts="-a -A -d -k -n -M -P -r -R -s -v -V -x" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) else diff --git a/completions/smartctl b/completions/smartctl index 24f85df9179..c34ca598618 100644 --- a/completions/smartctl +++ b/completions/smartctl @@ -81,7 +81,7 @@ _smartctl_test() _smartctl_drivedb() { local prefix= - if [[ $cur == +* ]] ; then + if [[ $cur == +* ]]; then prefix=+ cur="${cur#+}" fi diff --git a/completions/svk b/completions/svk index b122ab7865f..f94356e1f9b 100644 --- a/completions/svk +++ b/completions/svk @@ -14,7 +14,7 @@ _svk() propget pg pget proplist pl plist propset ps pset pull push resolved revert smerge sm status st stat switch sw sync sy update up verify' - if [[ $cword -eq 1 ]] ; then + if [[ $cword -eq 1 ]]; then if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '--version' -- "$cur") ) else diff --git a/completions/unpack200 b/completions/unpack200 index 0e1957e9158..393df04d518 100644 --- a/completions/unpack200 +++ b/completions/unpack200 @@ -32,7 +32,7 @@ _unpack200() done if ! $pack ; then - if [[ "$cur" == -* ]] ; then + if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '--deflate-hint= --remove-pack-file --verbose --quiet --log-file= --help --version' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace diff --git a/completions/yum-arch b/completions/yum-arch index c0a66a819de..f2b902a3f68 100644 --- a/completions/yum-arch +++ b/completions/yum-arch @@ -5,7 +5,7 @@ _yum_arch() local cur prev words cword _init_completion || return - if [[ "$cur" == -* ]] ; then + if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '-d -v -vv -n -c -z -s -l -q' -- "$cur") ) else _filedir -d diff --git a/test/lib/completions/scp.exp b/test/lib/completions/scp.exp index 6b06cb25fe0..1497a7fbe80 100644 --- a/test/lib/completions/scp.exp +++ b/test/lib/completions/scp.exp @@ -23,11 +23,11 @@ set test "Tab should complete remote pwd" set host bash_completion # Retrieving home directory (host_pwd) from ssh-host `bash_completion' - # yields error? + # yields error? if { [catch { - exec -- ssh -o "Batchmode yes" -o "ConnectTimeout 1" $host pwd 2>> /dev/null - } host_pwd] + exec -- ssh -o "Batchmode yes" -o "ConnectTimeout 1" $host pwd 2>>/dev/null + } host_pwd] } { # Yes, retrieving pwd from ssh yields error; reset `host_pwd' # Indicate host pwd is unknown and test is unsupported diff --git a/test/lib/library.exp b/test/lib/library.exp index 171b7c65816..899d74b61b9 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -51,7 +51,7 @@ proc assert_bash_exec {{aCmd ""} {title ""} {prompt /@} {out -1}} { # @param string $command Command to locate proc assert_bash_type {command} { set test "$command should be available in bash" - set cmd "type $command &> /dev/null && echo -n 0 || echo -n 1" + set cmd "type $command &>/dev/null && echo -n 0 || echo -n 1" send "$cmd\r" expect "$cmd\r\n" expect { @@ -646,7 +646,7 @@ proc init_tcl_bash_globals {} { # @return boolean True (1) if completion is installed, False (0) if not. proc assert_install_completion_for {command} { set test "$command should have completion installed in bash" - set cmd "__load_completion $command ; complete -p $command &> /dev/null && echo -n 0 || echo -n 1" + set cmd "__load_completion $command ; complete -p $command &>/dev/null && echo -n 0 || echo -n 1" send "$cmd\r" expect "$cmd\r\n" expect { diff --git a/test/runLint b/test/runLint index 2db8f358fb3..d1716184e48 100755 --- a/test/runLint +++ b/test/runLint @@ -5,7 +5,7 @@ gitgrep() local out=$(git grep -I -P -n "$1" | \ grep -E '^(bash_completion|completions/|test/)' | \ grep -Fv 'test/runLint') - if [ -n "$out" ] ; then + if [ -n "$out" ]; then printf '***** %s\n' "$2" printf '%s\n\n' "$out" fi From 82ffbb2d157bc401c0838fe98146fa89ecf8c56b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 21 Apr 2019 10:57:46 +0300 Subject: [PATCH 0096/1094] various: apply file vs dir special cases also when invoked with full path Affects autoheader, autoupdate, chroot, ci, rmdir, and mkdir. --- bash_completion | 4 ++-- completions/autoreconf | 2 +- completions/autoscan | 2 +- completions/rcs | 2 +- test/t/test_chroot.py | 5 +++++ test/t/test_rmdir.py | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/bash_completion b/bash_completion index 6c88ca7b8b7..2df086d6c9d 100644 --- a/bash_completion +++ b/bash_completion @@ -1882,10 +1882,10 @@ _longopt() printf '%s\n' ${BASH_REMATCH[0]} done)" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace - elif [[ "$1" == @(rmdir|chroot) ]]; then + elif [[ "$1" == *@(rmdir|chroot) ]]; then _filedir -d else - [[ "$1" == mkdir ]] && compopt -o nospace + [[ "$1" == *mkdir ]] && compopt -o nospace _filedir fi } diff --git a/completions/autoreconf b/completions/autoreconf index 91f3db76a9e..cf983312b34 100644 --- a/completions/autoreconf +++ b/completions/autoreconf @@ -30,7 +30,7 @@ _autoreconf() return fi - if [[ $1 == autoheader ]]; then + if [[ $1 == *autoheader ]]; then _filedir '@(ac|in)' else _filedir -d diff --git a/completions/autoscan b/completions/autoscan index 7fa74f7220e..5f70a50826c 100644 --- a/completions/autoscan +++ b/completions/autoscan @@ -23,7 +23,7 @@ _autoscan() return fi - if [[ $1 == autoupdate ]]; then + if [[ $1 == *autoupdate ]]; then _filedir '@(ac|in)' else _filedir -d diff --git a/completions/rcs b/completions/rcs index 41b953df4c9..cfad021195c 100644 --- a/completions/rcs +++ b/completions/rcs @@ -29,7 +29,7 @@ _rcs() # default to files if nothing returned and we're checking in. # otherwise, default to directories - [[ ${#COMPREPLY[@]} -eq 0 && $1 == ci ]] && _filedir || _filedir -d + [[ ${#COMPREPLY[@]} -eq 0 && $1 == *ci ]] && _filedir || _filedir -d } && complete -F _rcs ci co rlog rcs rcsdiff diff --git a/test/t/test_chroot.py b/test/t/test_chroot.py index 1f28cefa394..99ca56b0f82 100644 --- a/test/t/test_chroot.py +++ b/test/t/test_chroot.py @@ -5,3 +5,8 @@ class TestChroot: @pytest.mark.complete("chroot ") def test_1(self, completion): assert completion + + @pytest.mark.complete("/bin/chroot shared/default/") + def test_2(self, completion): + """Should complete dirs only, also when invoked using full path.""" + assert completion == ["bar bar.d/", "foo.d/"] diff --git a/test/t/test_rmdir.py b/test/t/test_rmdir.py index f6bd9b6aaa3..d416819aac3 100644 --- a/test/t/test_rmdir.py +++ b/test/t/test_rmdir.py @@ -6,6 +6,7 @@ class TestRmdir: def test_1(self, completion): assert completion - @pytest.mark.complete("rmdir shared/default/") + @pytest.mark.complete("/bin/rmdir shared/default/") def test_2(self, completion): + """Should complete dirs only, also when invoked using full path.""" assert completion == ["bar bar.d/", "foo.d/"] From a8c4417ae5931fb9b172e3ff85d18e81061da8a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 21 Apr 2019 11:00:32 +0300 Subject: [PATCH 0097/1094] phing: don't complete -l with files --- completions/ant | 2 +- test/t/test_ant.py | 4 ++++ test/t/test_phing.py | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/completions/ant b/completions/ant index 7e49baea722..10e772e218c 100644 --- a/completions/ant +++ b/completions/ant @@ -39,7 +39,7 @@ _ant() return ;; -logfile|-l) - _filedir + [[ $1 != *phing || $prev != -l ]] && _filedir return ;; -propertyfile) diff --git a/test/t/test_ant.py b/test/t/test_ant.py index 225a1148428..e18b6eb45b0 100644 --- a/test/t/test_ant.py +++ b/test/t/test_ant.py @@ -20,3 +20,7 @@ def test_3(self, completion): ) def test_4(self, completion): assert completion == "named-build" + + @pytest.mark.complete("ant -l ") + def test_5(self, completion): + assert completion diff --git a/test/t/test_phing.py b/test/t/test_phing.py index 6caef26d715..2e8c10694d6 100644 --- a/test/t/test_phing.py +++ b/test/t/test_phing.py @@ -5,3 +5,7 @@ class TestPhing: @pytest.mark.complete("phing -") def test_1(self, completion): assert completion + + @pytest.mark.complete("phing -l ") + def test_2(self, completion): + assert not completion From e41f07e0be7aa22d19ad9f877ffe7ea5d1c99ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 21 Apr 2019 12:24:46 +0300 Subject: [PATCH 0098/1094] phing: fix getting just a tab for options on CentOS 6 --- completions/ant | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/completions/ant b/completions/ant index 10e772e218c..ba141965d6f 100644 --- a/completions/ant +++ b/completions/ant @@ -62,7 +62,10 @@ _ant() if [[ $cur == -D* ]]; then return elif [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) + # The Date: Mon, 22 Apr 2019 10:15:19 +0300 Subject: [PATCH 0099/1094] *: add missing "ex: filetype=sh" Closes #302 --- completions/getconf | 2 ++ completions/nproc | 2 ++ completions/perltidy | 2 ++ completions/pv | 2 ++ completions/tox | 2 ++ completions/xdg-mime | 2 ++ completions/xdg-settings | 2 ++ 7 files changed, 14 insertions(+) diff --git a/completions/getconf b/completions/getconf index 0ff18eadb50..6e86e9de49a 100644 --- a/completions/getconf +++ b/completions/getconf @@ -28,3 +28,5 @@ _getconf() fi } && complete -F _getconf getconf + +# ex: filetype=sh diff --git a/completions/nproc b/completions/nproc index 28e0dea75c3..84092679c1a 100644 --- a/completions/nproc +++ b/completions/nproc @@ -19,3 +19,5 @@ _nproc() fi } && complete -F _nproc nproc + +# ex: filetype=sh diff --git a/completions/perltidy b/completions/perltidy index 993a1e2070a..ce93b2a50d6 100644 --- a/completions/perltidy +++ b/completions/perltidy @@ -51,3 +51,5 @@ _perltidy() fi } && complete -F _perltidy perltidy + +# ex: filetype=sh diff --git a/completions/pv b/completions/pv index 165dd7d9745..007bb36bc07 100644 --- a/completions/pv +++ b/completions/pv @@ -27,3 +27,5 @@ _pv() fi } && complete -F _pv pv + +# ex: filetype=sh diff --git a/completions/tox b/completions/tox index d0ec2cdcd66..a6418acad4d 100644 --- a/completions/tox +++ b/completions/tox @@ -33,3 +33,5 @@ _tox() fi } && complete -F _tox tox + +# ex: filetype=sh diff --git a/completions/xdg-mime b/completions/xdg-mime index dede3d57a9e..72e92c66758 100644 --- a/completions/xdg-mime +++ b/completions/xdg-mime @@ -69,3 +69,5 @@ _xdg_mime() esac } && complete -F _xdg_mime xdg-mime + +# ex: filetype=sh diff --git a/completions/xdg-settings b/completions/xdg-settings index 4ee743aca77..c14d37baf9b 100644 --- a/completions/xdg-settings +++ b/completions/xdg-settings @@ -27,3 +27,5 @@ _xdg_settings() fi } && complete -F _xdg_settings xdg-settings + +# ex: filetype=sh From b1a8a7d1c318d6fb2ffc5f050c887defa47ff77e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 22 Apr 2019 10:17:25 +0300 Subject: [PATCH 0100/1094] _upvar: delete, unused Closes #301 --- bash_completion | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/bash_completion b/bash_completion index 2df086d6c9d..a3e244b3496 100644 --- a/bash_completion +++ b/bash_completion @@ -150,27 +150,6 @@ dequote() } -# Assign variable one scope above the caller -# Usage: local "$1" && _upvar $1 "value(s)" -# Param: $1 Variable name to assign value to -# Param: $* Value(s) to assign. If multiple values, an array is -# assigned, otherwise a single value is assigned. -# NOTE: For assigning multiple variables, use '_upvars'. Do NOT -# use multiple '_upvar' calls, since one '_upvar' call might -# reassign a variable to be used by another '_upvar' call. -# See: http://fvue.nl/wiki/Bash:_Passing_variables_by_reference -_upvar() -{ - if unset -v "$1"; then # Unset & validate varname - if (( $# == 2 )); then - eval $1=\"\$2\" # Return single value - else - eval $1=\(\"\${@:2}\"\) # Return array - fi - fi -} - - # Assign variables one scope above the caller # Usage: local varname [varname ...] && # _upvars [-v varname value] | [-aN varname [value ...]] ... From 6970e6d62cf6ec1f6c79119843ad495b55f0d6de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 22 Apr 2019 10:54:05 +0300 Subject: [PATCH 0101/1094] Revert "_upvar: delete, unused" This reverts commit b1a8a7d1c318d6fb2ffc5f050c887defa47ff77e. Will deprecate it instead. --- bash_completion | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/bash_completion b/bash_completion index a3e244b3496..2df086d6c9d 100644 --- a/bash_completion +++ b/bash_completion @@ -150,6 +150,27 @@ dequote() } +# Assign variable one scope above the caller +# Usage: local "$1" && _upvar $1 "value(s)" +# Param: $1 Variable name to assign value to +# Param: $* Value(s) to assign. If multiple values, an array is +# assigned, otherwise a single value is assigned. +# NOTE: For assigning multiple variables, use '_upvars'. Do NOT +# use multiple '_upvar' calls, since one '_upvar' call might +# reassign a variable to be used by another '_upvar' call. +# See: http://fvue.nl/wiki/Bash:_Passing_variables_by_reference +_upvar() +{ + if unset -v "$1"; then # Unset & validate varname + if (( $# == 2 )); then + eval $1=\"\$2\" # Return single value + else + eval $1=\(\"\${@:2}\"\) # Return array + fi + fi +} + + # Assign variables one scope above the caller # Usage: local varname [varname ...] && # _upvars [-v varname value] | [-aN varname [value ...]] ... From 4f35b0cd7f6240addb68aa3127abe2a6dcc31411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 22 Apr 2019 10:58:04 +0300 Subject: [PATCH 0102/1094] _upvar: deprecate in favor of _upvars --- bash_completion | 1 + 1 file changed, 1 insertion(+) diff --git a/bash_completion b/bash_completion index 2df086d6c9d..e06e668adf6 100644 --- a/bash_completion +++ b/bash_completion @@ -161,6 +161,7 @@ dequote() # See: http://fvue.nl/wiki/Bash:_Passing_variables_by_reference _upvar() { + echo "bash: ${FUNCNAME[0]} is deprecated, use _upvars instead" 1>&2 if unset -v "$1"; then # Unset & validate varname if (( $# == 2 )); then eval $1=\"\$2\" # Return single value From 2a04042d530ed5dd1b746073f8ffc059c42f3fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 22 Apr 2019 11:36:07 +0300 Subject: [PATCH 0103/1094] *: error output consistency, use bash_completion prefix --- bash_completion | 41 +++++++++++++++++++++++------------------ completions/tar | 2 +- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/bash_completion b/bash_completion index e06e668adf6..bb1d46a204d 100644 --- a/bash_completion +++ b/bash_completion @@ -161,7 +161,8 @@ dequote() # See: http://fvue.nl/wiki/Bash:_Passing_variables_by_reference _upvar() { - echo "bash: ${FUNCNAME[0]} is deprecated, use _upvars instead" 1>&2 + echo "bash_completion: $FUNCNAME: deprecated function," \ + "use _upvars instead" >&2 if unset -v "$1"; then # Unset & validate varname if (( $# == 2 )); then eval $1=\"\$2\" # Return single value @@ -183,32 +184,33 @@ _upvar() _upvars() { if ! (( $# )); then - echo "${FUNCNAME[0]}: usage: ${FUNCNAME[0]} [-v varname"\ - "value] | [-aN varname [value ...]] ..." 1>&2 + echo "bash_completion: $FUNCNAME: usage: $FUNCNAME" \ + "[-v varname value] | [-aN varname [value ...]] ..." >&2 return 2 fi while (( $# )); do case $1 in -a*) # Error checking - [[ ${1#-a} ]] || { echo "bash: ${FUNCNAME[0]}: \`$1': missing"\ - "number specifier" 1>&2; return 1; } - printf %d "${1#-a}" &>/dev/null || { echo "bash:"\ - "${FUNCNAME[0]}: \`$1': invalid number specifier" 1>&2 + [[ ${1#-a} ]] || { echo "bash_completion: $FUNCNAME:" \ + "\`$1': missing number specifier" >&2; return 1; } + printf %d "${1#-a}" &>/dev/null || { echo bash_completion: \ + "$FUNCNAME: \`$1': invalid number specifier" >&2 return 1; } # Assign array of -aN elements [[ "$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; } + shift $((${1#-a} + 2)) || { echo bash_completion: \ + "$FUNCNAME: \`$1${2+ }$2': missing argument(s)" \ + >&2; return 1; } ;; -v) # Assign single value [[ "$2" ]] && unset -v "$2" && eval $2=\"\$3\" && - shift 3 || { echo "bash: ${FUNCNAME[0]}: $1: missing"\ - "argument(s)" 1>&2; return 1; } + shift 3 || { echo "bash_completion: $FUNCNAME: $1:" \ + "missing argument(s)" >&2; return 1; } ;; *) - echo "bash: ${FUNCNAME[0]}: $1: invalid option" 1>&2 + echo "bash_completion: $FUNCNAME: $1: invalid option" >&2 return 1 ;; esac done @@ -381,8 +383,8 @@ _get_comp_words_by_ref() prev) vprev=prev ;; cword) vcword=cword ;; words) vwords=words ;; - *) echo "bash: $FUNCNAME(): \`${!OPTIND}': unknown argument" \ - 1>&2; return 1 + *) echo "bash_completion: $FUNCNAME: \`${!OPTIND}':" \ + "unknown argument" >&2; return 1 ;; esac let "OPTIND += 1" done @@ -1449,7 +1451,8 @@ _known_hosts() # them recursively adding each result to the config variable _included_ssh_config_files() { - [[ $# -lt 1 ]] && echo "error: $FUNCNAME: missing mandatory argument CONFIG" + [[ $# -lt 1 ]] && \ + echo "bash_completion: $FUNCNAME: missing mandatory argument CONFIG" >&2 local configfile i f configfile=$1 local included=$(command sed -ne 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:blank:]]\{1,\}\([^#%]*\)\(#.*\)\{0,1\}$/\1/p' "${configfile}") @@ -1510,10 +1513,12 @@ _known_hosts_real() 6) ipv6=1 ;; esac done - [[ $# -lt $OPTIND ]] && echo "error: $FUNCNAME: missing mandatory argument CWORD" + [[ $# -lt $OPTIND ]] && \ + echo "bash_completion: $FUNCNAME: missing mandatory argument CWORD" >&2 cur=${!OPTIND}; let "OPTIND += 1" - [[ $# -ge $OPTIND ]] && echo "error: $FUNCNAME("$@"): unprocessed arguments:"\ - $(while [[ $# -ge $OPTIND ]]; do printf '%s\n' ${!OPTIND}; shift; done) + [[ $# -ge $OPTIND ]] && \ + echo "bash_completion: $FUNCNAME("$@"): unprocessed arguments:" \ + $(while [[ $# -ge $OPTIND ]]; do printf '%s\n' ${!OPTIND}; shift; done) >&2 [[ $cur == *@* ]] && user=${cur%@*}@ && cur=${cur#*@} kh=() diff --git a/completions/tar b/completions/tar index a70887d926b..3dfc20d8c30 100644 --- a/completions/tar +++ b/completions/tar @@ -57,7 +57,7 @@ __gtar_parse_help_opt() separator= ;; *) - echo >&2 "not an option $opt" + echo "bash_completion: $FUNCNAME: unknown option $opt" >&2 return 1 ;; esac From c8c1b4da2f11f03db9665ca974fbe3d616b471b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 22 Apr 2019 11:45:03 +0300 Subject: [PATCH 0104/1094] *: more arithmetic expression consistency --- bash_completion | 4 ++-- completions/tipc | 32 ++++++++++++++++---------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/bash_completion b/bash_completion index bb1d46a204d..dcf01c47104 100644 --- a/bash_completion +++ b/bash_completion @@ -386,7 +386,7 @@ _get_comp_words_by_ref() *) echo "bash_completion: $FUNCNAME: \`${!OPTIND}':" \ "unknown argument" >&2; return 1 ;; esac - let "OPTIND += 1" + (( OPTIND += 1 )) done __get_cword_at_cursor_by_ref "$exclude" words cword cur @@ -1515,7 +1515,7 @@ _known_hosts_real() done [[ $# -lt $OPTIND ]] && \ echo "bash_completion: $FUNCNAME: missing mandatory argument CWORD" >&2 - cur=${!OPTIND}; let "OPTIND += 1" + cur=${!OPTIND}; (( OPTIND += 1 )) [[ $# -ge $OPTIND ]] && \ echo "bash_completion: $FUNCNAME("$@"): unprocessed arguments:" \ $(while [[ $# -ge $OPTIND ]]; do printf '%s\n' ${!OPTIND}; shift; done) >&2 diff --git a/completions/tipc b/completions/tipc index 95d7f896579..5e04c704faf 100644 --- a/completions/tipc +++ b/completions/tipc @@ -95,7 +95,7 @@ _tipc() case "${words[$optind]}" in bearer) - let optind++ + (( optind++ )) if [[ $cword -eq $optind ]]; then COMPREPLY=( $(compgen -W 'enable disable set get list' -- $cur) ) @@ -105,7 +105,7 @@ _tipc() case "${words[$optind]}" in enable) local media params - let optind++ + (( optind++ )) if [[ $cword -lt $optind+4 ]]; then _tipc_bearer $optind @@ -151,12 +151,12 @@ _tipc() COMPREPLY=( $(compgen -W '${params[@]}' -- $cur) ) ;; disable) - let optind++ + (( optind++ )) _tipc_bearer $optind ;; get) - let optind++ + (( optind++ )) if [[ $cword -eq $optind ]]; then _tipc_link_opts @@ -165,7 +165,7 @@ _tipc() fi ;; set) - let optind++ + (( optind++ )) if [[ $cword -eq $optind ]]; then _tipc_link_opts @@ -176,7 +176,7 @@ _tipc() esac ;; link) - let optind++ + (( optind++ )) if [[ $cword -eq $optind ]]; then COMPREPLY=( $(compgen -W 'get set list statistics' -- $cur) ) @@ -185,7 +185,7 @@ _tipc() case "${words[$optind]}" in get) - let optind++ + (( optind++ )) if [[ $cword -eq $optind ]]; then _tipc_link_opts @@ -194,7 +194,7 @@ _tipc() fi ;; set) - let optind++ + (( optind++ )) if [[ $cword -eq $optind ]]; then _tipc_link_opts @@ -203,7 +203,7 @@ _tipc() fi ;; statistics) - let optind++ + (( optind++ )) if [[ $cword -eq $optind ]]; then COMPREPLY=( $(compgen -W 'show reset' -- $cur) ) @@ -219,7 +219,7 @@ _tipc() esac ;; media) - let optind++ + (( optind++ )) if [[ $cword -eq $optind ]]; then COMPREPLY=( $(compgen -W 'get set list' -- $cur) ) @@ -228,7 +228,7 @@ _tipc() case "${words[$optind]}" in get) - let optind++ + (( optind++ )) if [[ $cword -eq $optind ]]; then _tipc_link_opts @@ -237,7 +237,7 @@ _tipc() fi ;; set) - let optind++ + (( optind++ )) if [[ $cword -eq $optind ]]; then _tipc_link_opts @@ -248,14 +248,14 @@ _tipc() esac ;; nametable) - let optind++ + (( optind++ )) if [[ $cword -eq $optind ]]; then COMPREPLY=( $(compgen -W 'show' -- $cur) ) fi ;; node) - let optind++ + (( optind++ )) if [[ $cword -eq $optind ]]; then COMPREPLY=( $(compgen -W 'list get set' -- $cur) ) @@ -264,7 +264,7 @@ _tipc() case "${words[$optind]}" in get|set) - let optind++ + (( optind++ )) if [[ $cword -eq $optind ]]; then COMPREPLY=( $(compgen -W 'address netid' -- $cur) ) @@ -272,7 +272,7 @@ _tipc() esac ;; socket) - let optind++ + (( optind++ )) if [[ $cword -eq $optind ]]; then COMPREPLY=( $(compgen -W 'list' -- $cur) ) From 7abc83ee03fbe61d82b568479a5c50ad543a09c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 22 Apr 2019 12:15:38 +0300 Subject: [PATCH 0105/1094] tshark: ignore stderr when parsing -G, -L, and -h output To avoid getting running as root warning words included in completions. Running as user "root" and group "root". This could be dangerous. tshark: Lua: Error during loading: /usr/share/wireshark/init.lua:32: dofile has been disabled due to running Wireshark as superuser. See https://wiki.wireshark.org/CaptureSetup/CapturePrivileges for help in running Wireshark as an unprivileged user. --- completions/tshark | 10 ++++++---- test/t/test_tshark.py | 5 +++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/completions/tshark b/completions/tshark index 4864d4b1a0b..cb0e1fa19d3 100644 --- a/completions/tshark +++ b/completions/tshark @@ -24,7 +24,7 @@ _tshark() _filedir else [ -n "$_tshark_prefs" ] || - _tshark_prefs="$("$1" -G defaultprefs | command \ + _tshark_prefs="$("$1" -G defaultprefs 2>/dev/null | command\ sed -ne 's/^#\{0,1\}\([a-z0-9_.-]\{1,\}:\).*/\1/p' | tr '\n' ' ')" COMPREPLY=( $(compgen -P "$prefix" -W "$_tshark_prefs" \ @@ -49,7 +49,7 @@ _tshark() break fi done - COMPREPLY=( $(compgen -W "$("$1" $opts -L 2>&1 | \ + COMPREPLY=( $(compgen -W "$("$1" $opts -L 2>/dev/null | \ awk '/^ / { print $1 }')" -- "$cur") ) return ;; @@ -78,7 +78,8 @@ _tshark() ;; -*O) local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," - COMPREPLY=( $(compgen -W "$("$1" -G protocols 2>&1 | cut -f 3)" \ + COMPREPLY=( $(compgen -W \ + "$("$1" -G protocols 2>/dev/null | cut -f 3)" \ -- "${cur##*,}") ) [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} ) return @@ -126,7 +127,8 @@ _tshark() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h 2>/dev/null)' \ + -- "$cur") ) return fi } && diff --git a/test/t/test_tshark.py b/test/t/test_tshark.py index 5513d9c6e98..e92841403cd 100644 --- a/test/t/test_tshark.py +++ b/test/t/test_tshark.py @@ -22,3 +22,8 @@ def test_4(self, completion): @pytest.mark.complete("tshark -otcp") def test_5(self, completion): assert "-otcp.desegment_tcp_streams:" in completion + + @pytest.mark.complete("tshark -O http") + def test_6(self, completion): + """Test there are no URLs in completions.""" + assert not any("://" in x for x in completion) From 4548e71e90bf591e537eaed2e7890fb85650cb2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 22 Apr 2019 12:25:14 +0300 Subject: [PATCH 0106/1094] test: improve tshark -O arg completion test Refs #243 --- test/t/test_tshark.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/t/test_tshark.py b/test/t/test_tshark.py index e92841403cd..908312611c2 100644 --- a/test/t/test_tshark.py +++ b/test/t/test_tshark.py @@ -13,7 +13,9 @@ def test_2(self, completion): @pytest.mark.complete("tshark -O foo,htt") def test_3(self, completion): - assert completion + # When there's only one completion, it's be the one with "foo," prefix; + # when multiple (e.g. http and http2), it's the completion alone. + assert completion == "foo,http" or "http" in completion @pytest.mark.complete("tshark -o tcp") def test_4(self, completion): From b930bfc75af6229d456c58282e8bf80e04cfca5a Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Thu, 11 Oct 2018 21:48:52 +0200 Subject: [PATCH 0107/1094] tshark: speed up tshark -O completion Executing tshark can be slow (1 second for an ASAN+Debug build). Just memoize the output. For tshark v2.9.0rc0-2173-g9fcb4af6b6, this amounts to 21644 bytes. Closes #243 --- completions/tshark | 7 ++++--- test/t/test_tshark.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/completions/tshark b/completions/tshark index cb0e1fa19d3..2f18d0a37bd 100644 --- a/completions/tshark +++ b/completions/tshark @@ -78,9 +78,10 @@ _tshark() ;; -*O) local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," - COMPREPLY=( $(compgen -W \ - "$("$1" -G protocols 2>/dev/null | cut -f 3)" \ - -- "${cur##*,}") ) + [ -n "$_tshark_protocols" ] || + _tshark_protocols="$("$1" -G protocols 2>/dev/null | + cut -f 3 | tr '\n' ' ')" + COMPREPLY=( $(compgen -W "$_tshark_protocols" -- "${cur##*,}") ) [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} ) return ;; diff --git a/test/t/test_tshark.py b/test/t/test_tshark.py index 908312611c2..6505e6a8aa4 100644 --- a/test/t/test_tshark.py +++ b/test/t/test_tshark.py @@ -1,7 +1,7 @@ import pytest -@pytest.mark.bashcomp(ignore_env=r"^\+_tshark_prefs=") +@pytest.mark.bashcomp(ignore_env=r"^\+_tshark_pr(ef|otocol)s=") class TestTshark: @pytest.mark.complete("tshark -") def test_1(self, completion): From 6e2ddea986a3462070e6eafb098fc3d3f16bd835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 22 Apr 2019 13:19:35 +0300 Subject: [PATCH 0108/1094] apt-cache: protect showsrc against regex specials --- completions/apt-cache | 3 ++- test/t/test_apt_cache.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/completions/apt-cache b/completions/apt-cache index 1c091c561e1..5bd85e90426 100644 --- a/completions/apt-cache +++ b/completions/apt-cache @@ -7,7 +7,8 @@ _apt_cache_packages() { # List APT source packages _apt_cache_sources() { - apt-cache dumpavail | command grep "^Source: $1" | cut -f2 -d" " | sort -u + compgen -W "$(apt-cache dumpavail | \ + awk '$1 == "Source:" { print $2 }' | sort -u)" -- "$1" } # List APT source packages diff --git a/test/t/test_apt_cache.py b/test/t/test_apt_cache.py index 195df17b901..0cb50ef647f 100644 --- a/test/t/test_apt_cache.py +++ b/test/t/test_apt_cache.py @@ -6,3 +6,8 @@ class TestAptCache: @pytest.mark.complete("apt-cache ") def test_1(self, completion): assert completion + + @pytest.mark.complete("apt-cache showsrc [") + def test_2(self, completion): + # Doesn't actually fail on grep errors, but takes a long time. + assert not completion From 56703df67ddfaeccb0cc2fd7f529c63527f031a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 22 Apr 2019 14:33:46 +0300 Subject: [PATCH 0109/1094] test: adjust _get_comp_words_by_ref test to changed error output Was changed in commit 2a04042d530ed5dd1b746073f8ffc059c42f3fa2. --- test/unit/_get_comp_words_by_ref.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/_get_comp_words_by_ref.exp b/test/unit/_get_comp_words_by_ref.exp index 99d8d666ba2..a0e1886b1c2 100644 --- a/test/unit/_get_comp_words_by_ref.exp +++ b/test/unit/_get_comp_words_by_ref.exp @@ -26,7 +26,7 @@ setup set test {unknown argument should raise error} set cmd {_get_comp_words_by_ref dummy} -assert_bash_list {"bash: _get_comp_words_by_ref(): `dummy': unknown argument"} $cmd $test +assert_bash_list {"bash_completion: _get_comp_words_by_ref: `dummy': unknown argument"} $cmd $test sync_after_int set test "a b| to all vars"; # | = cursor position From 366488f2e3a806490eb1d7d6bcf674a8ea771f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 22 Apr 2019 14:50:51 +0300 Subject: [PATCH 0110/1094] synclient: remove unused local variable "split" Refs https://github.com/scop/bash-completion/issues/303 --- completions/synclient | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/synclient b/completions/synclient index 0c45068ff6a..e7371cb743b 100644 --- a/completions/synclient +++ b/completions/synclient @@ -2,7 +2,7 @@ _synclient() { - local cur prev words cword split + local cur prev words cword _init_completion -n = || return case $prev in From 1a698d526c5b6747c9b40f23c1d91db421c9846b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 22 Apr 2019 14:51:32 +0300 Subject: [PATCH 0111/1094] mypy, mysql, xmms: don't complete unknown split long option args Closes https://github.com/scop/bash-completion/issues/303 --- completions/mypy | 2 ++ completions/mysql | 2 ++ completions/xmms | 2 ++ test/t/test_mypy.py | 4 ++++ test/t/test_mysql.py | 4 ++++ test/t/test_xmms.py | 4 ++++ 6 files changed, 18 insertions(+) diff --git a/completions/mypy b/completions/mypy index df16956cd3a..82da1f08392 100644 --- a/completions/mypy +++ b/completions/mypy @@ -43,6 +43,8 @@ _mypy() ;; esac + $split && return + if [[ $cur == -* ]]; then COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) return diff --git a/completions/mysql b/completions/mysql index fb1f67e5674..ffb4bcd7dea 100644 --- a/completions/mysql +++ b/completions/mysql @@ -69,6 +69,8 @@ _mysql() ;; esac + $split && return + case $cur in --*) local help=$(_parse_help "$1") diff --git a/completions/xmms b/completions/xmms index 324f7677405..9f084c38df5 100644 --- a/completions/xmms +++ b/completions/xmms @@ -15,6 +15,8 @@ _xmms() ;; esac + $split && return + if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) else diff --git a/test/t/test_mypy.py b/test/t/test_mypy.py index 2dd1bbc477c..cecea92dd52 100644 --- a/test/t/test_mypy.py +++ b/test/t/test_mypy.py @@ -9,3 +9,7 @@ def test_1(self, completion): @pytest.mark.complete("mypy --") def test_2(self, completion): assert completion + + @pytest.mark.complete("mypy --non-existent-option=--") + def test_3(self, completion): + assert not completion diff --git a/test/t/test_mysql.py b/test/t/test_mysql.py index 67b58e328ca..6a44b7e59fa 100644 --- a/test/t/test_mysql.py +++ b/test/t/test_mysql.py @@ -9,3 +9,7 @@ def test_1(self, completion): @pytest.mark.complete("mysql --default-character-set=") def test_2(self, completion): assert completion + + @pytest.mark.complete("mysql --non-existent-option=--") + def test_3(self, completion): + assert not completion diff --git a/test/t/test_xmms.py b/test/t/test_xmms.py index c99610964a4..1c96e2b5ed9 100644 --- a/test/t/test_xmms.py +++ b/test/t/test_xmms.py @@ -5,3 +5,7 @@ class TestXmms: @pytest.mark.complete("xmms --") def test_1(self, completion): assert completion + + @pytest.mark.complete("xmms --non-existent-option=--") + def test_2(self, completion): + assert not completion From 22c5c3c286575bd782f956e16abe4522474ae75a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 22 Apr 2019 21:47:46 +0300 Subject: [PATCH 0112/1094] apt-get: protect source against regex specials --- completions/apt-get | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/completions/apt-get b/completions/apt-get index 33a60e0291c..3b00c56a1de 100644 --- a/completions/apt-get +++ b/completions/apt-get @@ -26,8 +26,8 @@ _apt_get() ;; source) COMPREPLY=( $(apt-cache --no-generate pkgnames "$cur" \ - 2>/dev/null) $(apt-cache dumpavail | \ - command grep "^Source: $cur" | sort -u | cut -f2 -d" ") ) + 2>/dev/null) $(compgen -W "$(apt-cache dumpavail | + awk '$1 == "Source:" { print $2 }' | sort -u)" -- "$cur") ) ;; install) if [[ $cur == */* ]]; then From 8a74451ec83af0741fff9d17003a13012fd1a00d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 22 Apr 2019 21:50:14 +0300 Subject: [PATCH 0113/1094] AUTHORS: remove unrelated project association from my entry --- AUTHORS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 4b547f10891..ee2daef7c74 100644 --- a/AUTHORS +++ b/AUTHORS @@ -4,4 +4,4 @@ Guillame Rousse (Mandriva) Igor Murzov Mike Kelly (Exherbo) Santiago M. Mola (Exherbo) -Ville Skyttä (Fedora/Red Hat) +Ville Skyttä From e83bf9b0a4e76d2ad361884a3c65eefbd685403f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 22 Apr 2019 22:04:06 +0300 Subject: [PATCH 0114/1094] test: shorten long gdb test core file name so tar doesn't croak on it --- ...2000000 => core.weston.1000.deadbeef.5308.1555362132000000} | 0 test/t/test_gdb.py | 3 +-- 2 files changed, 1 insertion(+), 2 deletions(-) rename test/fixtures/gdb/{core.weston.1000.bc46148827504908898ad152f43bffb2.5308.1555362132000000 => core.weston.1000.deadbeef.5308.1555362132000000} (100%) diff --git a/test/fixtures/gdb/core.weston.1000.bc46148827504908898ad152f43bffb2.5308.1555362132000000 b/test/fixtures/gdb/core.weston.1000.deadbeef.5308.1555362132000000 similarity index 100% rename from test/fixtures/gdb/core.weston.1000.bc46148827504908898ad152f43bffb2.5308.1555362132000000 rename to test/fixtures/gdb/core.weston.1000.deadbeef.5308.1555362132000000 diff --git a/test/t/test_gdb.py b/test/t/test_gdb.py index e8c322038cc..2ad12c48d78 100644 --- a/test/t/test_gdb.py +++ b/test/t/test_gdb.py @@ -10,6 +10,5 @@ def test_1(self, completion): def test_2(self, completion): assert completion == sorted( "core core.12345 " - "core.weston.1000.bc46148827504908898ad152f43bffb2.5308." - "1555362132000000".split() + "core.weston.1000.deadbeef.5308.1555362132000000".split() ) From 97a91f8993f45823c21fbc309c00915a0c1572e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 22 Apr 2019 23:04:20 +0300 Subject: [PATCH 0115/1094] iptables: improve existing table arg parsing --- completions/iptables | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/completions/iptables b/completions/iptables index 32ae48c5339..690726131c1 100644 --- a/completions/iptables +++ b/completions/iptables @@ -7,13 +7,8 @@ _iptables() local table chain='s/^Chain \([^ ]\{1,\}\).*$/\1/p' - if [[ ${words[@]} == *-t\ *filter* ]]; then - table="-t filter" - elif [[ ${words[@]} == *-t\ *nat* ]]; then - table="-t nat" - elif [[ ${words[@]} == *-t\ *mangle* ]]; then - table="-t mangle" - fi + [[ "${words[*]}" =~ [[:space:]]-(t|-table=?)[[:space:]]*([^[:space:]]+) ]] \ + && table="-t ${BASH_REMATCH[2]}" case $prev in -*[AIDRPFXLZ]) From f21c67f17fcc909745d59e3647398c50b2cd8eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 22 Apr 2019 23:05:54 +0300 Subject: [PATCH 0116/1094] test: add script to run shellcheck, run it in Travis, allowing failure for now --- .travis.yml | 2 ++ test/run-shellcheck | 4 ++++ 2 files changed, 6 insertions(+) create mode 100755 test/run-shellcheck diff --git a/.travis.yml b/.travis.yml index 7a73d6ed16c..353b55c3961 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,3 +20,5 @@ script: -e CI=true -e DIST=$DIST -e BSD=$BSD ${NETWORK:+--network $NETWORK} -t bash-completion:$DIST test/docker/docker-script.sh + - test $DIST = tools && + test/run-shellcheck -f gcc bash_completion completions/!(Makefile*) || true diff --git a/test/run-shellcheck b/test/run-shellcheck new file mode 100755 index 00000000000..3a18c9255ec --- /dev/null +++ b/test/run-shellcheck @@ -0,0 +1,4 @@ +#!/bin/sh -eu +cd "$(dirname $0)/.." +exec docker run --network none -tv "$PWD:/mnt:ro" \ + koalaman/shellcheck -s bash -S error "$@" From 996a203f07a075633baed3960763f34534ea2447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 23 Apr 2019 21:49:38 +0300 Subject: [PATCH 0117/1094] ebtables: improve existing table arg parsing --- completions/ebtables | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/completions/ebtables b/completions/ebtables index 696676d1f77..325962b561f 100644 --- a/completions/ebtables +++ b/completions/ebtables @@ -8,13 +8,8 @@ _ebtables() local table chain='s/^Bridge chain: \([^ ,]\{1,\}\).*$/\1/p' \ targets='ACCEPT DROP CONTINUE RETURN' - if [[ ${words[@]} == *-t\ *filter* ]]; then - table="-t filter" - elif [[ ${words[@]} == *-t\ *nat* ]]; then - table="-t nat" - elif [[ ${words[@]} == *-t\ *mangle* ]]; then - table="-t mangle" - fi + [[ "${words[*]}" =~ [[:space:]]-(t|-table=?)[[:space:]]*([^[:space:]]+) ]] \ + && table="-t ${BASH_REMATCH[2]}" case $prev in -!(-*)[AIDPFXLZ]) From e0bb03a588ba57a77424a19f690c1413b3de8086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 23 Apr 2019 22:00:33 +0300 Subject: [PATCH 0118/1094] test: add invoke-rc.d test case for not repeating already given options --- test/t/test_invoke_rc_d.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/t/test_invoke_rc_d.py b/test/t/test_invoke_rc_d.py index b0d1384e7e2..61e2987b003 100644 --- a/test/t/test_invoke_rc_d.py +++ b/test/t/test_invoke_rc_d.py @@ -6,3 +6,9 @@ class TestInvokeRcD: @pytest.mark.complete("invoke-rc.d ") def test_1(self, completion): assert completion + + @pytest.mark.complete("invoke-rc.d --no-fallback --") + def test_2(self, completion): + """Test already specified option is not offered.""" + assert completion + assert "--no-fallback" not in completion From bae4a3d11ecb86767573c9b03aed85287a8c415a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 23 Apr 2019 22:31:10 +0300 Subject: [PATCH 0119/1094] _included_ssh_config_files: doc grammar fixes --- bash_completion | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash_completion b/bash_completion index dcf01c47104..8dd5bee017f 100644 --- a/bash_completion +++ b/bash_completion @@ -1447,8 +1447,8 @@ _known_hosts() } # _known_hosts() # Helper function to locate ssh included files in configs -# This function look for the "Include" keyword in ssh config files and include -# them recursively adding each result to the config variable +# This function looks for the "Include" keyword in ssh config files and +# includes them recursively, adding each result to the config variable. _included_ssh_config_files() { [[ $# -lt 1 ]] && \ From 6d012674ee28fd25f9bfa64b6409d7eb99844b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 23 Apr 2019 22:33:03 +0300 Subject: [PATCH 0120/1094] _included_ssh_config_files: store found included files in an array Seemingly this was the intent all along. --- bash_completion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_completion b/bash_completion index 8dd5bee017f..baaf531a048 100644 --- a/bash_completion +++ b/bash_completion @@ -1455,7 +1455,7 @@ _included_ssh_config_files() echo "bash_completion: $FUNCNAME: missing mandatory argument CONFIG" >&2 local configfile i f configfile=$1 - local included=$(command sed -ne 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:blank:]]\{1,\}\([^#%]*\)\(#.*\)\{0,1\}$/\1/p' "${configfile}") + local included=( $(command sed -ne 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:blank:]]\{1,\}\([^#%]*\)\(#.*\)\{0,1\}$/\1/p' "${configfile}") ) for i in ${included[@]}; do # Check the origin of $configfile to complete relative included paths on included # files according to ssh_config(5): From f1c32f4b85227a4da5dbb6fc137a7703a4efe20a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 23 Apr 2019 22:57:19 +0300 Subject: [PATCH 0121/1094] *: shellcheck error fixes --- bash_completion | 16 ++++++++-------- completions/badblocks | 2 +- completions/bts | 2 +- completions/cpan2dist | 2 +- completions/crontab | 2 +- completions/cvs | 4 ++-- completions/find | 4 ++-- completions/growisofs | 2 +- completions/interdiff | 2 +- completions/invoke-rc.d | 4 ++-- completions/iperf | 2 +- completions/ipmitool | 2 +- completions/lvm | 2 +- completions/lz4 | 2 +- completions/modprobe | 4 ++-- completions/mplayer | 2 +- completions/nc | 2 +- completions/pkgutil | 2 +- completions/povray | 2 +- completions/protoc | 2 +- completions/python | 2 +- completions/rpm | 16 ++++++++-------- completions/screen | 4 ++-- completions/sysctl | 2 +- completions/tipc | 6 +++--- completions/update-rc.d | 6 +++--- completions/wtf | 2 +- completions/zopflipng | 2 +- 28 files changed, 51 insertions(+), 51 deletions(-) diff --git a/bash_completion b/bash_completion index baaf531a048..3737538aaee 100644 --- a/bash_completion +++ b/bash_completion @@ -278,7 +278,7 @@ __reassemble_comp_words_by_ref() [[ $i == $COMP_CWORD ]] && printf -v "$3" %s "$j" else # No, list of word completions separators hasn't changed; - for i in ${!COMP_WORDS[@]}; do + for i in "${!COMP_WORDS[@]}"; do printf -v "$2[i]" %s "${COMP_WORDS[i]}" done fi @@ -653,7 +653,7 @@ _variables() TZ) cur=/usr/share/zoneinfo/$cur _filedir - for i in ${!COMPREPLY[@]}; do + for i in "${!COMPREPLY[@]}"; do if [[ ${COMPREPLY[i]} == *.tab ]]; then unset 'COMPREPLY[i]' continue @@ -929,7 +929,7 @@ _ip_addresses() local PATH=$PATH:/sbin local addrs=$({ LC_ALL=C ifconfig -a || ip addr show; } 2>/dev/null | command sed -e 's/[[:space:]]addr:/ /' -ne \ - "s|.*inet$n[[:space:]]\{1,\}\([^[:space:]/]*\).*|\1|p") + "s|.*inet${n}[[:space:]]\{1,\}\([^[:space:]/]*\).*|\1|p") COMPREPLY+=( $(compgen -W "$addrs" -- "$cur") ) } @@ -1182,7 +1182,7 @@ _service() } && complete -F _service service _sysvdirs -for svcdir in ${sysvdirs[@]}; do +for svcdir in "${sysvdirs[@]}"; do for svc in $svcdir/!($_backup_glob); do [[ -x $svc ]] && complete -F _service $svc done @@ -1456,7 +1456,7 @@ _included_ssh_config_files() local configfile i f configfile=$1 local included=( $(command sed -ne 's/^[[:blank:]]*[Ii][Nn][Cc][Ll][Uu][Dd][Ee][[:blank:]]\{1,\}\([^#%]*\)\(#.*\)\{0,1\}$/\1/p' "${configfile}") ) - for i in ${included[@]}; do + for i in "${included[@]}"; do # Check the origin of $configfile to complete relative included paths on included # files according to ssh_config(5): # "[...] Files without absolute paths are assumed to be in ~/.ssh if included in a user @@ -1517,7 +1517,7 @@ _known_hosts_real() echo "bash_completion: $FUNCNAME: missing mandatory argument CWORD" >&2 cur=${!OPTIND}; (( OPTIND += 1 )) [[ $# -ge $OPTIND ]] && \ - echo "bash_completion: $FUNCNAME("$@"): unprocessed arguments:" \ + echo "bash_completion: $FUNCNAME($*): unprocessed arguments:" \ $(while [[ $# -ge $OPTIND ]]; do printf '%s\n' ${!OPTIND}; shift; done) >&2 [[ $cur == *@* ]] && user=${cur%@*}@ && cur=${cur#*@} @@ -1661,7 +1661,7 @@ _known_hosts_real() COMPREPLY=( "${COMPREPLY[@]/+([0-9]).+([0-9]).+([0-9]).+([0-9])$suffix/}" ) fi if [[ $ipv4 || $ipv6 ]]; then - for i in ${!COMPREPLY[@]}; do + for i in "${!COMPREPLY[@]}"; do [[ ${COMPREPLY[i]} ]] || unset -v COMPREPLY[i] done fi @@ -1962,7 +1962,7 @@ _install_xspec() { local xspec=$1 cmd shift - for cmd in $@; do + for cmd in "$@"; do _xspecs[$cmd]=$xspec done } diff --git a/completions/badblocks b/completions/badblocks index 6de65dcbd64..a366338cb30 100644 --- a/completions/badblocks +++ b/completions/badblocks @@ -18,7 +18,7 @@ _badblocks() if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) # Filter out -w (dangerous) and -X (internal use) - for i in ${!COMPREPLY[@]}; do + for i in "${!COMPREPLY[@]}"; do [[ ${COMPREPLY[i]} == -[wX] ]] && unset 'COMPREPLY[i]' done return diff --git a/completions/bts b/completions/bts index 854893a6886..5e9c9f0b389 100644 --- a/completions/bts +++ b/completions/bts @@ -3,7 +3,7 @@ # List bug numbers from bugs cache in ~/.devscripts_cache/bts _cached_bugs() { [[ -d $HOME/.devscripts_cache/bts ]] && \ - find $HOME/.devscripts_cache/bts -maxdepth 1 -name "$cur[0-9]*.html" \ + find $HOME/.devscripts_cache/bts -maxdepth 1 -name "${cur}[0-9]*.html" \ -printf "%f\n" | cut -d'.' -f1 } diff --git a/completions/cpan2dist b/completions/cpan2dist index 1bf41e8e9d2..b24e068ce8e 100644 --- a/completions/cpan2dist +++ b/completions/cpan2dist @@ -24,7 +24,7 @@ _cpan2dist() else local cpandirs=( "$HOME/.cpanplus/" "$HOME/.cpan/source/modules/" ) local packagelist - for dir in ${cpandirs[@]}; do + for dir in "${cpandirs[@]}"; do [[ -d "$dir" && -r "$dir/02packages.details.txt.gz" ]] && \ packagelist="$dir/02packages.details.txt.gz" done diff --git a/completions/crontab b/completions/crontab index 76a243bafc9..a5e5cc581c2 100644 --- a/completions/crontab +++ b/completions/crontab @@ -41,7 +41,7 @@ _crontab() fi # do filenames only if we did not have -l, -r, or -e - [[ "${words[@]}" == *\ -[lre]* ]] || _filedir + [[ "${words[*]}" == *\ -[lre]* ]] || _filedir } && complete -F _crontab crontab diff --git a/completions/cvs b/completions/cvs index e134653e40d..0fb49f9ce36 100644 --- a/completions/cvs +++ b/completions/cvs @@ -155,7 +155,7 @@ _cvs() [[ -z $cur ]] && files=( !(CVS) ) || \ files=( $(command ls -d ${cur}* 2>/dev/null) ) local f - for i in ${!files[@]}; do + for i in "${!files[@]}"; do if [[ ${files[i]} == ?(*/)CVS ]]; then unset 'files[i]' else @@ -342,7 +342,7 @@ _cvs() _cvs_entries if [[ "$prev" != -f ]]; then # find out what files are missing - for i in ${!entries[@]}; do + for i in "${!entries[@]}"; do [[ -r "${entries[i]}" ]] && unset 'entries[i]' done fi diff --git a/completions/find b/completions/find index 6008c2164cf..80fbe8c02b8 100644 --- a/completions/find +++ b/completions/find @@ -64,7 +64,7 @@ _find() local i exprfound=false # set exprfound to true if there is already an expression present - for i in ${words[@]}; do + for i in "${words[@]}"; do [[ "$i" == [-\(\),\!]* ]] && exprfound=true && break done @@ -98,7 +98,7 @@ _find() local j for i in "${words[@]}"; do [[ $i && ${onlyonce[$i]} ]] || continue - for j in ${!COMPREPLY[@]}; do + for j in "${!COMPREPLY[@]}"; do [[ ${COMPREPLY[j]} == $i ]] && unset 'COMPREPLY[j]' done done diff --git a/completions/growisofs b/completions/growisofs index 7c4f5251feb..a0c6de3f797 100644 --- a/completions/growisofs +++ b/completions/growisofs @@ -28,7 +28,7 @@ _growisofs() # TODO: mkisofs options COMPREPLY=( $(compgen -W '-dvd-compat -overburn -speed= -Z -M' \ -- "$cur") ) - [[ ${COMPREPLY[@]} == *= ]] && compopt -o nospace + [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/interdiff b/completions/interdiff index 6ab28c49ad1..e79237518f5 100644 --- a/completions/interdiff +++ b/completions/interdiff @@ -20,7 +20,7 @@ _interdiff() fi local exts='@(?(d)patch|dif?(f))' word - for word in ${words[@]}; do + for word in "${words[@]}"; do if [[ $word == -@(z|-decompress) ]]; then exts+='?(.@(gz|bz2))' break diff --git a/completions/invoke-rc.d b/completions/invoke-rc.d index 5ed9423e50a..e4b2afc9868 100644 --- a/completions/invoke-rc.d +++ b/completions/invoke-rc.d @@ -19,8 +19,8 @@ _invoke_rc_d() if [[ ($cword -eq 1) || ("$prev" == --* ) ]]; then valid_options=( $(\ - tr " " "\n" <<<"${words[@]} ${options[@]}" \ - | command sed -ne "/$(command sed "s/ /\\\\|/g" <<<"${options[@]}")/p" \ + tr " " "\n" <<<"${words[*]} ${options[*]}" \ + | command sed -ne "/$(command sed "s/ /\\\\|/g" <<<"${options[*]}")/p" \ | sort | uniq -u \ ) ) COMPREPLY=( $(compgen -W '${valid_options[@]} ${services[@]}' -- "$cur") ) diff --git a/completions/iperf b/completions/iperf index 417c7dc994d..43f9bcaf7c9 100644 --- a/completions/iperf +++ b/completions/iperf @@ -48,7 +48,7 @@ _iperf() # Filter mode specific options local i filter=cat - for i in ${words[@]}; do + for i in "${words[@]}"; do case $i in -s|--server) filter='command sed -e /^Client.specific/,/^\(Server.specific.*\)\?$/d' diff --git a/completions/ipmitool b/completions/ipmitool index 635f893fa9f..f6307cfa8b7 100644 --- a/completions/ipmitool +++ b/completions/ipmitool @@ -70,7 +70,7 @@ _ipmitool() local i c cmd subcmd for (( i=1; i < ${#words[@]}-1; i++ )); do [[ -n $cmd ]] && subcmd=${words[i]} && break - for c in ${cmds[@]}; do + for c in "${cmds[@]}"; do [[ ${words[i]} == $c ]] && cmd=$c && break done done diff --git a/completions/lvm b/completions/lvm index 2f2b0a3cb06..63048aebef7 100644 --- a/completions/lvm +++ b/completions/lvm @@ -31,7 +31,7 @@ _lvm_logicalvolumes() if [[ $cur == /dev/mapper/* ]]; then _filedir local i - for i in ${!COMPREPLY[@]}; do + for i in "${!COMPREPLY[@]}"; do [[ ${COMPREPLY[i]} == */control ]] && unset 'COMPREPLY[i]' done fi diff --git a/completions/lz4 b/completions/lz4 index f1490d6cc00..db8198f8395 100644 --- a/completions/lz4 +++ b/completions/lz4 @@ -23,7 +23,7 @@ _lz4() _count_args [[ $args -gt 2 ]] && return - for word in ${words[@]}; do + for word in "${words[@]}"; do case $word in -*[dt]*) case $args in diff --git a/completions/modprobe b/completions/modprobe index 985a8fc5b8e..cd193adc8ae 100644 --- a/completions/modprobe +++ b/completions/modprobe @@ -104,8 +104,8 @@ _modprobe() # filter out already installed modules local -a mods=( "${COMPREPLY[@]}" ) _installed_modules "$cur" - for i in ${!mods[@]}; do - for module in ${COMPREPLY[@]}; do + for i in "${!mods[@]}"; do + for module in "${COMPREPLY[@]}"; do if [[ ${mods[i]} == $module ]]; then unset 'mods[i]' break diff --git a/completions/mplayer b/completions/mplayer index 4c5c947b788..525c63e228a 100644 --- a/completions/mplayer +++ b/completions/mplayer @@ -84,7 +84,7 @@ _mplayer() fi local IFS=$'\n' - for i in ~/.mplayer/skins ${dirs[@]}; do + for i in ~/.mplayer/skins "${dirs[@]}"; do if [[ -d $i && -r $i ]]; then for j in $(compgen -d -- $i/$cur); do COMPREPLY[k++]=${j#$i/} diff --git a/completions/nc b/completions/nc index 4d5b79cadad..0ba6180864f 100644 --- a/completions/nc +++ b/completions/nc @@ -10,7 +10,7 @@ _nc() return ;; -*s) - if [[ "${words[@]}" == *-6* ]]; then + if [[ "${words[*]}" == *-6* ]]; then _ip_addresses -6 __ltrim_colon_completions "$cur" else diff --git a/completions/pkgutil b/completions/pkgutil index 4b2fcdcd888..bafb9aab9c2 100644 --- a/completions/pkgutil +++ b/completions/pkgutil @@ -66,7 +66,7 @@ _pkgutil() if [[ -n "$command" ]] && [[ ! "$cur" == -* ]]; then local mirrors mirror_url - mirrors=$(awk -F= ' $1 ~ /^ *mirror *$/ { print $2 }' ${configuration_files[@]}) + mirrors=$(awk -F= ' $1 ~ /^ *mirror *$/ { print $2 }' "${configuration_files[@]}") mirrors=${mirrors:-http://mirror.opencsw.org/opencsw/testing} for mirror_url in $mirrors; do local catalog=$(_pkgutil_url2catalog "$mirror_url") diff --git a/completions/povray b/completions/povray index 1050115c0b7..c5af018aab5 100644 --- a/completions/povray +++ b/completions/povray @@ -44,7 +44,7 @@ _povray() COMPREPLY=( $(command sed -e 's/^[[:space:]]*\[\('"$cur"'[^]]*\]\).*$/\1/' \ -e 't' -e 'd' -- "$pfx") ) # to prevent [bar] expand to nothing. can be done more easily? - COMPREPLY=( "${COMPREPLY[@]/#/$pfx[}" ) + COMPREPLY=( "${COMPREPLY[@]/#/${pfx}[}" ) return ;; *) diff --git a/completions/protoc b/completions/protoc index 7916803439a..d43814466cd 100644 --- a/completions/protoc +++ b/completions/protoc @@ -48,7 +48,7 @@ _protoc() -*) COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) local i - for i in ${!COMPREPLY[@]}; do + for i in "${!COMPREPLY[@]}"; do [[ ${COMPREPLY[i]} == -oFILE ]] && unset 'COMPREPLY[i]' done [[ $COMPREPLY == *= ]] && compopt -o nospace diff --git a/completions/python b/completions/python index c3690d825d3..5e69ff121cf 100644 --- a/completions/python +++ b/completions/python @@ -55,7 +55,7 @@ _python() # if -c or -m is already given, complete all kind of files. - if [[ "${words[@]::$cword}" == *\ -[cm]\ * ]]; then + if [[ "${words[*]::$cword}" == *\ -[cm]\ * ]]; then _filedir elif [[ "$cur" != -* ]]; then _filedir 'py?([cowz])' diff --git a/completions/rpm b/completions/rpm index 7294b60661f..b797e9fb270 100644 --- a/completions/rpm +++ b/completions/rpm @@ -152,7 +152,7 @@ _rpm() --scripts --suggests --triggers --xml --recommends --supplements --filetriggers --licensefiles" - if [[ ${words[@]} == *\ -@(*([^ -])f|-file )* ]]; then + if [[ "${words[*]}" == *\ -@(*([^ -])f|-file )* ]]; then # -qf completion if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W "$opts --dbpath --fscontext @@ -160,10 +160,10 @@ _rpm() else _filedir fi - elif [[ ${words[@]} == *\ -@(*([^ -])g|-group )* ]]; then + elif [[ "${words[*]}" == *\ -@(*([^ -])g|-group )* ]]; then # -qg completion _rpm_groups $1 - elif [[ ${words[@]} == *\ -@(*([^ -])p|-package )* ]]; then + elif [[ "${words[*]}" == *\ -@(*([^ -])p|-package )* ]]; then # -qp; uninstalled package completion if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W "$opts --ftpport --ftpproxy @@ -181,7 +181,7 @@ _rpm() --whatrecommends --whatrequires --whatsuggests --whatsupplements" \ -- "$cur") ) - elif [[ ${words[@]} != *\ -@(*([^ -])a|-all )* ]]; then + elif [[ "${words[*]}" != *\ -@(*([^ -])a|-all )* ]]; then _rpm_installed_packages $1 fi fi @@ -203,11 +203,11 @@ _rpm() --whatrequires --whatsuggests --whatsupplements" \ -- "$cur") ) # check whether we're doing file completion - elif [[ ${words[@]} == *\ -@(*([^ -])f|-file )* ]]; then + elif [[ "${words[*]}" == *\ -@(*([^ -])f|-file )* ]]; then _filedir - elif [[ ${words[@]} == *\ -@(*([^ -])g|-group )* ]]; then + elif [[ "${words[*]}" == *\ -@(*([^ -])g|-group )* ]]; then _rpm_groups $1 - elif [[ ${words[@]} == *\ -@(*([^ -])p|-package )* ]]; then + elif [[ "${words[*]}" == *\ -@(*([^ -])p|-package )* ]]; then _filedir '[rs]pm' else _rpm_installed_packages $1 @@ -279,7 +279,7 @@ _rpmbuild() # Figure out file extensions to complete local word ext - for word in ${words[@]}; do + for word in "${words[@]}"; do case $word in -b?|--clean|--nobuild) ext=spec diff --git a/completions/screen b/completions/screen index 09b72027efa..3b9fb27272a 100644 --- a/completions/screen +++ b/completions/screen @@ -11,10 +11,10 @@ _screen_sessions() # Create unique completions, dropping pids where possible local -A res local i tmp - for i in ${sessions[@]}; do + for i in "${sessions[@]}"; do res[${i/#+([0-9])./}]+=" $i" done - for i in ${!res[@]}; do + for i in "${!res[@]}"; do [[ ${res[$i]} == \ *\ * ]] && tmp+=" ${res[$i]}" || tmp+=" $i" done COMPREPLY=( $(compgen -W '$tmp' -- "$cur") ) diff --git a/completions/sysctl b/completions/sysctl index 8f00b26be07..e683977b9a0 100644 --- a/completions/sysctl +++ b/completions/sysctl @@ -20,7 +20,7 @@ _sysctl() COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) else local suffix= - [[ $prev == -w ]] && suffix== + [[ $prev == -w ]] && suffix="=" COMPREPLY=( $(compgen -S "$suffix" -W \ "$(PATH="$PATH:/sbin" sysctl -N -a 2>/dev/null)" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace diff --git a/completions/tipc b/completions/tipc index 5e04c704faf..d85f5e9c435 100644 --- a/completions/tipc +++ b/completions/tipc @@ -133,15 +133,15 @@ _tipc() # If the previous word was a known paramater we assume a value for # that key Note that this would break if the user attempts to use a # kown key as value - for i in ${params[@]}; do + for i in "${params[@]}"; do if [[ $prev == $i ]]; then return fi done # In order not to print already used options we remove them - for p in ${words[@]}; do - for i in ${params[@]}; do + for p in "${words[@]}"; do + for i in "${params[@]}"; do if [[ $p == $i ]]; then params=( "${params[@]/$i}" ) fi diff --git a/completions/update-rc.d b/completions/update-rc.d index 91adbed64e9..384b8dd4803 100644 --- a/completions/update-rc.d +++ b/completions/update-rc.d @@ -18,13 +18,13 @@ _update_rc_d() if [[ $cword -eq 1 || "$prev" == -* ]]; then valid_options=( $(\ - tr " " "\n" <<<"${words[@]} ${options[@]}" \ - | command sed -ne "/$(command sed "s/ /\\|/g" <<<"${options[@]}")/p" \ + tr " " "\n" <<<"${words[*]} ${options[*]}" \ + | command sed -ne "/$(command sed "s/ /\\|/g" <<<"${options[*]}")/p" \ | sort | uniq -u \ ) ) COMPREPLY=( $(compgen -W '${options[@]} ${services[@]}' \ -X '$(tr " " "|" <<<${words[@]})' -- "$cur") ) - elif [[ "$prev" == ?($(tr " " "|" <<<${services[@]})) ]]; then + elif [[ "$prev" == ?($(tr " " "|" <<<"${services[*]}")) ]]; then COMPREPLY=( $(compgen -W 'remove defaults start stop' -- "$cur") ) elif [[ "$prev" == defaults && "$cur" == [0-9] ]]; then COMPREPLY=( 0 1 2 3 4 5 6 7 8 9 ) diff --git a/completions/wtf b/completions/wtf index b21e6e1933a..6a596a3be2f 100644 --- a/completions/wtf +++ b/completions/wtf @@ -7,7 +7,7 @@ _wtf() _init_completion || return [[ $prev == -f ]] && _filedir && return - [[ ${words[@]} == *\ -f* ]] && addf= || addf=-f + [[ "${words[*]}" == *\ -f* ]] && addf= || addf=-f if [[ $cur == -* ]]; then COMPREPLY=( $addf ) return diff --git a/completions/zopflipng b/completions/zopflipng index dff0356f37f..3d815404c3e 100644 --- a/completions/zopflipng +++ b/completions/zopflipng @@ -24,7 +24,7 @@ _zopflipng() return fi - if [[ ${words[@]} != *\ --prefix=* ]]; then + if [[ "${words[*]}" != *\ --prefix=* ]]; then # 2 png args only if --prefix not given local args _count_args From ea3c9001f42f31d49a13962586b71469aa416a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 24 Apr 2019 22:48:12 +0300 Subject: [PATCH 0122/1094] test: add make -C test case --- test/t/test_make.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/t/test_make.py b/test/t/test_make.py index cbd4a118d2a..9c76f83c1d2 100644 --- a/test/t/test_make.py +++ b/test/t/test_make.py @@ -43,3 +43,8 @@ def test_6(self, bash, completion): def test_7(self, bash, completion): assert completion == ".1 .2".split() os.remove("%s/make/%s" % (bash.cwd, "extra_makefile")) + + @pytest.mark.complete("make -C make ") + def test_8(self, bash, completion): + assert completion == "all clean extra_makefile install sample".split() + os.remove("%s/make/%s" % (bash.cwd, "extra_makefile")) From abe266ce4d26c37cf8ad681136cc8fd7edd28d4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 24 Apr 2019 22:52:49 +0300 Subject: [PATCH 0123/1094] make: quote eval array definitions to work around shellcheck SC1036 bug https://github.com/koalaman/shellcheck/wiki/SC1036#exceptions --- completions/make | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/completions/make b/completions/make index 2c99c037a3d..f119dcc3d37 100644 --- a/completions/make +++ b/completions/make @@ -129,7 +129,7 @@ _make() for (( i=0; i < ${#words[@]}; i++ )); do if [[ ${words[i]} == -@(C|-directory) ]]; then # eval for tilde expansion - eval makef_dir=( -C "${words[i+1]}" ) + eval "makef_dir=( -C \"${words[i+1]}\" )" break fi done @@ -139,7 +139,7 @@ _make() for (( i=0; i < ${#words[@]}; i++ )); do if [[ ${words[i]} == -@(f|-?(make)file) ]]; then # eval for tilde expansion - eval makef=( -f "${words[i+1]}" ) + eval "makef=( -f \"${words[i+1]}\" )" break fi done From d45f9faf432947ecf0e178d8be50f4c3163c2b4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 24 Apr 2019 22:59:32 +0300 Subject: [PATCH 0124/1094] ri: shellcheck error fixes --- completions/ri | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/completions/ri b/completions/ri index 60c6462a0de..8f331419560 100644 --- a/completions/ri +++ b/completions/ri @@ -15,7 +15,7 @@ _ri_get_methods() fi COMPREPLY+=( \ - "$(ri ${classes[@]} 2>/dev/null | ruby -ane \ + "$(ri "${classes[@]}" 2>/dev/null | ruby -ane \ 'if /^'"$regex"' methods:/.../^------------------|^$/ and \ /^ / then print $_.split(/, |,$/).grep(/^[^\[]*$/).join("\n"); \ end' 2>/dev/null | sort -u)" ) @@ -23,7 +23,7 @@ _ri_get_methods() # older versions of ri didn't distinguish between class/module and # instance methods COMPREPLY+=( \ - "$(ruby -W0 $ri_path ${classes[@]} | ruby -ane \ + "$(ruby -W0 $ri_path "${classes[@]}" | ruby -ane \ 'if /^-/.../^-/ and ! /^-/ and ! /^ +(class|module): / then \ print $_.split(/, |,$| +/).grep(/^[^\[]*$/).join("\n"); \ end' | sort -u)" ) From e146ef59c53ce311fb1f30f06499aa3c91ffb3f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 24 Apr 2019 23:00:35 +0300 Subject: [PATCH 0125/1094] travis: fail on shellcheck errors --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 353b55c3961..0adb0490e7d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,4 +21,4 @@ script: ${NETWORK:+--network $NETWORK} -t bash-completion:$DIST test/docker/docker-script.sh - test $DIST = tools && - test/run-shellcheck -f gcc bash_completion completions/!(Makefile*) || true + test/run-shellcheck -f gcc bash_completion completions/!(Makefile*) From a3129ac624adf390b072f63f98c6f8be552b0415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 25 Apr 2019 08:34:58 +0300 Subject: [PATCH 0126/1094] travis: don't fail DIST != tools --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0adb0490e7d..a7849e50e46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,5 +20,5 @@ script: -e CI=true -e DIST=$DIST -e BSD=$BSD ${NETWORK:+--network $NETWORK} -t bash-completion:$DIST test/docker/docker-script.sh - - test $DIST = tools && + - test $DIST != tools || test/run-shellcheck -f gcc bash_completion completions/!(Makefile*) From 0eebaef0a4296bf0c37c8fcdd0931701b25abb88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 25 Apr 2019 08:48:29 +0300 Subject: [PATCH 0127/1094] travis: run shellcheck on bash_completion.sh.in too --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a7849e50e46..8facc951491 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,5 +20,7 @@ script: -e CI=true -e DIST=$DIST -e BSD=$BSD ${NETWORK:+--network $NETWORK} -t bash-completion:$DIST test/docker/docker-script.sh - - test $DIST != tools || - test/run-shellcheck -f gcc bash_completion completions/!(Makefile*) + - if test $DIST = tools; then + test/run-shellcheck -f gcc bash_completion completions/!(Makefile*); + test/run-shellcheck -f gcc -s sh bash_completion.sh.in; + fi From 3d3905cbb8232091c3b656567a843b97b8bc6e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 25 Apr 2019 19:15:35 +0300 Subject: [PATCH 0128/1094] tar, valgrind: avoid some herestrings --- completions/tar | 6 +++--- completions/valgrind | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/completions/tar b/completions/tar index 3dfc20d8c30..2ed98e78b87 100644 --- a/completions/tar +++ b/completions/tar @@ -136,11 +136,11 @@ __gnu_tar_parse_help() __gtar_parse_warnings() { local line - while IFS= read line; do + LC_ALL=C tar --warning= 2>&1 | while IFS= read line; do if [[ $line =~ ^[[:blank:]]*-[[:blank:]]*[\`\']([a-zA-Z0-9-]+)\'$ ]]; then echo "${BASH_REMATCH[1]} no-${BASH_REMATCH[1]}" fi - done <<<"$(LC_ALL=C tar --warning= 2>&1)" + done } @@ -694,7 +694,7 @@ _posix_tar() _tar() { local cmd=${COMP_WORDS[0]} func line - read line <<<"$($cmd --version 2>/dev/null)" + line="$($cmd --version 2>/dev/null)" case "$line" in *GNU*) func=_gtar diff --git a/completions/valgrind b/completions/valgrind index 6f7f66e8ba6..2df097075af 100644 --- a/completions/valgrind +++ b/completions/valgrind @@ -33,8 +33,8 @@ _valgrind() # we want to grab memcheck. COMPREPLY=( $(compgen -W '$( for f in /usr{,/local}/lib{,64,exec}/valgrind/*; do - [[ $f != *.so && -x $f ]] && - command sed -ne "s/^.*\/\(.*\)-\([^-]*\)-\([^-]*\)/\1/p" <<<$f + [[ $f != *.so && -x $f && $f =~ ^.*/(.*)-[^-]+-[^-]+ ]] && + printf "%s\n" "${BASH_REMATCH[1]}" done)' -- "$cur") ) return ;; From 8510da8fb20658fbb18f3f0744214ddfc473f542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 25 Apr 2019 19:16:17 +0300 Subject: [PATCH 0129/1094] test: make runLint search for herestrings --- test/runLint | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/runLint b/test/runLint index d1716184e48..8699d7a0a99 100755 --- a/test/runLint +++ b/test/runLint @@ -43,3 +43,5 @@ gitgrep $cmdstart'[ef]grep\b' \ gitgrep '(? Date: Thu, 25 Apr 2019 19:17:24 +0300 Subject: [PATCH 0130/1094] test: move default shell option from run-shellcheck to .shellcheckrc shellcheck > 0.6.0 required for this. The koalaman/shellcheck container at least supports it. --- .shellcheckrc | 1 + Makefile.am | 3 ++- test/run-shellcheck | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .shellcheckrc diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 00000000000..9822e6c4541 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1 @@ +shell=bash diff --git a/Makefile.am b/Makefile.am index 88bbc23482d..296b105a63b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,7 +27,8 @@ CLEANFILES = bash_completion.sh bash-completion.pc \ bash-completion-config.cmake bash-completion-config-version.cmake EXTRA_DIST = CHANGES $(pkgdata_DATA) bash_completion.sh.in .dir-locals.el \ - .editorconfig README.md CONTRIBUTING.md pyproject.toml .perltidyrc + .editorconfig README.md CONTRIBUTING.md pyproject.toml .perltidyrc \ + .shellcheckrc install-data-hook: tmpfile=`mktemp $${TMPDIR:-/tmp}/bash_completion.XXXXXX` && \ diff --git a/test/run-shellcheck b/test/run-shellcheck index 3a18c9255ec..cae7b809054 100755 --- a/test/run-shellcheck +++ b/test/run-shellcheck @@ -1,4 +1,4 @@ #!/bin/sh -eu cd "$(dirname $0)/.." exec docker run --network none -tv "$PWD:/mnt:ro" \ - koalaman/shellcheck -s bash -S error "$@" + koalaman/shellcheck -S error "$@" From a36f57f922d461558064be39f8cfb64288f64cbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 25 Apr 2019 19:22:53 +0300 Subject: [PATCH 0131/1094] shellcheck: disable bunch of warnings when in "-S warning" mode --- .shellcheckrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.shellcheckrc b/.shellcheckrc index 9822e6c4541..bb16bddab06 100644 --- a/.shellcheckrc +++ b/.shellcheckrc @@ -1 +1,2 @@ shell=bash +disable=SC1090,SC2039,SC2128,SC2155,SC2166 From 5ff11ced5729f9258b75b633fc366360b277cf4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 25 Apr 2019 19:30:21 +0300 Subject: [PATCH 0132/1094] arp, ccze, ifstat, inotifywait, makepkg: invoke sed with "command" --- completions/arp | 2 +- completions/ccze | 2 +- completions/ifstat | 2 +- completions/inotifywait | 2 +- completions/makepkg | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/completions/arp b/completions/arp index 4b31b382e8a..e83f05d3c57 100644 --- a/completions/arp +++ b/completions/arp @@ -35,7 +35,7 @@ _arp() _count_args "" "@(--device|--protocol|--file|--hw-type|-!(-*)[iApfHt])" case $args in 1) - local ips=$("$1" -an | sed -ne \ + local ips=$("$1" -an | command sed -ne \ 's/.*(\([0-9]\{1,3\}\(\.[0-9]\{1,3\}\)\{3\}\)).*/\1/p') COMPREPLY=( $(compgen -W '$ips' -- "$cur") ) ;; diff --git a/completions/ccze b/completions/ccze index f0bfc5f9f89..7c17f364e4c 100644 --- a/completions/ccze +++ b/completions/ccze @@ -27,7 +27,7 @@ _ccze() return ;; --plugin|-!(-*)p) - COMPREPLY=( $(compgen -W '$("$1" --list-plugins | + COMPREPLY=( $(compgen -W '$("$1" --list-plugins | command \ sed -ne "s/^\([a-z0-9]\{1,\}\)[[:space:]]\{1,\}|.*/\1/p")' \ -- "$cur") ) return diff --git a/completions/ifstat b/completions/ifstat index bfe3a3ef830..9fac3d30480 100644 --- a/completions/ifstat +++ b/completions/ifstat @@ -19,7 +19,7 @@ _ifstat() # traditional: parse driver if ! { "$1" --help 2>&1 || :; } | \ command grep -q -- '-d.*--scan'; then - COMPREPLY=( $(compgen -W '$("$1" -v | + COMPREPLY=( $(compgen -W '$("$1" -v | command \ sed -e "s/[,.]//g" -ne "s/^.*drivers://p")' -- "$cur") ) fi return diff --git a/completions/inotifywait b/completions/inotifywait index 01b4e132b77..637d47427a4 100644 --- a/completions/inotifywait +++ b/completions/inotifywait @@ -6,7 +6,7 @@ _inotifywait_events() # tab. Word following the tab is event name, others are line # wrapped explanations. COMPREPLY+=( $(compgen -W "$($1 --help 2>/dev/null | \ - sed -e '/^Events:/,/^[^'$'\t'']/!d' \ + command sed -e '/^Events:/,/^[^'$'\t'']/!d' \ -ne 's/^'$'\t''\([^ '$'\t'']\{1,\}\)[ '$'\t''].*/\1/p')" \ -- "$cur") ) } diff --git a/completions/makepkg b/completions/makepkg index 4a81b463043..98edda8f3ca 100644 --- a/completions/makepkg +++ b/completions/makepkg @@ -15,7 +15,7 @@ _makepkg_slackware() if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W \ - '$1 | sed -e "s/^options://" | _parse_help -' -- "$cur") ) + '$1 | command sed -e "s/^options://" | _parse_help -' -- "$cur") ) return fi From ff5fb5864dc41629f216dbea0a1fbf892ded4e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 25 Apr 2019 21:47:14 +0300 Subject: [PATCH 0133/1094] __parse_options, 7z: avoid herestrings --- bash_completion | 3 +-- completions/7z | 16 ++++++---------- test/t/test_7z.py | 9 +++++++++ 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/bash_completion b/bash_completion index 3737538aaee..b1184be528d 100644 --- a/bash_completion +++ b/bash_completion @@ -761,8 +761,7 @@ __parse_options() # Take first found long option, or first one (short) if not found. option= - local -a array - read -a array <<<"$1" + local -a array=( $1 ) for i in "${array[@]}"; do case "$i" in ---*) break ;; diff --git a/completions/7z b/completions/7z index e977c85dccb..c43881749c6 100644 --- a/completions/7z +++ b/completions/7z @@ -29,11 +29,9 @@ _7z() COMPREPLY=( $(compgen -P$opt -W '@ ! r@ r-@ r0@ r! r-! r0!' \ -- "$cur") ) elif [[ $cur == ?(r@(-|0|))@* ]]; then - local x tmp - x=$(compgen -P"${opt}${cur%%@*}@" -f -- "${cur#*@}") && - while read -r tmp; do - COMPREPLY+=( "$tmp" ) - done <<<"$x" + local IFS=$' \t\n' reset=$(shopt -po noglob); set -o noglob + COMPREPLY=( $(compgen -P"${opt}${cur%%@*}@" -f -- "${cur#*@}") ) + $reset compopt -o filenames fi return @@ -47,11 +45,9 @@ _7z() return ;; -o*|-w?*) - local x tmp - x=$(compgen -P${cur:0:2} -S/ -d -- "${cur:2}") && - while read -r tmp; do - COMPREPLY+=( "$tmp" ) - done <<<"$x" + local IFS=$' \t\n' reset=$(shopt -po noglob); set -o noglob + COMPREPLY=( $(compgen -P${cur:0:2} -S/ -d -- "${cur:2}") ) + $reset compopt -o nospace -o filenames return ;; diff --git a/test/t/test_7z.py b/test/t/test_7z.py index 02f67089421..7d68c7b2be8 100644 --- a/test/t/test_7z.py +++ b/test/t/test_7z.py @@ -23,3 +23,12 @@ def test_4(self, completion): @pytest.mark.complete("7z d a.7z ", cwd="7z") def test_5(self, completion): assert completion == "abc" + + @pytest.mark.complete("7z a -air@", cwd="7z") + def test_6(self, completion): + assert completion == sorted("-air@a.7z -air@f.txt".split()) + + @pytest.mark.complete("7z a -o") + def test_7(self, completion): + assert "-o7z/" in completion + assert all(x.endswith("/") for x in completion) From 07408a6b3974c442f35dedf46ef49292b8664166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 25 Apr 2019 22:09:14 +0300 Subject: [PATCH 0134/1094] CONTRIBUTING: note runLint and run-shellcheck --- CONTRIBUTING.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b7708907bd4..629abb5d491 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -137,6 +137,10 @@ guidelines in mind: test suite (in the test/ dir) that verify that the code does what it is intended to do, fixes issues it intends to fix, etc. +- In addition to running the test suite, there are a few scripts in the test/ + dir that catch some common issues, see and use for example runLint and + run-shellcheck. + - File bugs, enhancement, and pull requests at GitHub, https://github.com/scop/bash-completion or send them to the email gateway address bash-completion@fire.fundersclub.com which will pipe From 34fb91447ff9a92e8976732f042ba20cfa615326 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 25 Apr 2019 22:09:37 +0300 Subject: [PATCH 0135/1094] CONTRIBUTING: add upstream vs bash-completion considerations --- CONTRIBUTING.md | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 629abb5d491..44865ba7785 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,8 +4,39 @@ Contributions to the bash completion project are more than welcome. Fixes, clean-ups and improvements of existing code are much appreciated, as are completion functions for new commands. -If you wish to contribute code, please bare the following coding -guidelines in mind: +However, before submitting a completion to us, first consider submitting it to +the project that ships the commands your completion is for. Having the +completion shipped along with the command opens up some liberties we don't have +if the completion is included with bash-completion. For example, we generally +do not want to hardcode lists of available command options and their +completions, because they quite probably vary between versions of the completed +command, and therefore resort to scraping --help output and the like. While we +do fairly well there, depending on the command, this can be fragile or +expensive, or just not possible. If the completion is shipped alongside the +command, they can be kept in sync and use more hardcoding etc. They are also +more likely to be maintained and/or watched by people intimately familiar with +the completed commands. See instructions in README.md how to install completion +files from other projects so they are automatically enabled and dynamically +loaded by bash-completion. + +On the other hand, we do have a pretty nice test suite and a bunch of helper +functions that you may find useful. And a whole slew of completions in one +package. Our functions can be used from "external" completions as well, just +make sure you test for their existence and/or fail gracefully if you intend +your completion to be usable without having bash-completion installed. + +It's nowhere near clear cut always what is the best place for the completion, +upstream project or us. Even if it would seem to be upstream, not all upstreams +are interested in shipping completions, or their install systems might not +easily support installing completion files properly. But give it some thought, +and ask if unsure. + +If you wish to contribute code to us, volunteering for long term maintainership +of your code within bash-completion is welcome. When exactly you will be asked +to do that depends on the case; don't be disappointed if it does or doesn't +happen instantly. + +Also, please bare the following coding guidelines in mind: - Do not use Perl, Ruby, Python etc. to do text processing unless the command for which you are writing the completion code implies the From d31f2c9adbcab984754ecd93b44778e1e7a673d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 25 Apr 2019 22:29:40 +0300 Subject: [PATCH 0136/1094] doc/testing: remove lots of legacy info, add some new Closes https://github.com/scop/bash-completion/issues/235 --- doc/testing.txt | 477 +++--------------------------------------------- 1 file changed, 22 insertions(+), 455 deletions(-) diff --git a/doc/testing.txt b/doc/testing.txt index 62650e3b85b..c3a1f00af89 100644 --- a/doc/testing.txt +++ b/doc/testing.txt @@ -7,19 +7,24 @@ The bash-completion package contains an automated test suite. Running the tests should help verifying that bash-completion works as expected. The tests are also very helpful in uncovering software regressions at an early stage. -The original bash-completion test suite is written on top of the +The original, "legacy" bash-completion test suite is written on top of the http://www.gnu.org/software/dejagnu/[DejaGnu] testing framework. DejaGnu is written in http://expect.nist.gov[Expect], which in turn uses http://tcl.sourceforge.net[Tcl] -- Tool command language. -Work is underway to change the test framework to use +Most of the test framework has been ported over to use https://pytest.org/[pytest] and https://pexpect.readthedocs.io/[pexpect]. +Eventually, all of it should be ported. Coding Style Guide ------------------ -The bash-completion test suite tries to adhere to this +For the Python part, all of it is formatted using +https://github.com/ambv/black[Black], and we also run +http://flake8.pycqa.org/[Flake8] on it. + +The legacy test suite tries to adhere to this http://wiki.tcl.tk/708[Tcl Style Guide]. @@ -61,11 +66,10 @@ Fedora 29 comes with recent enough pytest. Structure --------- +Pytest tests are in the `t/` subdirectory, with `t/test_\*.py` being +completion tests, and `t/unit/test_unit_\*.py` unit tests. -Main areas (DejaGnu tools) -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The tests are grouped into different areas, called _tool_ in DejaGnu: +Legacy tests are grouped into different areas, called _tool_ in DejaGnu: *completion*:: Functional tests per completion. @@ -75,63 +79,17 @@ The tests are grouped into different areas, called _tool_ in DejaGnu: *unit*:: Unit tests for bash-completion helper functions. -Pytest tests are in the `t/` subdirectory, with `t/test_\*.py` being -completion tests, and `t/unit/test_unit_\*.py` unit tests. - -Each tool has a slightly different way of loading the test fixtures, see -<> below. - - -Completion -~~~~~~~~~~ - -Completion tests are spread over two directories: `completion/\*.exp` calls -completions in `lib/completions/\*.exp`. This two-file system stems from -bash-completion-lib (http://code.google.com/p/bash-completion-lib/, containing -dynamic loading of completions) where tests are run twice per completion; once -before dynamic loading and a second time after to confirm that all dynamic -loading has gone well. - -For example: - ----- -set test "Completion via comp_load() should be installed" -set cmd "complete -p awk" -send "$cmd\r" -expect { - -re "^$cmd\r\ncomplete -o filenames -F comp_load awk\r\n/@$" { pass "$test" } - -re /@ { fail "$test at prompt" } -} - - -source "lib/completions/awk.exp" - - -set test "Completion via _longopt() should be installed" -set cmd "complete -p awk" -send "$cmd\r" -expect { - -re "^$cmd\r\ncomplete -o filenames -F _longopt awk\r\n/@$" { pass "$test" } - -re /@ { fail "$test at prompt" } -} - - -source "lib/completions/awk.exp" ----- - -Looking to the completion tests from a broader perspective, every test for a -command has two stages which are now reflected in the two files: - -. Tests concerning the command completions' environment (typically in -`test/completion/foo`) -. Tests invoking actual command completion (typically in -`test/lib/completions/foo`) - Running the tests ----------------- -The tests are run by calling `runtest` command in the test directory: +Python based tests are run by calling `pytest` on the desired test directories +or individual files, for example in the project root directory: +----------------------- +pytest test/t +----------------------- + +Legacy tests are run by calling `runtest` command in the test directory: ----------------------- runtest --outdir log --tool completion runtest --outdir log --tool install @@ -151,80 +109,15 @@ To run a particular test, specify file name of your test as an argument to ----------------------- That will run `test/completion/ssh.exp`. +See `test/docker/docker-script.sh` for how and what we run and test in CI. -Running tests via cron -~~~~~~~~~~~~~~~~~~~~~~ - -The test suite requires a connected terminal (tty). When invoked via cron, no -tty is connected and the test suite may respond with this error: ---------------------------------------------- -can't read "multipass_name": no such variable ---------------------------------------------- - -To run the tests successfully via cron, connect a terminal by redirecting -stdin from a tty, e.g. /dev/tty40. (In Linux, you can press alt-Fx or -ctrl-alt-Fx to switch the console from /dev/tty1 to tty7. There are many more -/dev/tty* which are not accessed via function keys. To be safe, use a tty -greater than tty7) - ---------------------- -./runUnit $LOG || cat $LOG -./runCompletion --outdir log/bash-4 --tool_exec /opt/bash-4.3/bin/bash >$LOG || cat $LOG - - # Clean up log file -[ -f $LOG ] && rm $LOG ---------------------------------------------------------------------- Specifying bash binary ~~~~~~~~~~~~~~~~~~~~~~ -The test suite standard uses `bash` as found in the tcl path (/bin/bash). -Using `--tool_exec` you can specify which bash binary you want to run the test -suite against, e.g.: - ----------------- -./runUnit --tool_exec /opt/bash-4.3/bin/bash ----------------- - - +The test suite standard uses `bash` as found in PATH. Export the +`bashcomp_bash` environment variable with a path to another bash executable if +you want to test against something else. Maintenance @@ -239,211 +132,6 @@ command. Additional arguments will be passed to the first generated test case. This will add the `test/t/test_cmd.py` file with a very basic test, and add it to `test/t/Makefile.am`. Add additional tests to the generated file. - -Fixing a completion test -~~~~~~~~~~~~~~~~~~~~~~~~ -Let's consider this real-life example where an ssh completion bug is fixed. -First you're triggered by unsuccessful tests: - ----------------------------------- -$ ./runCompletion -... - === completion Summary === - -# of expected passes 283 -# of unexpected failures 8 -# of unresolved testcases 2 -# of unsupported tests 47 ----------------------------------- - -Take a look in `log/completion.log` to find out which specific command is -failing. - ------------------------ -$ vi log/completion.log ------------------------ - -Search for `UNRESOLVED` or `FAIL`. From there scroll up to see which `.exp` -test is failing: - ---------------------------------------------------------- -/@Running ./completion/ssh.exp ... -... -UNRESOLVED: Tab should complete ssh known-hosts at prompt ---------------------------------------------------------- - -In this case it appears `ssh.exp` is causing the problem. Isolate the `ssh` -tests by specifying just `ssh.exp` to run. Furthermore add the `--debug` flag, -so output gets logged in `dbg.log`: - ----------------------------------- -$ ./runCompletion ssh.exp --debug -... - === completion Summary === - -# of expected passes 1 -# of unresolved testcases 1 ----------------------------------- - -Now we can have a detailed look in `dbg.log` to find out what's going wrong. -Open `dbg.log` and search for `UNRESOLVED` (or `FAIL` if that's what you're -looking for): - ---------------------------------------------------------- -UNRESOLVED: Tab should complete ssh known-hosts at prompt ---------------------------------------------------------- - -From there, search up for the first line saying: - -------------------------------------------------- -expect: does "..." match regular expression "..." -------------------------------------------------- - -This tells you where the actual output differs from the expected output. In -this case it looks like the test "ssh -F fixtures/ssh/config " is -expecting just hostnames, whereas the actual completion is containing commands -- but no hostnames. -So what should be expected after "ssh -F fixtures/ssh/config " are *both* -commands and hostnames. This means both the test and the completion need -fixing. Let's start with the test. - ----------------------------- -$ vi lib/completions/ssh.exp ----------------------------- - -Search for the test "Tab should complete ssh known-hosts". Here you could've -seen that what was expected were hostnames ($hosts): - ------------------------------------------ -set expected "^$cmd\r\n$hosts\r\n/@$cmd$" ------------------------------------------ - -Adding *all* commands (which could well be over 2000) to 'expected', seems a -bit overdone so we're gonna change things here. Lets expect the unit test for -`_known_hosts` assures all hosts are returned. Then all we need to do here is -expect one host and one command, just to be kind of sure that both hosts and -commands are completed. - -Looking in the fixture for ssh: - ------------------------------ -$ vi fixtures/ssh/known_hosts ------------------------------ - -it looks like we can add an additional host 'ls_known_host'. Now if we would -perform the test "ssh -F fixtures/ssh/config ls" both the command `ls` and -the host `ls_known_host` should come up. Let's modify the test so: - --------------------------------------------------------- -$ vi lib/completions/ssh.exp -... -set expected "^$cmd\r\n.*ls.*ls_known_host.*\r\n/@$cmd$" --------------------------------------------------------- - -Running the test reveals we still have an unresolved test: - ----------------------------------- -$ ./runCompletion ssh.exp --debug -... - === completion Summary === - -# of expected passes 1 -# of unresolved testcases 1 ----------------------------------- - -But if now look into the log file `dbg.log` we can see the completion only -returns commands starting with 'ls' but fails to match our regular expression -which also expects the hostname `ls_known_host': - ------------------------ -$ vi dbg.log -... -expect: does "ssh -F fixtures/ssh/config ls\r\nls lsattr lsb_release lshal lshw lsmod lsof lspci lspcmcia lspgpot lss16toppm\r\nlsusb\r\n/@ssh -F fixtures/ssh/config ls" (spawn_id exp9) match regular expression "^ssh -F fixtures/ssh/config ls\r\n.*ls.*ls_known_host.*\r\n/@ssh -F fixtures/ssh/config ls$"? no ------------------------ - -Now let's fix ssh completion: - -------------------- -$ vi ../contrib/ssh -... -------------------- - -until the test shows: - ----------------------------------- -$ ./runCompletion ssh.exp -... - === completion Summary === - -# of expected passes 2 ----------------------------------- - -Fixing a unit test -~~~~~~~~~~~~~~~~~~ -Now let's consider a unit test failure. First you're triggered by unsuccessful -tests: - ----------------------------------- -$ ./runUnit -... - === unit Summary === - -# of expected passes 1 -# of unexpected failures 1 ----------------------------------- - -Take a look in `log/unit.log` to find out which specific command is failing. - ------------------ -$ vi log/unit.log ------------------ - -Search for `UNRESOLVED` or `FAIL`. From there scroll up to see which `.exp` -test is failing: - ------------------------------------------- -/@Running ./unit/_known_hosts_real.exp ... -... -FAIL: Environment should stay clean ------------------------------------------- - -In this case it appears `_known_hosts_real.exp` is causing the problem. -Isolate the `_known_hosts_real` test by specifying just `_known_hosts_real.exp` -to run. Furthermore add the `--debug` flag, so output gets logged in -`dbg.log`: - ----------------------------------- -$ ./runUnit _known_hosts_real.exp --debug -... - === completion Summary === - -# of expected passes 1 -# of unexpected failures 1 ----------------------------------- - -Now, if we haven't already figured out the problem, we can have a detailed look -in `dbg.log` to find out what's going wrong. Open `dbg.log` and search for -`UNRESOLVED` (or `FAIL` if that's what you're looking for): - ------------------------------------ -FAIL: Environment should stay clean ------------------------------------ - -From there, search up for the first line saying: - -------------------------------------------------- -expect: does "..." match regular expression "..." -------------------------------------------------- - -This tells you where the actual output differs from the expected output. In -this case it looks like the the function `_known_hosts_real` is unexpectedly -modifying global variables `cur` and `flag`. In case you need to modify the -test: - ------------------------------------ -$ vi lib/unit/_known_hosts_real.exp ------------------------------------ - Rationale --------- @@ -461,124 +149,3 @@ script/generate ^^^^^^^^^^^^^^^ The name and location of this code generation script come from Ruby on Rails' http://en.wikibooks.org/wiki/Ruby_on_Rails/Tools/Generators[script/generate]. - - - - -== Reference - -Within test scripts the following library functions can be used: - -[[Test_context]] -== Test context - -The test environment needs to be put to fixed states when testing. For -instance the bash prompt (PS1) is set to the current test directory, followed -by an at sign (@). The default settings for `bash` reside in `config/bashrc` -and `config/inputrc`. - -For each tool (completion, install, unit) a slightly different context is in -effect. - -=== What happens when tests are run? - -==== completion - -When the completions are tested, invoking DejaGnu will result in a call to -`completion_start()` which in turn will start `bash --rcfile config/bashrc`. - -.What happens when completion tests are run? ----- - | runtest --tool completion - V - +----------+-----------+ - | lib/completion.exp | - | lib/library.exp | - | config/default.exp | - +----------+-----------+ - : - V - +----------+-----------+ +---------------+ +----------------+ - | completion_start() +<---+ config/bashrc +<---| config/inputrc | - | (lib/completion.exp) | +---------------+ +----------------+ - +----------+-----------+ - | ,+----------------------------+ - | ,--+-+ "Actual completion tests" | - V / +------------------------------+ - +----------+-----------+ +-----------------------+ - | completion/*.exp +<---| lib/completions/*.exp | - +----------+-----------+ +-----------------------+ - | \ ,+--------------------------------+ - | `----------------------+-+ "Completion invocation tests" | - V +----------------------------------+ - +----------+-----------+ - | completion_exit() | - | (lib/completion.exp) | - +----------------------+ ----- -Setting up bash once within `completion_start()` has the speed advantage that -bash - and bash-completion - need only initialize once when testing multiple -completions, e.g.: ----- - runtest --tool completion alias.exp cd.exp ----- -==== install - -.What happens when install tests are run? ----- - | runtest --tool install - V - +----+----+ - | DejaGnu | - +----+----+ - | - V - +------------+---------------+ - | (file: config/default.exp) | - +------------+---------------+ - | - V - +------------+------------+ - | (file: lib/install.exp) | - +-------------------------+ ----- - -==== unit - -.What happens when unit tests are run? ----- - | runtest --tool unit - V - +----+----+ - | DejaGnu | - +----+----+ - | - V - +----------+-----------+ - | - | - | (file: lib/unit.exp) | - +----------------------+ ----- - -=== bashrc - -This is the bash configuration file (bashrc) used for testing: - -[source,bash] ---------------------------------------------------------------------- -include::bashrc[] ---------------------------------------------------------------------- - - -=== inputrc - -This is the readline configuration file (inputrc) used for testing: - -[source,bash] ---------------------------------------------------------------------- -include::inputrc[] ---------------------------------------------------------------------- - - -Index -===== From 3e193edea316461c2bf5d799ca90cce9c056e301 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 25 Apr 2019 22:43:55 +0300 Subject: [PATCH 0137/1094] xvnc4viewer: code cleanups --- completions/vncviewer | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/completions/vncviewer b/completions/vncviewer index 07799120b9a..000ba1a8f9d 100644 --- a/completions/vncviewer +++ b/completions/vncviewer @@ -52,26 +52,24 @@ complete -F _tightvncviewer tightvncviewer # NOTE: - VNC Viewer options are case insensitive. # Preferred case is taken from -help. -# - Both single dash (-) and double dash (--) are allowed as option prefix _xvnc4viewer() { local cur prev words cword _init_completion || return - # Convert double dash to single dash - case ${prev/#--/-} in + # Both single dash (-) and double dash (--) are allowed as option prefix + local opt=${prev/#--/-} + case ${opt,,} in # -passwd, -PasswordFile - -[pP][aA][sS][sS][wW][dD]|-[pP][aA][sS][sS][wW][oO][rR][dD][fF][iI][lL][eE]) + -passwd|-passwordfile) _filedir return ;; - # -PreferredEncoding - -[pP][rR][eE][fF][eE][rR][rR][eE][dD][eE][nN][cC][oO][dD][iI][nN][gG]) + -preferredencoding) COMPREPLY=( $(compgen -W 'zrle hextile raw' -- "$cur") ) return ;; - # -via - -[vV][iI][aA]) + -via) _known_hosts_real -- "$cur" return ;; From 8d2c976c11e379f28430f1ae15be3764755dcffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 25 Apr 2019 23:19:28 +0300 Subject: [PATCH 0138/1094] ssh: fix suboption completion with combined -*o --- completions/ssh | 2 +- test/t/test_ssh.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/completions/ssh b/completions/ssh index 7bfae906a8a..df2f8654daf 100644 --- a/completions/ssh +++ b/completions/ssh @@ -168,7 +168,7 @@ _ssh_suboption_check() { # Get prev and cur words without splitting on = local cureq=`_get_cword :=` preveq=`_get_pword :=` - if [[ $cureq == *=* && $preveq == -o ]]; then + if [[ $cureq == *=* && $preveq == -*o ]]; then _ssh_suboption $cureq "$1" return $? fi diff --git a/test/t/test_ssh.py b/test/t/test_ssh.py index 5c8718ff9f3..1e38ea0bd42 100644 --- a/test/t/test_ssh.py +++ b/test/t/test_ssh.py @@ -19,3 +19,7 @@ def test_3(self, completion): Assumes there's no "bash" known host. """ assert "bash" not in completion + + @pytest.mark.complete("ssh -vo AddressFamily=") + def test_4(self, completion): + assert completion From 0984db6747e3f3ef1e73cdadc4447b6cb091cc83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 25 Apr 2019 23:21:27 +0300 Subject: [PATCH 0139/1094] ssh: make option completion case insensitive --- completions/ssh | 75 ++++++++++++++++++++++++---------------------- test/t/test_ssh.py | 5 ++++ 2 files changed, 45 insertions(+), 35 deletions(-) diff --git a/completions/ssh b/completions/ssh index df2f8654daf..65662a887fb 100644 --- a/completions/ssh +++ b/completions/ssh @@ -63,7 +63,12 @@ _ssh_options() fi compopt -o nospace - COMPREPLY=( $(compgen -S = -W '${opts[@]}' -- "$cur" ) ) + local IFS=$' \t\n' reset=$(shopt -p nocasematch); shopt -s nocasematch + local option + COMPREPLY=( $(for option in "${opts[@]}"; do + [[ $option == "$cur"* ]] && printf '%s=\n' "$option" + done) ) + $reset } # Complete a ssh suboption (like ForwardAgent=y) @@ -76,85 +81,85 @@ _ssh_suboption() # Split into subopt and subval local prev=${1%%=*} cur=${1#*=} - case $prev in - BatchMode|CanonicalDomains|CanonicalizeFallbackLocal|\ - ChallengeResponseAuthentication|CheckHostIP|\ - ClearAllForwardings|ControlPersist|Compression|EnableSSHKeysign|\ - ExitOnForwardFailure|ForwardAgent|ForwardX11|ForwardX11Trusted|\ - GatewayPorts|GSSAPIAuthentication|GSSAPIKeyExchange|\ - GSSAPIDelegateCredentials|GSSAPIRenewalForcesRekey|GSSAPITrustDns|\ - HashKnownHosts|HostbasedAuthentication|IdentitiesOnly|\ - KbdInteractiveAuthentication|KbdInteractiveDevices|\ - NoHostAuthenticationForLocalhost|PasswordAuthentication|\ - ProxyUseFdpass|PubkeyAuthentication|RhostsRSAAuthentication|\ - RSAAuthentication|StrictHostKeyChecking|StreamLocalBindUnlink|\ - TCPKeepAlive|UsePrivilegedPort|VerifyHostKeyDNS|VisualHostKey) + case ${prev,,} in + batchmode|canonicaldomains|canonicalizefallbacklocal|\ + challengeresponseauthentication|checkhostip|\ + clearallforwardings|controlpersist|compression|enablesshkeysign|\ + exitonforwardfailure|forwardagent|forwardx11|forwardx11trusted|\ + gatewayports|gssapiauthentication|gssapikeyexchange|\ + gssapidelegatecredentials|gssapirenewalforcesrekey|gssapitrustdns|\ + hashknownhosts|hostbasedauthentication|identitiesonly|\ + kbdinteractiveauthentication|kbdinteractivedevices|\ + nohostauthenticationforlocalhost|passwordauthentication|\ + proxyusefdpass|pubkeyauthentication|rhostsrsaauthentication|\ + rsaauthentication|stricthostkeychecking|streamlocalbindunlink|\ + tcpkeepalive|useprivilegedport|verifyhostkeydns|visualhostkey) COMPREPLY=( $(compgen -W 'yes no' -- "$cur") ) ;; - AddKeysToAgent) + addkeystoagent) COMPREPLY=( $(compgen -W 'yes ask confirm no' -- "$cur") ) ;; - AddressFamily) + addressfamily) COMPREPLY=( $(compgen -W 'any inet inet6' -- "$cur") ) ;; - BindAddress) + bindaddress) _ip_addresses ;; - CanonicalizeHostname) + canonicalizehostname) COMPREPLY=( $(compgen -W 'yes no always' -- "$cur") ) ;; - *File|IdentityAgent|Include) + *file|identityagent|include) _filedir ;; - Cipher) + cipher) COMPREPLY=( $(compgen -W 'blowfish des 3des' -- "$cur") ) ;; - Ciphers) + ciphers) _ssh_ciphers "$2" ;; - CompressionLevel) + compressionlevel) COMPREPLY=( $(compgen -W '{1..9}' -- "$cur") ) ;; - FingerprintHash) + fingerprinthash) COMPREPLY=( $(compgen -W 'md5 sha256' -- "$cur") ) ;; - IPQoS) + ipqos) COMPREPLY=( $(compgen -W 'af1{1..4} af2{2..3} af3{1..3} af4{1..3} cs{0..7} ef lowdelay throughput reliability' -- "$cur") ) ;; - HostbasedKeyTypes|HostKeyAlgorithms) + hostbasedkeytypes|hostkeyalgorithms) COMPREPLY=( $(compgen -W '$(_ssh_query "$2" key)' -- "$cur") ) ;; - KexAlgorithms) + kexalgorithms) COMPREPLY=( $(compgen -W '$(_ssh_query "$2" kex)' -- "$cur") ) ;; - MACs) + macs) _ssh_macs "$2" ;; - PreferredAuthentications) + preferredauthentications) COMPREPLY=( $(compgen -W 'gssapi-with-mic host-based publickey keyboard-interactive password' -- "$cur") ) ;; - Protocol) + protocol) COMPREPLY=( $(compgen -W '1 2 1,2 2,1' -- "$cur") ) ;; - ProxyJump) + proxyjump) _known_hosts_real -a -F "$configfile" -- "$cur" ;; - PubkeyAcceptedKeyTypes) + pubkeyacceptedkeytypes) COMPREPLY=( $(compgen -W '$(_ssh_query "$2" key)' -- "$cur") ) ;; - RequestTTY) + requesttty) COMPREPLY=( $(compgen -W 'no yes force auto' -- "$cur") ) ;; - SyslogFacility) + syslogfacility) COMPREPLY=( $(compgen -W 'DAEMON USER AUTH LOCAL{0..7}' -- "$cur") ) ;; - Tunnel) + tunnel) COMPREPLY=( $(compgen -W 'yes no point-to-point ethernet' \ -- "$cur") ) ;; - UpdateHostKeys) + updatehostkeys) COMPREPLY=( $(compgen -W 'yes no ask' -- "$cur") ) ;; esac diff --git a/test/t/test_ssh.py b/test/t/test_ssh.py index 1e38ea0bd42..97a4a73318b 100644 --- a/test/t/test_ssh.py +++ b/test/t/test_ssh.py @@ -23,3 +23,8 @@ def test_3(self, completion): @pytest.mark.complete("ssh -vo AddressFamily=") def test_4(self, completion): assert completion + + @pytest.mark.xfail # TODO our test facilities don't support case change? + @pytest.mark.complete("ssh -vo userknownhostsf") + def test_5(self, completion): + assert "UserKnownHostsFile=" in completion From 73d830445339df51eba37129c0151a250d290d84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 25 Apr 2019 23:28:03 +0300 Subject: [PATCH 0140/1094] ssh: make -o protocol completion less hardcoded No longer supports any comma separation though. --- completions/ssh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/completions/ssh b/completions/ssh index 65662a887fb..aaa103464fe 100644 --- a/completions/ssh +++ b/completions/ssh @@ -141,7 +141,11 @@ _ssh_suboption() keyboard-interactive password' -- "$cur") ) ;; protocol) - COMPREPLY=( $(compgen -W '1 2 1,2 2,1' -- "$cur") ) + local protocols=( $(_ssh_query "$2" protocol-version) ) + [[ $protocols ]] || protocols=(1 2) + if [[ ${#protocols[@]} -gt 1 ]]; then + COMPREPLY=( $(compgen -W '${protocols[@]}' -- "$cur") ) + fi ;; proxyjump) _known_hosts_real -a -F "$configfile" -- "$cur" From 7748282e1bff081b0507b09146cbbafab3c8cb1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 25 Apr 2019 23:45:56 +0300 Subject: [PATCH 0141/1094] 7z: add some TODO notes on parsing "i" output for extensions --- completions/7z | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/completions/7z b/completions/7z index c43881749c6..96a64f1f333 100644 --- a/completions/7z +++ b/completions/7z @@ -95,6 +95,14 @@ _7z() _count_args = if [[ $args -eq 2 ]]; then _filedir_xspec unzip + # TODO: parsing 7z i output? + # - how to figure out if the format is input or output? + # - find string Formats:, read until next empty line + # - extensions start from column 26 + # - ignore everything in parens + # - terminate on two spaces + # - terminate on token containing anything [^a-z0-9] + # (assumption: extensions are all lowercase) [[ $mode == w ]] && _filedir '@(7z|bz2|swf|?(g)tar|?(t)[bglx]z|tb?(z)2|wim)' || _filedir '@(7z|arj|bz2|cab|chm|cpio|deb|dmg|flv|gem|img|iso|lz[ah]|lzma?(86)|msi|pmd|[rx]ar|rpm|sw[fm]|?(g)tar|taz|?(t)[bglx]z|tb?(z)2|vhd|wim|Z)' From a3aa84519e338d246925bf816b12f96224ba47ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 26 Apr 2019 09:42:36 +0300 Subject: [PATCH 0142/1094] *: avoid shellcheck SC1010 --- bash_completion | 4 ++-- completions/bts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bash_completion b/bash_completion index b1184be528d..f5803b94f81 100644 --- a/bash_completion +++ b/bash_completion @@ -1828,8 +1828,8 @@ _command_offset() fi fi } -complete -F _command aoss command do else eval exec ltrace nice nohup padsp \ - then time tsocks vsound xargs +complete -F _command aoss command "do" else eval exec ltrace nice nohup padsp \ + "then" time tsocks vsound xargs _root_command() { diff --git a/completions/bts b/completions/bts index 5e9c9f0b389..c87b51e1702 100644 --- a/completions/bts +++ b/completions/bts @@ -52,7 +52,7 @@ _bts() source tag severity owner affects archive' -- "$cur") ) return ;; - clone|done|reopen|archive|unarchive|retitle|summary|submitter|found\ + clone|"done"|reopen|archive|unarchive|retitle|summary|submitter|found\ |notfound|fixed|notfixed|merge|forcemerge|unmerge|claim|unclaim\ |forwarded|notforwarded|owner|noowner|subscribe|unsubscribe\ |reportspam|spamreport|affects|usertag|usertags|reassign|tag\ From 659805bd2a834d2e58075b1807083eef54aa73fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 26 Apr 2019 09:50:04 +0300 Subject: [PATCH 0143/1094] *: avoid shellcheck SC1007 --- bash_completion | 2 +- completions/_umount.linux | 2 +- completions/modprobe | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bash_completion b/bash_completion index f5803b94f81..fad45ef12f7 100644 --- a/bash_completion +++ b/bash_completion @@ -687,7 +687,7 @@ _variables() # _init_completion() { - local exclude= flag outx errx inx OPTIND=1 + local exclude="" flag outx errx inx OPTIND=1 while getopts "n:e:o:i:s" flag "$@"; do case $flag in diff --git a/completions/_umount.linux b/completions/_umount.linux index 848550eeed9..59727b4bcb4 100644 --- a/completions/_umount.linux +++ b/completions/_umount.linux @@ -75,7 +75,7 @@ _linux_fstab() realcur="$(readlink -f "$cur." 2>/dev/null)/" || realcur=$(readlink -f "$cur" 2>/dev/null) if [[ $realcur ]]; then - local dirrealcur= dircur= basecur + local dirrealcur="" dircur="" basecur if [[ $cur == */* ]]; then dirrealcur="${realcur%/*}/" dircur="${cur%/*}/" diff --git a/completions/modprobe b/completions/modprobe index cd193adc8ae..16c8453a4f4 100644 --- a/completions/modprobe +++ b/completions/modprobe @@ -40,7 +40,7 @@ _modprobe() return fi - local i mode=insert module= version=$(uname -r) + local i mode=insert module="" version=$(uname -r) for (( i=1; i < $cword; i++ )); do case "${words[i]}" in --remove|-!(-*)r*) From f2f8c7b3c69039c0f1fe09e33c85c1075bdd409c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 26 Apr 2019 21:46:08 +0300 Subject: [PATCH 0144/1094] dist: include various *.in explicitly --- Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 296b105a63b..8f441185556 100644 --- a/Makefile.am +++ b/Makefile.am @@ -28,7 +28,8 @@ CLEANFILES = bash_completion.sh bash-completion.pc \ EXTRA_DIST = CHANGES $(pkgdata_DATA) bash_completion.sh.in .dir-locals.el \ .editorconfig README.md CONTRIBUTING.md pyproject.toml .perltidyrc \ - .shellcheckrc + .shellcheckrc bash-completion.pc.in bash-completion-config.cmake.in \ + bash-completion-config-version.cmake.in install-data-hook: tmpfile=`mktemp $${TMPDIR:-/tmp}/bash_completion.XXXXXX` && \ From 8efece6123393c07c127375c9f754407d7702a20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 26 Apr 2019 23:06:37 +0300 Subject: [PATCH 0145/1094] test: use parallel make in docker test --- test/docker/docker-script.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/docker/docker-script.sh b/test/docker/docker-script.sh index 931119c0e84..33cff81f32c 100755 --- a/test/docker/docker-script.sh +++ b/test/docker/docker-script.sh @@ -25,7 +25,7 @@ env autoreconf -i ./configure -make +make -j make -C completions check From 72b47aacefae825b670a1892665b74a6b690194e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 26 Apr 2019 23:08:50 +0300 Subject: [PATCH 0146/1094] test: use $(RM) --- test/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.am b/test/Makefile.am index 9f791204bd5..65a96869efc 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -13,6 +13,6 @@ all: $(MKDIR_P) log tmp clean-local: - rm -rf log tmp + $(RM) -rf log tmp AUTOMAKE_OPTIONS = dejagnu From ce95fe40fd88a2c425aece0b69544cc989da0b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 26 Apr 2019 23:11:07 +0300 Subject: [PATCH 0147/1094] test: group dejagnu related stuff in one place in Makefile --- test/Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 65a96869efc..c7c12abb005 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,3 +1,4 @@ +AUTOMAKE_OPTIONS = dejagnu DEJATOOL = completion install unit AM_RUNTESTFLAGS = --outdir log --ignore $(PACKAGE).log @@ -14,5 +15,3 @@ all: clean-local: $(RM) -rf log tmp - -AUTOMAKE_OPTIONS = dejagnu From 5a53bc1c24c672f774fde210c8bdd2f26992a58b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 26 Apr 2019 23:20:27 +0300 Subject: [PATCH 0148/1094] test: run pytest tests with make check --- test/t/Makefile.am | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 3f6498aa787..fb7665f17d8 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -671,5 +671,10 @@ EXTRA_DIST = \ all: +PYTEST = pytest + +check-local: + $(PYTEST) $(PYTESTFLAGS) $(srcdir) + clean-local: $(RM) -R __pycache__ From bdf40aab2528d0c32a7fad97d3a1156b042ff81c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 26 Apr 2019 23:21:44 +0300 Subject: [PATCH 0149/1094] test: run distcheck in docker, ditto test suite driven by it --- test/docker/docker-script.sh | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/test/docker/docker-script.sh b/test/docker/docker-script.sh index 33cff81f32c..ec310b35a8e 100755 --- a/test/docker/docker-script.sh +++ b/test/docker/docker-script.sh @@ -20,15 +20,6 @@ if [ "$BSD" ]; then export PATH fi -export bashcomp_bash=bash -env - -autoreconf -i -./configure -make -j - -make -C completions check - case $DIST in centos6|ubuntu14) : ${PYTEST:=/root/.local/bin/pytest} @@ -38,12 +29,14 @@ case $DIST in ;; esac -cd test -xvfb-run $PYTEST --numprocesses=${PYTEST_NUMPROCESSES:-auto} --dist=loadfile t -xvfb-run ./runCompletion --all --verbose -./runInstall --verbose --all --verbose -./runUnit --all --verbose +export bashcomp_bash=bash +env + +autoreconf -i +./configure +make -j -cd .. -mkdir install-test -make install DESTDIR=$(pwd)/install-test +xvfb-run make distcheck \ + PYTEST=$PYTEST \ + PYTESTFLAGS="--numprocesses=auto --dist=loadfile" \ + RUNTESTFLAGS="--all --verbose" From 47fc6d7c217326aed607e21c8525084f3f0f6118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 27 Apr 2019 08:58:59 +0300 Subject: [PATCH 0150/1094] test: add fixtures/make/extra_makefile to CLEANFILES --- test/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/Makefile.am b/test/Makefile.am index c7c12abb005..454f1ecd479 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -13,5 +13,8 @@ EXTRA_DIST = completion \ all: $(MKDIR_P) log tmp +CLEANFILES = \ + fixtures/make/extra_makefile + clean-local: $(RM) -rf log tmp From 54030ad7738689d0709648e48d0177a1c9d00014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 27 Apr 2019 09:04:12 +0300 Subject: [PATCH 0151/1094] travis: reindent with 2 spaces by usual convention --- .editorconfig | 3 +++ .travis.yml | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.editorconfig b/.editorconfig index 93f55b832ef..1ef5717d669 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,3 +10,6 @@ max_line_length = 79 [Makefile.am] indent_style = tab + +[*.yml] +indent_size = 2 diff --git a/.travis.yml b/.travis.yml index 8facc951491..66ad8d0dce6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,10 +17,10 @@ before_install: script: - docker run - -e CI=true -e DIST=$DIST -e BSD=$BSD - ${NETWORK:+--network $NETWORK} - -t bash-completion:$DIST test/docker/docker-script.sh + -e CI=true -e DIST=$DIST -e BSD=$BSD + ${NETWORK:+--network $NETWORK} + -t bash-completion:$DIST test/docker/docker-script.sh - if test $DIST = tools; then - test/run-shellcheck -f gcc bash_completion completions/!(Makefile*); - test/run-shellcheck -f gcc -s sh bash_completion.sh.in; + test/run-shellcheck -f gcc bash_completion completions/!(Makefile*); + test/run-shellcheck -f gcc -s sh bash_completion.sh.in; fi From 8d91ee269e4086cc1d3550865b3f9533796717b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 27 Apr 2019 09:05:36 +0300 Subject: [PATCH 0152/1094] travis: deploy release dist tarball to github --- .travis.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 66ad8d0dce6..7f7bd35e83a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ before_install: - docker build -t bash-completion:$DIST -f test/docker/Dockerfile-$DIST . script: - - docker run + - docker run --name bash-completion -e CI=true -e DIST=$DIST -e BSD=$BSD ${NETWORK:+--network $NETWORK} -t bash-completion:$DIST test/docker/docker-script.sh @@ -24,3 +24,20 @@ script: test/run-shellcheck -f gcc bash_completion completions/!(Makefile*); test/run-shellcheck -f gcc -s sh bash_completion.sh.in; fi + +before_deploy: + - docker start bash-completion + - docker exec bash-completion + sh -c "tar c bash-completion-$TRAVIS_TAG.tar.*" | tar xv + - docker kill bash-completion + +deploy: + provider: releases + api_key: + secure: MoK9nzmS6CBzPPIrhC0Ch6hIB3zEzLqZE6k4axoCyz/wmJFLJgX9OCq5K8zS4Jv8NuaA2C1YTcr+m56IO9N0RTmIWrS4q40fLIhKlYv6255u+wXMkGfqXbiFAZG5yndhUo8NE6QXAtixd3nQ/3/MOt2PdsOn+OdxTDmcPSXaW/ltkd/fMHynWzupdyRJ1v46IofPBrjsC1pTzW0iVqVHz64Ix3kPVjjPR9BMHzgKMJ8sPWBGZtF2ovjwsTHYPSpEyytVRecqrmEjM6QBCgfhQDqH87jOw6Y81xh1fWDCoxaZw7HlEcQ+HeHOkDdA24AYaxVoYXrKdIDXUXWt8w674Po7UWB6kIUn3J59Xaw60Sp4VaN88Y2eX9UKRcoDRHLWc8HKt4f9AUDR9YpFF08N+gKRmJFt9mCxqeJ+pyYD/coHGkGb8XvewTKihCSuH/qCWjM8XqM493DLDlJ5aELgMEcJXPXX4TmjsriOeErTY1qxRTRHJPmfUJ/kHtmpE+DxNXpwZOnyG+VoO5aEaIKbzHxX9QzWyyEhTflupdatZ2JFt1pmVDpwH9zcEifBwE0cUwhXk+LJuxHd5ePIIpvepAAnXKaxlYwchj4cFaJp7S9GZoAQughgQQkyfz0qr3J6hBhg360QAq4yjPOWjGgGz4iAG8kWd3MVXLvL+TtfBeY= + file: bash-completion-$TRAVIS_TAG.tar.xz + skip_cleanup: true + on: + repo: scop/bash-completion + condition: $DIST = fedoradev + tags: true From aa5b46e245013bef9a30c34a7a226779320dc6ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 27 Apr 2019 11:51:01 +0300 Subject: [PATCH 0153/1094] Release 2.9 --- CHANGES | 433 ++++++++++++++++++++++++++++++++++++++++++++++++ bash_completion | 2 +- configure.ac | 2 +- 3 files changed, 435 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index cfd88c5589c..60a81a1881c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,436 @@ +bash-completion (2.9) + + [ Antonio Terceiro ] + * dpkg-source: Add --before-build --after-build --commit, and + --print-format + + [ Gabriel F. T. Gomes ] + * xm: Deprecate completion for obsolete command (#284) + * _filedir_xspec: Fallback to suggesting all files if requested + (#260) + * tar: Support completions for zstd compression extensions (#255) + * dpkg: List held packages (#250) + * cvs: Add completion for the log command + + [ Guillaume Mella ] + * unzip, zipinfo: Associate with *.xar (eXist-db application + package) (#257) + + [ Igor Susman ] + * mplayer: Associate with *.w64 + + [ Jaak Ristioja ] + * okular: Added support for xz-compressed files. + + [ John Swinbank ] + * _xspecs: Declare as global on bash >= 4.2 + + [ Kevin Locke ] + * test: Increase expect pty to 160 columns + * test: avoid interrupting magic mark output + + [ Per Lundberg ] + * 7z: add .msi support + + [ Peter Wu ] + * tshark: speed up tshark -O completion + * tshark: fix completion of -Xlua_script option + * tshark: Support preferences (-o) completion with memoization + * test: fix misinterpretation of completion output in tests + * test: fix flake8 complaints about unused imports + * conftest: fix RemovedInPytest4Warning due to use of + node.get_marker + * chromium-browser: consider chrome and chromium as aliases + * tshark: support .gz and .cap files for -r expansion + * tshark: prevent a single-character file from breaking -G + completion + * tshark: update -T and -t completions + + [ Russell Davis ] + * man: Fix completion when failglob option is enabled (#225) + + [ Timo Taipalus ] + * mplayer: Add common supported module music formats + + [ Tomasz N ] + * _longopt: pick first long option on a line, not last + + [ Ville Skyttä ] + * *: avoid shellcheck SC1007 and SC1010 + * 7z: add some TODO notes on parsing "i" output for extensions + * ssh: make -o protocol completion less hardcoded + * ssh: make option completion case insensitive + * ssh: fix suboption completion with combined -*o + * xvnc4viewer: code cleanups + * doc/testing: remove lots of legacy info, add some new + * CONTRIBUTING: add upstream vs bash-completion considerations + * CONTRIBUTING: note runLint and run-shellcheck + * __parse_options, 7z: avoid herestrings + * arp, ccze, ifstat, inotifywait, makepkg: invoke sed with "command" + * shellcheck: disable bunch of warnings when in "-S warning" mode + * test: move default shell option from run-shellcheck to + .shellcheckrc + * test: make runLint search for herestrings + * tar, valgrind: avoid some herestrings + * travis: run shellcheck on bash_completion.sh.in too + * travis: fail on shellcheck errors + * make: quote eval array definitions to work around shellcheck + SC1036 bug + * test: add make -C test case + * *: shellcheck error fixes + * _included_ssh_config_files: store found included files in an array + * _included_ssh_config_files: doc grammar fixes + * test: add invoke-rc.d test case for not repeating already given + options + * ebtables: improve existing table arg parsing + * test: add script to run shellcheck, run it in Travis, allowing + failure for now + * iptables: improve existing table arg parsing + * test: shorten long gdb test core file name so tar doesn't croak on + it + * AUTHORS: remove unrelated project association from my entry + * apt-get: protect source against regex specials + * mypy, mysql, xmms: don't complete unknown split long option args + * synclient: remove unused local variable "split" + * test: adjust _get_comp_words_by_ref test to changed error output + * apt-cache: protect showsrc against regex specials + * test: improve tshark -O arg completion test + * tshark: ignore stderr when parsing -G, -L, and -h output + * *: error output consistency, use bash_completion prefix + * _upvar: deprecate in favor of _upvars + * *: add missing "ex: filetype=sh" + * phing: fix getting just a tab for options on CentOS 6 + * phing: don't complete -l with files + * various: apply file vs dir special cases also when invoked with + full path + * *: whitespace tweaks + * ssh: don't offer protocol v1 specific options if it's not + supported + * test: add some gdb non-core files + * _parse_help: look for long options somewhat more eagerly + * gdb: relax core filename pattern + * test/tools: fix exit status incrementation + * *: arithmetic expression related cleanups + * test/tools: run all tools, don't stop at first failure + * test: check for perltidy errors and warnings + * *: format Perl code with perltidy + * *: format Python code with black + * .dir-locals.el: use flycheck-sh-bash-args + * valgrind: look up tools from libexec dirs too + * *: make _parse_usage fallbacks more concise + * svn, svk, wget: use _iconv_charsets + * *: spelling fixes + * msynctool: code cleanups + * *: remove whitespace after redirections + * *: remove spaces immediately within $() + * bzip2: recognize *.tbz2 as bzipped + * modprobe: module parameter boolean values + * ping, tracepath: parse options primarily with _parse_help + * ulimit: new completion + * shellcheck: new completion + * dnssec-keygen: new completion + * modprobe: append = to module parameter completions + * test: include test_unit_longopt.py in dist + * test: add some _longopt unit tests + * _longopt: simplify regex, use printf instead of echo, drop + unnecessary sort + * nsupdate: new completion + * _longopt: don't complete --no-* with file/dirname arg + * copyright: add 2019 + * pytest: complete --pythonwarnings/-W arg + * python: make warning action list reusable + * test: use pytest-xdist + * extra: add git pre-push hook for triggering Docker Hub builds + * post-commit: trigger on test/requirements.txt too + * pytest: complete pytest-xdist --dist, --numprocesses, and + --rsyncdir + * test: remove no longer needed completion/*.exp + * xfreerdp: reinstate support for old versions with dash option + syntax + * test: rewrite "generate" in Python, fix trailing backslash in + EXTRA_DIST + * test: sort t/Makefile.am EXTRA_DIST in C locale + * ssh: support RemoteCommand and SyslogFacility options + * test: Expect failure for chown all users test as non-root + * test: Fix declare test case with bash 5.0 + * adb: Deprecate in favor of one shipped with the Android SDK + * xfreerdp: Update for more modern xfreerdp + * jsonschema: New completion + * test: Remove unnecessary ri xfail + * test: Clean up man tmp dir + * .gitignore: Add .python-version (for pyenv) + * test: Remove unnecessary autouse=True from fixtures + * ifstat: Make work with iproute2 version + * iperf, iperf3: Add some option arg (non-)completions + * test: Fix test generation wrt results checking improvements + * ifstat: New completion + * __parse_options: Avoid non-zero exit status + * test: Refactor/improve completion results checking + * test: Match Python's default locale unaware sort in bash setup + * test: Rename completion.line to .output + * test: Add man failglob test case + * test: Add pre_cmds support for completion fixture + * inotifywatch: New completion, common with inotifywait + * inotifywait: Fix -e completion with BSD sed + * inotifywait: Avoid some false positive event names + * test: extend _ip_addresses unit tests some + * _ip_addresses: Avoid completing ipv4 ones with -6 + * inotifywait: New completion + * test: Mark some xfails based on if in docker instead of in CI + * test: Skip ifup options test if it doesn't grok --help, not in CI + * test: Clean up and docker-ignore __pycache__ dirs + * build: Include test/t in dist tarball + * test/t: Avoid trailing backslash in Makefile.am's to appease + automake + * test: Remove some no longer used old test suite code + * _xspecs: Simplify bash version check + * chmod: Fix "-" completion + * sysctl: Treat -f as alias for -p/--load + * .gitignore: Add pytestdebug.log + * chmod: Fix file completion after modes starting with a dash + * _count_args: Add 3rd arg for treating option-like things as args + * test: Fix _count_args test_7 to test intended case + * pydocstyle: New completion + * Travis: Remove unused PYTEST env var + * doc: Note email issues gateway + * tcpdump: Various option and their arg completion updates + * test: Fix arp CI (non)expectations, remove redundant test case + * test: Be more consistent with "CI" env var examination and xfails + * arp: New completion, somewhat incomplete + * test: Expect failure in gkrellm if there's no X display + * doc: Update docs on generating simple tests + * doc: Some test dependency doc updates + * test: Add requirements.txt for installing dependencies + * grpck: Parse options with _parse_help, falling back to + _parse_usage + * grpck: Add --root/-R arg completion + * test suite: Ignore _scp_path_esc in env for ssh-copy-id + * ssh-copy-id: Add -i and -o arg (non-)completions + * tar: Clean up some redundant code + * cancel: Split long line + * cancel: Add some option arg (non-)completions + * locale-gen: New completion + * makepkg: Don't apply to other than Slackware makepkg + * test: Allow unknowns options in makepkg option completion + * makepkg: Use _parse_help instead of hardcoding option list + * mypy: New completion + * op: New completion + * hunspell: New completion + * xmllint: Improve --encode, --pretty, and --xpath arg + (non-)completions + * test: Remove leftover completion/ls.exp + * gcc: Add g++, gcc, gccgo, and gfortran *-[568] aliases + * perlcritic: New completion + * gnome-screenshot: New completion + * isort: New completion + * freeciv: Option and arg completion updates + * freeciv-gtk2: Install for freeciv and freeciv-gtk3, rename to + freeciv + * mplayer etc: Complete on *.crdownload partial downloads in + addition to *.part + * chromium-browser, google-chrome*: New non-xspec completion + * firefox etc: New non-xspec completion + * Merge branch 'master' into wip-pexpect + * nc: Add some more option (non-)completions + * test: Mark MANPATH without leading/trailing colons test an xfail + on CI CentOS 6 + * test: Remove kill, killall remnants + * test: Make case specific env entries shell code, not escaped + * Merge branch 'master' into wip-pexpect + * unzip, zipinfo: Associate with *.whl + * __load_completion: Avoid unnecessary lookups from nonexistent dirs + * Merge branch 'master' into wip-pexpect + * gcc: Add g++, gcc, gccgo, and gfortran *-7 aliases + * test: Use test_unit_* prefix for unit tests, to avoid name clashes + * test: Support setting cmd=None to require no command, for unit + tests + * test: Misc test suite fixes + * test: Fix jq and scrub skipif commands + * test: Don't require complete marker on test methods + * test: Add support for per-test env modifications + * test: Use more conventional Python file names for tests + * test: Sort completion results in Python for ease of use in Python + tests + * test: Allow __load_completion to fail + * test: chdir to fixtures dir in Python as well + * test: Mark xfreerdp as expected failure for now + * test: Replace + with Plus in test class names + * test: Implement load_completion_for using assert_bash_exec + * test: Add ability to selectively ignore diffs in environment + * test: Fixture reorganization + * test: Pass through $HOME and $DISPLAY to test bash + * test: Log pexpect interaction to $BASHCOMP_TEST_LOGFILE if set + * test: Rename BASHCOMP_* test env variables to BASHCOMP_TEST_* + * test: Add python3 test case + * test: Add class level skipif based on bash exec result + * test: Include command name in test class name, use numbered test + method names + * test: Fix some regressions introduced in recent test conversions + * test: Add support for running test case in a specified dir + * test: Add support for skipping individual tests based on shell + command status + * test: Make test base work with Python 3.3+ + * test: Add some iperf, iperf3 and xmodmap test cases + * xmodmap: Use _parse_help instead of hardcoded option list + * iperf: Improve client/server specific option parsing + * iperf: Install for iperf3 too + * iperf: Add g/G to --format completions + * xmodmap: Use _parse_help instead of hardcoded option list + * iperf: Improve client/server specific option parsing + * iperf: Install for iperf3 too + * iperf: Add g/G to --format completions + * test: Use /root/.local/bin/pytest on ubuntu14 by default + * test: Add generated test files to t/Makefile.am automatically + * test: Add new test files to EXTRA_DIST + * test: Use /root/.local/bin/pytest on centos6 by default + * test: Use make pytest docker executable env-configurable, default + pytest-3 + * test: Update generate for pytest+pexpect + * test: Convert majority of test cases to pytest+pexpect + * tox: Fall back to --listenvs for env list if --listenvs-all fails + * git-post-commit: Avoid some error trash when HEAD is not a + symbolic ref + * test: Add pylint-3 test case + * test: Limit number of pylint option completions + * pydoc, pylint: Determine python2/3 based on command basename only + * pylint: Bring -f/--format arg completion up to date with pylint + 1.9.2 + * pylint: Implement comma separated --confidence arg completion + * test: Fix buffer size option listing in run --help + * test: Bump expect's match_max to 20000 by default + * test: Run docker tests with --verbose + * _services: Try systemctl list-unit-files if systemctl list-units + fails + * extra/git-post-commit.sh: Add git post-commit Docker Hub trigger + hook + * gpgv: New completion + * pydoc, pylint: Skip module completion if current looks like a path + * travis: Run ubuntu14/bsd with no network + * travis: Split long lines in script + * test: Limit number of wget option completions to avoid unresolved + result + * test: Mark flake8 untested if it seems broken + * pylint: Option arg completion improvements + * tshark: Get available interfaces from -D output + * ngrep: Add "any" to -d arg completions + * fio: New completion + * test: Fix iwspy test case + * uscan: Use _parse_help instead of hardcoded option list + * urlsnarf: Add -p arg completion + * tracepath: Add -m and -p arg non-completions + * tracepath: Actually use our separate completion instead of + _known_hosts + * test: Skip jq option completion test if its --help doesn't list + them + * xdg-settings: Make help parsing work on BSD + * test: Support running with local BSD binaries, do it w/ ubuntu14 + in CI + * jq, sqlite3: Protect against negative array subscripts + * sudo: Improve long option arg handling + * sysctl: Recognize --pattern/-r and --load options + * test: Add sysctl option parsing test case + * sudo: Parse options from help/usage output, add some long option + support + * strace: Use _parse_help instead of hardcoded option list + * sshow: Add -p arg completion + * sqlite3: Add some option arg (non-)completions + * tune2fs: Update -o/-O argument lists + * jq: New completion + * reportbug: Run _parse_help and apt-cache more selectively + * querybts: Use _parse_help, not hardcoded option list, misc + improvements + * pyvenv: Support versioned 3.6-3.8 executables + * passwd: Try _parse_help before _parse_usage to parse options + * profile.d: Avoid tested variable values being confused as [ ] + operators + * cryptsetup: Add some option arg (non-)completions + * cryptsetup, nc, sh: Skip option args when counting arguments + * modinfo: Fall back to _parse_usage if _parse_help yields no + results + * mysql, mysqladmin: Complete --ssl-{ca,cert,key} option arg + * mysqladmin: Reuse --default-character-set completion from mysql + * modinfo: Use _parse_help instead of hardcoded option list + * minicom: Use _parse_help instead of hardcoded option list + * mplayer: Associate with *.S[3T]M, *.med, *.MED + * completions/Makefile.am: Use install-data-hook, not install-data- + local + * ifup etc: Add option and option argument completion + * _count_args: Add support for not counting specified option args + * ifquery: New ifup alias completion + * ngrep, tshark: Complete on *.pcapng too + * rpm: Complete --licensefiles with -q + * pytest: Rename from py.test to follow upstream recommended name + * README: Add instructions for overriding completions system wide + * README: Note $BASH_COMPLETION_USER_DIR + * test: Mark psql etc test cases untested if --help doesn't work + * aclocal, automake: Support versioned 1.16 executables + * __load_completion: Avoid bad array subscript on "commands" ending + with slash + * lzma: Use _parse_help instead of hardcoded option list + * test: Run perlcritic and flake8 on perl and python helpers in + Travis + * build: Improve cleanup of test/log and test/tmp dirs + * pkg-config: Complete on *.pc files + * build: Use AC_PROG_SED to locate sed + * build: Do cmake, pc, and profile variable replacements in Makefile + * README: Add Q/A on overriding a completion, modernize local + install answer + * json_xs: New completion + * chmod: New completion + * iperf, nc: Include IPv6 addresses in bind address completions + * links: Major rework, parse options from --help, add option arg + completion + * _ip_addresses: Add option to complete all/v4/v6 addresses, add + unit test + * wget: Remove nonexistent arg to _ip_addresses + * _filedir: Drop unnecessary evals + * iconv: Split charset completion to _iconv_charsets, add test case + * links: Install completion for links2 too + * xgamma: Comment spelling fix + * lftp: handle -s + * test: Skip scrub -p test when its --help doesn't list available + patterns + * ecryptfs-migrate-home: New completion + * scrub: New completion + * ether-wake: Install for etherwake as well + * *: Support completing arg of last bundled short option + * dselect: Parse options with _parse_help + * dhclient: Add some option arg (non-)completions + * dhclient: Parse options with _parse_usage + * chage, chpasswd: Add -R/--root arg completion + * reportbug: Add bunch of option arg (non-)completions + * .dir-locals.el: Set -O extglob for flycheck bash checks + * mount, umount: Deprecate on Linux in favor of util-linux >= 2.28 + ones + * _known_hosts_real: Reimplement known hosts file parsing in pure + bash + * test: Add comment line to fixtures/_known_hosts_real/known_hosts + * ssh: Complete all *File option args with _filedir + * README: Point Debian and openSUSE badges towards unstable and + Tumbleweed + * README: Link to various distro packages + * apt-get: Add -h/-v/-o non-completions + * apt-get: Sync option list with apt 1.5.1 + * apt-get: Simplify -t and friends completion, support Ubuntu + * apt-get: Add indextargets to list of suggested commands + * apt-get: Complete install package=versions + * ssh: Sync config option lists with OpenSSH 7.5p1, add some value + completions + * ssh: Sync query type list with OpenSSH 7.5p1 + * ssh: Order various switch cases closer to alphabetical + * completions/Makefile: Fix check-local in VPATH builds + + [ dmerge ] + * _filedir: Refactor to remove heredoc-dependent loop + + [ marxin ] + * gccgo: Add as a GCC completion target (#227) + + [ ovf ] + * xrandr: match the output name exactly for --mode + + -- Ville Skyttä Sat, 27 Apr 2019 11:50:12 +0300 + bash-completion (2.8) [ Andrea Dari ] diff --git a/bash_completion b/bash_completion index fad45ef12f7..58987a7fc1e 100644 --- a/bash_completion +++ b/bash_completion @@ -23,7 +23,7 @@ # # https://github.com/scop/bash-completion -BASH_COMPLETION_VERSINFO=(2 8) +BASH_COMPLETION_VERSINFO=(2 9) if [[ $- == *v* ]]; then BASH_COMPLETION_ORIGINAL_V_VALUE="-v" diff --git a/configure.ac b/configure.ac index de9f97646d3..1f3b37e8065 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.60]) -AC_INIT([bash-completion], [2.8]) +AC_INIT([bash-completion], [2.9]) AM_INIT_AUTOMAKE([foreign dist-xz no-dist-gzip -Wall -Wno-portability -Werror]) AC_PROG_LN_S AC_PROG_MKDIR_P From 8d60fd32be777e4c6e734c1dac431b39b53fb216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 27 Apr 2019 12:58:41 +0300 Subject: [PATCH 0154/1094] README: link to cygwin package --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 06984a10c1c..c832184906c 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ below. The package's name is usually bash-completion. [![Alpine](https://img.shields.io/badge/Alpine-%28see%20website%29-brightgreen.svg)](https://pkgs.alpinelinux.org/packages?name=bash-completion) [![Arch](https://img.shields.io/badge/dynamic/json.svg?uri=https%3A%2F%2Fwww.archlinux.org%2Fpackages%2Fextra%2Fany%2Fbash-completion%2Fjson%2F&query=%24.pkgver&label=Arch)](https://www.archlinux.org/packages/extra/any/bash-completion/) +[![Cygwin](https://img.shields.io/badge/Cygwin-%28see%20website%29-brightgreen.svg)](https://cygwin.com/packages/x86/bash-completion/) [![Debian](https://img.shields.io/badge/dynamic/json.svg?uri=https%3A%2F%2Fapi.ftp-master.debian.org%2Fmadison%3Fpackage%3Dbash-completion%26f%3Djson%26s%3Dunstable&query=%24..source_version&label=Debian)](https://packages.debian.org/search?keywords=bash-completion&searchon=names&exact=1) [![Fedora](https://img.shields.io/badge/dynamic/json.svg?uri=https%3A%2F%2Fapps.fedoraproject.org%2Fmdapi%2Frawhide%2Fpkg%2Fbash-completion&query=%24.version&label=Fedora)](https://apps.fedoraproject.org/packages/bash-completion) [![FreshPorts](https://img.shields.io/badge/FreshPorts-%28see%20website%29-brightgreen.svg)](https://www.freshports.org/shells/bash-completion) From 483968cd513142b71d1e6e9f199d5eaf958eb616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 27 Apr 2019 12:59:54 +0300 Subject: [PATCH 0155/1094] README: use light gray badges for unknown versions --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c832184906c..d3815e6329b 100644 --- a/README.md +++ b/README.md @@ -8,18 +8,18 @@ The easiest way to install this software is to use a package; it is available in many operating system distributions, some examples are listed below. The package's name is usually bash-completion. -[![Alpine](https://img.shields.io/badge/Alpine-%28see%20website%29-brightgreen.svg)](https://pkgs.alpinelinux.org/packages?name=bash-completion) +[![Alpine](https://img.shields.io/badge/Alpine-%28see%20website%29-lightgray.svg)](https://pkgs.alpinelinux.org/packages?name=bash-completion) [![Arch](https://img.shields.io/badge/dynamic/json.svg?uri=https%3A%2F%2Fwww.archlinux.org%2Fpackages%2Fextra%2Fany%2Fbash-completion%2Fjson%2F&query=%24.pkgver&label=Arch)](https://www.archlinux.org/packages/extra/any/bash-completion/) -[![Cygwin](https://img.shields.io/badge/Cygwin-%28see%20website%29-brightgreen.svg)](https://cygwin.com/packages/x86/bash-completion/) +[![Cygwin](https://img.shields.io/badge/Cygwin-%28see%20website%29-lightgray.svg)](https://cygwin.com/packages/x86/bash-completion/) [![Debian](https://img.shields.io/badge/dynamic/json.svg?uri=https%3A%2F%2Fapi.ftp-master.debian.org%2Fmadison%3Fpackage%3Dbash-completion%26f%3Djson%26s%3Dunstable&query=%24..source_version&label=Debian)](https://packages.debian.org/search?keywords=bash-completion&searchon=names&exact=1) [![Fedora](https://img.shields.io/badge/dynamic/json.svg?uri=https%3A%2F%2Fapps.fedoraproject.org%2Fmdapi%2Frawhide%2Fpkg%2Fbash-completion&query=%24.version&label=Fedora)](https://apps.fedoraproject.org/packages/bash-completion) -[![FreshPorts](https://img.shields.io/badge/FreshPorts-%28see%20website%29-brightgreen.svg)](https://www.freshports.org/shells/bash-completion) -[![Gentoo](https://img.shields.io/badge/Gentoo-%28see%20website%29-brightgreen.svg)](https://packages.gentoo.org/packages/app-shells/bash-completion) +[![FreshPorts](https://img.shields.io/badge/FreshPorts-%28see%20website%29-lightgray.svg)](https://www.freshports.org/shells/bash-completion) +[![Gentoo](https://img.shields.io/badge/Gentoo-%28see%20website%29-lightgray.svg)](https://packages.gentoo.org/packages/app-shells/bash-completion) [![Homebrew](https://img.shields.io/homebrew/v/bash-completion%402.svg)](http://formulae.brew.sh/formula/bash-completion%402) -[![OpenCSW](https://img.shields.io/badge/OpenCSW-%28see%20website%29-brightgreen.svg)](https://www.opencsw.org/package/bash_completion/) -[![openSUSE](https://img.shields.io/badge/openSUSE-%28see%20website%29-brightgreen.svg)](https://software.opensuse.org/package/bash-completion?baseproject=openSUSE%3AFactory) -[![Slackware](https://img.shields.io/badge/Slackware-%28see%20website%29-brightgreen.svg)](https://packages.slackware.com/?search=bash-completion) -[![Ubuntu](https://img.shields.io/badge/Ubuntu-%28see%20website%29-brightgreen.svg)](https://packages.ubuntu.com/search?keywords=bash-completion&searchon=names&exact=1) +[![OpenCSW](https://img.shields.io/badge/OpenCSW-%28see%20website%29-lightgray.svg)](https://www.opencsw.org/package/bash_completion/) +[![openSUSE](https://img.shields.io/badge/openSUSE-%28see%20website%29-lightgray.svg)](https://software.opensuse.org/package/bash-completion?baseproject=openSUSE%3AFactory) +[![Slackware](https://img.shields.io/badge/Slackware-%28see%20website%29-lightgray.svg)](https://packages.slackware.com/?search=bash-completion) +[![Ubuntu](https://img.shields.io/badge/Ubuntu-%28see%20website%29-lightgray.svg)](https://packages.ubuntu.com/search?keywords=bash-completion&searchon=names&exact=1) Depending on the package, you may still need to source it from either `/etc/bashrc` or `~/.bashrc` (or any From ac51b00358ebe510f4899db9678480a6c6a4eda1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sun, 28 Apr 2019 10:11:22 +0200 Subject: [PATCH 0156/1094] test_rpm2tgz: Fix expected output Fix typo in path, as well as missing format string argument in rpm2tgz test. This resulted in the expected value missing the directory, causing the test to fail. --- test/t/test_rpm2tgz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/t/test_rpm2tgz.py b/test/t/test_rpm2tgz.py index 366faedc436..ad6e8bc76a1 100644 --- a/test/t/test_rpm2tgz.py +++ b/test/t/test_rpm2tgz.py @@ -12,9 +12,9 @@ def test_1(self, completion): def test_2(self, completion): expected = sorted( [ - "%s/" + "%s/" % x for x in os.listdir("slackware/home") - if os.path.isdir("shared/bin/%s" % x) + if os.path.isdir("slackware/home/%s" % x) ] + [ x From 0ee39821c67735fd16b5372cd4044775af1d1243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Sun, 28 Apr 2019 08:52:04 +0200 Subject: [PATCH 0157/1094] test_chromium_browser: Skip test_2 if 'chromium-browser --help' fails Skip test_2 when help for chromium-browser is not available. Follows similar logic used in other tests. Fixes test failure on Gentoo where the manpage of chromium is missing for some reason. --- test/t/test_chromium_browser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/t/test_chromium_browser.py b/test/t/test_chromium_browser.py index 75cabdaf9af..94317483960 100644 --- a/test/t/test_chromium_browser.py +++ b/test/t/test_chromium_browser.py @@ -7,7 +7,7 @@ class TestChromiumBrowser: def test_1(self, completion): assert completion - @pytest.mark.complete("chromium-browser -") + @pytest.mark.complete("chromium-browser -", skipif="! chromium-browser --help &>/dev/null") def test_2(self, completion): assert completion assert not completion.endswith(" ") From af0b3d0130f61a7d7960dd8eee99529fea6e39a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 28 Apr 2019 15:34:45 +0300 Subject: [PATCH 0158/1094] tar: add missing bsdtar, gtar, and star symlinks Closes https://github.com/scop/bash-completion/issues/307 --- completions/.gitignore | 1 + completions/Makefile.am | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/completions/.gitignore b/completions/.gitignore index 06f8d013d38..a1abde61733 100644 --- a/completions/.gitignore +++ b/completions/.gitignore @@ -71,6 +71,7 @@ google-chrome google-chrome-stable gpc gpgv2 +gtar hciattach hciconfig hd diff --git a/completions/Makefile.am b/completions/Makefile.am index 94cca466057..efce02d5a83 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -560,6 +560,7 @@ CLEANFILES = \ google-chrome-stable \ gpc \ gpgv2 \ + gtar \ hciattach \ hciconfig \ hd \ @@ -1057,6 +1058,10 @@ symlinks: $(targetdir) $(DATA) rm -f $(targetdir)/$$file && \ $(LN_S) sudo $(targetdir)/$$file ; \ done + for file in bsdtar gtar star ; do \ + rm -f $(targetdir)/$$file && \ + $(LN_S) tar $(targetdir)/$$file ; \ + done for file in tracepath6 ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) tracepath $(targetdir)/$$file ; \ From 3bc0225ee28abc81800042c168b0721f5c68c49f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 28 Apr 2019 21:32:00 +0300 Subject: [PATCH 0159/1094] build: simplify symlink setup --- Makefile.am | 2 +- completions/Makefile.am | 558 ++++++++++++++-------------------------- setup-symlinks.sh | 9 + 3 files changed, 201 insertions(+), 368 deletions(-) create mode 100755 setup-symlinks.sh diff --git a/Makefile.am b/Makefile.am index 8f441185556..c54eb8ed44f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,7 +29,7 @@ CLEANFILES = bash_completion.sh bash-completion.pc \ EXTRA_DIST = CHANGES $(pkgdata_DATA) bash_completion.sh.in .dir-locals.el \ .editorconfig README.md CONTRIBUTING.md pyproject.toml .perltidyrc \ .shellcheckrc bash-completion.pc.in bash-completion-config.cmake.in \ - bash-completion-config-version.cmake.in + bash-completion-config-version.cmake.in setup-symlinks.sh install-data-hook: tmpfile=`mktemp $${TMPDIR:-/tmp}/bash_completion.XXXXXX` && \ diff --git a/completions/Makefile.am b/completions/Makefile.am index efce02d5a83..75272607688 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -725,377 +725,201 @@ CLEANFILES = \ xvnc4viewer \ ypcat -symlinks: $(targetdir) $(DATA) - for file in 7za ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) 7z $(targetdir)/$$file ; \ - done - for file in aclocal-1.10 aclocal-1.11 aclocal-1.12 aclocal-1.13 \ - aclocal-1.14 aclocal-1.15 aclocal-1.16 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) aclocal $(targetdir)/$$file ; \ - done - for file in phing ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ant $(targetdir)/$$file ; \ - done - for file in aptitude-curses ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) aptitude $(targetdir)/$$file ; \ - done - for file in asciidoc.py ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) asciidoc $(targetdir)/$$file ; \ - done - for file in automake-1.10 automake-1.11 automake-1.12 automake-1.13 \ - automake-1.14 automake-1.15 automake-1.16 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) automake $(targetdir)/$$file ; \ - done - for file in autoheader ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) autoreconf $(targetdir)/$$file ; \ - done - for file in autoupdate ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) autoscan $(targetdir)/$$file ; \ - done - for file in btdownloadcurses.py btdownloadgui.py ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) btdownloadheadless.py $(targetdir)/$$file ; \ - done - for file in lbzip2 pbzip2 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) bzip2 $(targetdir)/$$file ; \ - done - for file in ncal ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) _cal $(targetdir)/$$file ; \ - done - for file in pccardctl ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) cardctl $(targetdir)/$$file ; \ - done - for file in google-chrome google-chrome-stable chromium chrome; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) chromium-browser $(targetdir)/$$file ; \ - done - for file in compgen ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) complete $(targetdir)/$$file ; \ - done - for file in mogrify display animate identify montage composite \ - compare conjure import stream ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) convert $(targetdir)/$$file ; \ - done - for file in cowthink ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) cowsay $(targetdir)/$$file ; \ - done - for file in rdict ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) dict $(targetdir)/$$file ; \ - done - for file in dpkg-deb dpkg-query dpkg-reconfigure ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) dpkg $(targetdir)/$$file ; \ - done - for file in etherwake ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ether-wake $(targetdir)/$$file ; \ - done - for file in mailsnarf msgsnarf ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) filesnarf $(targetdir)/$$file ; \ - done - for file in iceweasel mozilla-firefox ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) firefox $(targetdir)/$$file ; \ - done - for file in civclient freeciv-gtk2 freeciv-gtk3 freeciv-sdl \ - freeciv-xaw ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) freeciv $(targetdir)/$$file ; \ - done - for file in civserver ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) freeciv-server $(targetdir)/$$file ; \ - done - for file in declare typeset ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) function $(targetdir)/$$file ; \ - done - for file in cc c++ g++ g++-5 g++-6 g++-7 g++-8 gfortran gfortran-5 \ - gfortran-6 gfortran-7 gfortran-8 f77 g77 f95 g95 gcj gpc \ - gccgo gccgo-5 gccgo-6 gccgo-7 gccgo-8 gcc-5 gcc-6 gcc-7 \ - gcc-8 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) gcc $(targetdir)/$$file ; \ - done - for file in mkisofs ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) genisoimage $(targetdir)/$$file ; \ - done - for file in geoiplookup6 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) geoiplookup $(targetdir)/$$file ; \ - done - for file in gkrellm2 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) gkrellm $(targetdir)/$$file ; \ - done - for file in gpgv2 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) gpgv $(targetdir)/$$file ; \ - done - for file in pigz ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) gzip $(targetdir)/$$file ; \ - done - for file in sdptool l2ping rfcomm ciptool dfutool hciconfig \ - hciattach ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) hcitool $(targetdir)/$$file ; \ - done - for file in hd ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) _hexdump $(targetdir)/$$file ; \ - done - for file in hping hping3 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) hping2 $(targetdir)/$$file ; \ - done - for file in ifdown ifquery ifstatus ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ifup $(targetdir)/$$file ; \ - done - for file in pinfo ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) info $(targetdir)/$$file ; \ - done - for file in inotifywatch ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) inotifywait $(targetdir)/$$file ; \ - done - for file in insmod.static ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) insmod $(targetdir)/$$file ; \ - done - for file in iperf3 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) iperf $(targetdir)/$$file ; \ - done - for file in javac javadoc ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) java $(targetdir)/$$file ; \ - done - for file in arm-koji ppc-koji s390-koji sparc-koji ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) koji $(targetdir)/$$file ; \ - done - for file in ldapadd ldapmodify ldapdelete ldapcompare ldapmodrdn \ - ldapwhoami ldappasswd ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ldapsearch $(targetdir)/$$file ; \ - done - for file in links2 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) links $(targetdir)/$$file ; \ - done - for file in lintian-info ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) lintian $(targetdir)/$$file ; \ - done - for file in lusermod ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) luseradd $(targetdir)/$$file ; \ - done - for file in lvmdiskscan pvscan pvs pvdisplay pvchange pvcreate pvmove \ - pvremove vgscan vgs vgdisplay vgchange vgremove vgrename \ - vgreduce vgextend vgimport vgexport vgck vgconvert vgcreate \ - vgcfgbackup vgcfgrestore vgmerge vgsplit vgmknodes lvscan lvs \ - lvdisplay lvchange lvcreate lvremove lvrename lvreduce \ - lvresize lvextend ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) lvm $(targetdir)/$$file ; \ - done - for file in lz4c ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) lz4 $(targetdir)/$$file ; \ - done - for file in clzip pdlzip plzip ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) lzip $(targetdir)/$$file ; \ - done - for file in colormake gmake gnumake pmake ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) make $(targetdir)/$$file ; \ - done - for file in apropos whatis ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) man $(targetdir)/$$file ; \ - done - for file in mdecrypt ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) mcrypt $(targetdir)/$$file ; \ - done - for file in mplayer2 mencoder gmplayer kplayer ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) mplayer $(targetdir)/$$file ; \ - done - for file in muttng ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) mutt $(targetdir)/$$file ; \ - done - for file in host ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) nslookup $(targetdir)/$$file ; \ - done - for file in g4 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) p4 $(targetdir)/$$file ; \ - done - for file in perldoc ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) perl $(targetdir)/$$file ; \ - done - for file in alpine ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pine $(targetdir)/$$file ; \ - done - for file in ping6 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ping $(targetdir)/$$file ; \ - done - for file in pkg_info pkg_deinstall ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pkg_delete $(targetdir)/$$file ; \ - done - for file in pkill ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pgrep $(targetdir)/$$file ; \ - done - for file in pm-suspend pm-suspend-hybrid ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pm-hibernate $(targetdir)/$$file ; \ - done - for file in createdb createuser dropdb dropuser ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) psql $(targetdir)/$$file ; \ - done - for file in postalias ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) postmap $(targetdir)/$$file ; \ - done - for file in xpovray spovray ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) povray $(targetdir)/$$file ; \ - done - for file in puppetmasterd puppetd puppetca ralsh puppetrun puppetqd \ - filebucket puppetdoc ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) puppet $(targetdir)/$$file ; \ - done - for file in pytest-2 pytest-3 py.test py.test-2 py.test-3 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pytest $(targetdir)/$$file ; \ - done - for file in pydoc3 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pydoc $(targetdir)/$$file ; \ - done - for file in pylint-2 pylint-3 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pylint $(targetdir)/$$file ; \ - done - for file in pypy pypy3 python2 python3 micropython ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) python $(targetdir)/$$file ; \ - done - for file in pyvenv-3.4 pyvenv-3.5 pyvenv-3.6 pyvenv-3.7 \ - pyvenv-3.8 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pyvenv $(targetdir)/$$file ; \ - done - for file in dcop ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) qdbus $(targetdir)/$$file ; \ - done - for file in qemu-kvm qemu-system-i386 qemu-system-x86_64 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) qemu $(targetdir)/$$file ; \ - done - for file in setquota edquota quotacheck repquota quotaon quotaoff ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) quota $(targetdir)/$$file ; \ - done - for file in ci co rlog rcsdiff ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) rcs $(targetdir)/$$file ; \ - done - for file in rpmbuild rpmbuild-md5 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) rpm $(targetdir)/$$file ; \ - done - for file in rpm2txz rpm2targz ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) rpm2tgz $(targetdir)/$$file ; \ - done - for file in smbget smbcacls smbcquotas smbpasswd smbtar smbtree ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) smbclient $(targetdir)/$$file ; \ - done - for file in sbcl-mt ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) sbcl $(targetdir)/$$file ; \ - done - for file in slogin autossh sftp scp sidedoor ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ssh $(targetdir)/$$file ; \ - done - for file in sudoedit ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) sudo $(targetdir)/$$file ; \ - done - for file in bsdtar gtar star ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) tar $(targetdir)/$$file ; \ - done - for file in tracepath6 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) tracepath $(targetdir)/$$file ; \ - done - for file in alternatives ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) update-alternatives $(targetdir)/$$file ; \ - done - for file in vigr ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) vipw $(targetdir)/$$file ; \ - done - for file in tightvncviewer xvnc4viewer ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) vncviewer $(targetdir)/$$file ; \ - done - for file in cdrecord ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) wodim $(targetdir)/$$file ; \ - done - for file in pxz ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) xz $(targetdir)/$$file ; \ - done - for file in ypcat ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ypmatch $(targetdir)/$$file ; \ - done +symlinks: $(DATA) + $(ss) 7z \ + 7za + $(ss) aclocal \ + aclocal-1.10 aclocal-1.11 aclocal-1.12 aclocal-1.13 \ + aclocal-1.14 aclocal-1.15 aclocal-1.16 + $(ss) ant \ + phing + $(ss) aptitude \ + aptitude-curses + $(ss) asciidoc \ + asciidoc.py + $(ss) automake \ + automake-1.10 automake-1.11 automake-1.12 automake-1.13 \ + automake-1.14 automake-1.15 automake-1.16 + $(ss) autoreconf \ + autoheader + $(ss) autoscan \ + autoupdate + $(ss) btdownloadheadless.py \ + btdownloadcurses.py btdownloadgui.py + $(ss) bzip2 \ + lbzip2 pbzip2 + $(ss) _cal \ + ncal + $(ss) cardctl \ + pccardctl + $(ss) chromium-browser \ + chrome chromium google-chrome google-chrome-stable + $(ss) complete \ + compgen + $(ss) convert \ + animate compare composite conjure display identify import \ + mogrify montage stream + $(ss) cowsay \ + cowthink + $(ss) dict \ + rdict + $(ss) dpkg \ + dpkg-deb dpkg-query dpkg-reconfigure + $(ss) ether-wake \ + etherwake + $(ss) filesnarf \ + mailsnarf msgsnarf + $(ss) firefox \ + iceweasel mozilla-firefox + $(ss) freeciv \ + civclient freeciv-gtk2 freeciv-gtk3 freeciv-sdl freeciv-xaw + $(ss) freeciv-server \ + civserver + $(ss) function \ + declare typeset + $(ss) gcc \ + c++ cc f77 f95 g++ g++-5 g++-6 g++-7 g++-8 g77 g95 gcc-5 \ + gcc-6 gcc-7 gcc-8 gccgo gccgo-5 gccgo-6 gccgo-7 gccgo-8 gcj \ + gfortran gfortran-5 gfortran-6 gfortran-7 gfortran-8 gpc + $(ss) genisoimage \ + mkisofs + $(ss) geoiplookup \ + geoiplookup6 + $(ss) gkrellm \ + gkrellm2 + $(ss) gpgv \ + gpgv2 + $(ss) gzip \ + pigz + $(ss) hcitool \ + ciptool dfutool hciattach hciconfig l2ping rfcomm sdptool + $(ss) _hexdump \ + hd + $(ss) hping2 \ + hping hping3 + $(ss) ifup \ + ifdown ifquery ifstatus + $(ss) info \ + pinfo + $(ss) inotifywait \ + inotifywatch + $(ss) insmod \ + insmod.static + $(ss) iperf \ + iperf3 + $(ss) java \ + javac javadoc + $(ss) koji \ + arm-koji ppc-koji s390-koji sparc-koji + $(ss) ldapsearch \ + ldapadd ldapcompare ldapdelete ldapmodify ldapmodrdn \ + ldappasswd ldapwhoami + $(ss) links \ + links2 + $(ss) lintian \ + lintian-info + $(ss) luseradd \ + lusermod + $(ss) lvm \ + lvchange lvcreate lvdisplay lvextend lvmdiskscan lvreduce \ + lvremove lvrename lvresize lvs lvscan pvchange pvcreate \ + pvdisplay pvmove pvremove pvs pvscan vgcfgbackup vgcfgrestore \ + vgchange vgck vgconvert vgcreate vgdisplay vgexport vgextend \ + vgimport vgmerge vgmknodes vgreduce vgremove vgrename vgs \ + vgscan vgsplit + $(ss) lz4 \ + lz4c + $(ss) lzip \ + clzip pdlzip plzip + $(ss) make \ + colormake gmake gnumake pmake + $(ss) man \ + apropos whatis + $(ss) mcrypt \ + mdecrypt + $(ss) mplayer \ + gmplayer kplayer mencoder mplayer2 + $(ss) mutt \ + muttng + $(ss) nslookup \ + host + $(ss) p4 \ + g4 + $(ss) perl \ + perldoc + $(ss) pine \ + alpine + $(ss) ping \ + ping6 + $(ss) pkg_delete \ + pkg_deinstall pkg_info + $(ss) pgrep \ + pkill + $(ss) pm-hibernate \ + pm-suspend pm-suspend-hybrid + $(ss) psql \ + createdb createuser dropdb dropuser + $(ss) postmap \ + postalias + $(ss) povray \ + spovray xpovray + $(ss) puppet \ + filebucket puppetca puppetd puppetdoc puppetmasterd puppetqd \ + puppetrun ralsh + $(ss) pytest \ + py.test py.test-2 py.test-3 pytest-2 pytest-3 + $(ss) pydoc \ + pydoc3 + $(ss) pylint \ + pylint-2 pylint-3 + $(ss) python \ + micropython pypy pypy3 python2 python3 + $(ss) pyvenv \ + pyvenv-3.4 pyvenv-3.5 pyvenv-3.6 pyvenv-3.7 pyvenv-3.8 + $(ss) qdbus \ + dcop + $(ss) qemu \ + qemu-kvm qemu-system-i386 qemu-system-x86_64 + $(ss) quota \ + edquota quotacheck quotaoff quotaon repquota setquota + $(ss) rcs \ + ci co rcsdiff rlog + $(ss) rpm \ + rpmbuild rpmbuild-md5 + $(ss) rpm2tgz \ + rpm2targz rpm2txz + $(ss) smbclient \ + smbcacls smbcquotas smbget smbpasswd smbtar smbtree + $(ss) sbcl \ + sbcl-mt + $(ss) ssh \ + autossh scp sftp sidedoor slogin + $(ss) sudo \ + sudoedit + $(ss) tar \ + bsdtar gtar star + $(ss) tracepath \ + tracepath6 + $(ss) update-alternatives \ + alternatives + $(ss) vipw \ + vigr + $(ss) vncviewer \ + tightvncviewer xvnc4viewer + $(ss) wodim \ + cdrecord + $(ss) xz \ + pxz + $(ss) ypmatch \ + ypcat .PHONY: symlinks -all-local: targetdir = . +SETUP_SYMLINKS = $(srcdir)/../setup-symlinks.sh + +all-local: ss = $(SETUP_SYMLINKS) . all-local: symlinks -install-data-hook: targetdir = $(DESTDIR)$(bashcompdir) +install-data-hook: ss = $(SETUP_SYMLINKS) $(DESTDIR)$(bashcompdir) install-data-hook: symlinks check-local: diff --git a/setup-symlinks.sh b/setup-symlinks.sh new file mode 100755 index 00000000000..71eb92d5cce --- /dev/null +++ b/setup-symlinks.sh @@ -0,0 +1,9 @@ +#!/bin/sh -eu + +targetdir="$1"; shift +target="$1"; shift + +for file in "$@"; do + rm -f "$targetdir/$file" + ln -s "$target" "$targetdir/$file" +done From fce673275bf2a024f91bb455e5353e02f3690cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 28 Apr 2019 21:36:20 +0300 Subject: [PATCH 0160/1094] build: really reset return value before completions check --- completions/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/Makefile.am b/completions/Makefile.am index 75272607688..2625ee05316 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -923,7 +923,7 @@ install-data-hook: ss = $(SETUP_SYMLINKS) $(DESTDIR)$(bashcompdir) install-data-hook: symlinks check-local: - ret=0 + ret=0 ; \ for file in $(bashcomp_DATA) ; do \ $${bashcomp_bash:-$${BASH:-bash}} \ -O extglob -n $(srcdir)/$$file || ret=$$? ; \ From a0949de0f9988d3460b11820b97d6e4baab48cd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 28 Apr 2019 21:38:09 +0300 Subject: [PATCH 0161/1094] build: makefile whitespace tweaks --- completions/Makefile.am | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/completions/Makefile.am b/completions/Makefile.am index 2625ee05316..97b2b9764b3 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -923,9 +923,9 @@ install-data-hook: ss = $(SETUP_SYMLINKS) $(DESTDIR)$(bashcompdir) install-data-hook: symlinks check-local: - ret=0 ; \ - for file in $(bashcomp_DATA) ; do \ + ret=0; \ + for file in $(bashcomp_DATA); do \ $${bashcomp_bash:-$${BASH:-bash}} \ - -O extglob -n $(srcdir)/$$file || ret=$$? ; \ - done ; \ + -O extglob -n $(srcdir)/$$file || ret=$$?; \ + done; \ exit $$ret From 27daf018539500cad68e488cc81caf064e65075c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 28 Apr 2019 21:50:36 +0300 Subject: [PATCH 0162/1094] test: bashrc comment and whitespace tweaks --- test/config/bashrc | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/test/config/bashrc b/test/config/bashrc index 69098e14ec4..d87c3eba085 100644 --- a/test/config/bashrc +++ b/test/config/bashrc @@ -1,38 +1,46 @@ -# bashrc file for DejaGnu testsuite +# bashrc file for bash-completion test suite # Note that we do some initialization that would be too late to do here in -# library.exp's start_bash(). +# library.exp's start_bash() and conftest.py. - # Use emacs key bindings +# Use emacs key bindings set -o emacs - # Use bash strict mode + +# Use bash strict mode set -o posix - # Unset `command_not_found_handle' as defined on Debian/Ubuntu, because this - # troubles and slows down testing + +# Unset `command_not_found_handle' as defined on Debian/Ubuntu, because this +# troubles and slows down testing unset -f command_not_found_handle + TESTDIR=$(pwd) + export PS2='> ' - # Also test completions of system administrator commands, which are - # installed via the same PATH expansion in `bash_completion.have()' + +# Also test completions of system administrator commands, which are +# installed via the same PATH expansion in `bash_completion.have()' export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin - # ...as well as games on some systems not in PATH by default: + +# ...as well as games on some systems not in PATH by default: export PATH=$PATH:/usr/games:/usr/local/games - # For clean test state, avoid sourcing user's ~/.bash_completion + +# For clean test state, avoid sourcing user's ~/.bash_completion export BASH_COMPLETION_USER_FILE=/dev/null - # ...and avoid stuff in BASH_COMPLETION_USER_DIR overriding in-tree - # completions. The user dir is first in the lookup path, so this should also - # give precedence to the in-tree "completions" dir over other ones, e.g. - # the one possibly in /usr/share/bash-completion. + +# ...and avoid stuff in BASH_COMPLETION_USER_DIR overriding in-tree +# completions. The user dir is first in the lookup path, so this should also +# give precedence to the in-tree "completions" dir over other ones, e.g. +# the one possibly in /usr/share/bash-completion. export BASH_COMPLETION_USER_DIR=$(cd "$SRCDIR/.."; pwd) - # Make sure default settings are in effect +# Make sure default settings are in effect unset -v \ COMP_CONFIGURE_HINTS \ COMP_CVS_REMOTE \ COMP_KNOWN_HOSTS_WITH_HOSTFILE \ COMP_TAR_INTERNAL_PATHS - # Load bash testsuite helper functions +# Load bash testsuite helper functions . $SRCDIR/lib/library.sh # Local variables: From 77008960c7a402e96c24a5c9eab7d88ebc735896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 28 Apr 2019 22:09:23 +0300 Subject: [PATCH 0163/1094] test: more thorough system location interference avoidance Closes https://github.com/scop/bash-completion/issues/309 --- test/config/bashrc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/config/bashrc b/test/config/bashrc index d87c3eba085..40a79479daf 100644 --- a/test/config/bashrc +++ b/test/config/bashrc @@ -27,11 +27,13 @@ export PATH=$PATH:/usr/games:/usr/local/games # For clean test state, avoid sourcing user's ~/.bash_completion export BASH_COMPLETION_USER_FILE=/dev/null -# ...and avoid stuff in BASH_COMPLETION_USER_DIR overriding in-tree -# completions. The user dir is first in the lookup path, so this should also -# give precedence to the in-tree "completions" dir over other ones, e.g. -# the one possibly in /usr/share/bash-completion. +# ...and avoid stuff in BASH_COMPLETION_USER_DIR and system install locations +# overriding in-tree completions. Setting the user dir would otherwise suffice, +# but simple xspec completions are only installed if a separate one is not +# found in any completion dirs. Therefore we also point the "system" dirs to +# locations that should not yield valid completions and helpers paths either. export BASH_COMPLETION_USER_DIR=$(cd "$SRCDIR/.."; pwd) +export XDG_DATA_DIRS=/var/empty # Make sure default settings are in effect unset -v \ From f7e2a4192e6e2980859da1a64816fab75aa11b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 28 Apr 2019 22:10:25 +0300 Subject: [PATCH 0164/1094] test: set up BASH_COMPLETION_COMPAT_DIR in bashrc (only) --- test/config/bashrc | 2 ++ test/lib/library.exp | 1 - test/t/conftest.py | 2 -- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/test/config/bashrc b/test/config/bashrc index 40a79479daf..dad96335e42 100644 --- a/test/config/bashrc +++ b/test/config/bashrc @@ -33,6 +33,8 @@ export BASH_COMPLETION_USER_FILE=/dev/null # found in any completion dirs. Therefore we also point the "system" dirs to # locations that should not yield valid completions and helpers paths either. export BASH_COMPLETION_USER_DIR=$(cd "$SRCDIR/.."; pwd) +# /var/empty isn't necessarily actually always empty :P +export BASH_COMPLETION_COMPAT_DIR=/var/empty/bash_completion.d export XDG_DATA_DIRS=/var/empty # Make sure default settings are in effect diff --git a/test/lib/library.exp b/test/lib/library.exp index 899d74b61b9..c984cbb78eb 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -781,7 +781,6 @@ proc _save_env {{file ""}} { # Source bash_completion package proc source_bash_completion {} { - assert_bash_exec {BASH_COMPLETION_COMPAT_DIR="$SRCDIR/fixtures/shared/empty_dir"} assert_bash_exec {source $(cd "$SRCDIR/.."; pwd)/bash_completion} } diff --git a/test/t/conftest.py b/test/t/conftest.py index 0969a313144..f3c28e30c39 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -93,8 +93,6 @@ def bash(request) -> pexpect.spawn: PS1=PS1, INPUTRC="%s/config/inputrc" % testdir, TERM="dumb", - BASH_COMPLETION_COMPAT_DIR="%s/fixtures/shared/empty_dir" - % testdir, LC_COLLATE="C", # to match Python's default locale unaware sort ) ) From 7bf6281a47ce2fda45f8b7fec48e53e19e0f640d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 28 Apr 2019 22:28:06 +0300 Subject: [PATCH 0165/1094] test: reformat test_chromium_browser.py source Refs https://github.com/scop/bash-completion/pull/308 --- test/t/test_chromium_browser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/t/test_chromium_browser.py b/test/t/test_chromium_browser.py index 94317483960..f0104bbaaf9 100644 --- a/test/t/test_chromium_browser.py +++ b/test/t/test_chromium_browser.py @@ -7,7 +7,9 @@ class TestChromiumBrowser: def test_1(self, completion): assert completion - @pytest.mark.complete("chromium-browser -", skipif="! chromium-browser --help &>/dev/null") + @pytest.mark.complete( + "chromium-browser -", skipif="! chromium-browser --help &>/dev/null" + ) def test_2(self, completion): assert completion assert not completion.endswith(" ") From 5bc9b8eb51ccc41f78af0e108503de5edc87f101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 30 Apr 2019 16:31:06 +0300 Subject: [PATCH 0166/1094] pkg_delete: don't limit to FreeBSD Refs https://github.com/NetBSD/pkgsrc/pull/36 --- completions/pkg_delete | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/completions/pkg_delete b/completions/pkg_delete index b1a93c2049f..942647d0bdd 100644 --- a/completions/pkg_delete +++ b/completions/pkg_delete @@ -1,6 +1,4 @@ -# bash completion for FreeBSD package management tools -*- shell-script -*- - -[[ $OSTYPE == *freebsd* ]] || return 1 +# bash completion for *BSD package management tools -*- shell-script -*- _pkg_delete() { From 26d966207a2e4cef02a70d790f44812c1284d160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 30 Apr 2019 16:49:09 +0300 Subject: [PATCH 0167/1094] tar: simplify locating tarball from command line Gets rid of a couple of herestrings, and sed and its regex. --- completions/tar | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/completions/tar b/completions/tar index 2ed98e78b87..fda739c4091 100644 --- a/completions/tar +++ b/completions/tar @@ -398,7 +398,7 @@ __tar_extract_like_mode() __tar_try_list_archive() { - local tarball tarbin untar + local tarball tarbin untar i __tar_extract_like_mode || return 1 @@ -410,14 +410,19 @@ __tar_try_list_archive() untar="tf" shift - read tarball <<<"$(printf -- '%s\n' "$@" \ - | command sed -n "/^.\{1,\}$regex\$/p")" + for i in "$@"; do + if [[ $i == *.$ext ]]; then + tarball=$i + break + fi + done if [[ -n "$tarball" ]]; then local IFS=$'\n' COMPREPLY=($(compgen -o filenames -W "$( + $tarbin $untar "$tarball" 2>/dev/null | while read line; do printf "%q\n" "$(printf %q"\n" "$line")" - done <<<"$($tarbin $untar "$tarball" 2>/dev/null)" + done )" -- "$(printf "%q\n" "$cur")")) return 0 fi @@ -435,7 +440,6 @@ __tar_detect_ext() { local tars='@(@(tar|gem|spkg)?(.@(Z|[bgx]z|bz2|lz?(ma|o)|zst))|t@([abglx]z|b?(z)2|zst))' ext="$tars" - regex='\(\(tar\|gem\|spkg\)\(\.\(Z\|[bgx]z\|bz2\|lz\(ma\|o\)\?\|zst\)\)\?\|t\([abglx]z\|bz\?2\|zst\)\)' case "$tar_mode_arg" in --*) @@ -456,15 +460,12 @@ __tar_detect_ext() ;; *[Zz]*f) ext='@(@(t?(ar.)|gem.|spkg.)@(gz|Z)|taz)' - regex='\(\(t\(ar\.\)\?\|gem\.\|spkg\.\)\(gz\|Z\)\|taz\)' ;; *[jy]*f) ext='@(@(t?(ar.)|gem.)bz?(2)|spkg|tb2)' - regex='\(\(t\(ar\.\)\?\|gem\.\)bz2\?\|spkg\|tb2\)' ;; *[J]*f) ext='@(@(tar|gem|spkg).@(lzma|xz)|t[lx]z)' - regex='\(\(tar\|gem\|spkg\)\.\(lzma\|xz\)\|t[lx]z\)' ;; esac } @@ -499,7 +500,7 @@ _gtar() __tar_preparse_cmdline "${words[@]}" - local ext regex tar untar + local ext tar untar __tar_detect_ext @@ -674,7 +675,7 @@ _posix_tar() __tar_preparse_cmdline "${words[@]}" - local ext regex tar untar + local ext tar untar __tar_detect_ext From 90ede989622143dc93c9a05a18bc23767c4bff9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Tue, 30 Apr 2019 09:59:19 +0200 Subject: [PATCH 0168/1094] test_arp: Skip if ARP tables are empty Skip test_arp if 'arp' yields no output. This e.g. happens when the host is not networking-enabled. --- test/t/test_arp.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/t/test_arp.py b/test/t/test_arp.py index 35963d754ec..0dc117284e5 100644 --- a/test/t/test_arp.py +++ b/test/t/test_arp.py @@ -1,11 +1,8 @@ import pytest -from conftest import in_docker - class TestArp: - @pytest.mark.xfail(in_docker(), reason="Probably fails in docker") - @pytest.mark.complete("arp ") + @pytest.mark.complete("arp ", skipif='test -z "$(arp 2>/dev/null)"') def test_1(self, completion): assert completion From 1e3d3b4d40e3f6c150b9d31965f8b007ef823fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 30 Apr 2019 17:47:18 +0300 Subject: [PATCH 0169/1094] test: generalize check whether we're being run in a container Refs https://github.com/scop/bash-completion/issues/312 --- test/t/conftest.py | 26 ++++++++++++++++++++++++-- test/t/test_ifdown.py | 4 ++-- test/t/test_ifup.py | 4 ++-- test/t/test_make.py | 4 ++-- test/t/test_man.py | 4 ++-- test/t/unit/test_unit_ip_addresses.py | 4 ++-- 6 files changed, 34 insertions(+), 12 deletions(-) diff --git a/test/t/conftest.py b/test/t/conftest.py index f3c28e30c39..f65856288e6 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -2,6 +2,7 @@ import os import re import shlex +import subprocess from typing import Iterable, List, Optional, Tuple, Union import pexpect @@ -442,8 +443,29 @@ def completion(request, bash: pexpect.spawn) -> CompletionResult: return assert_complete(bash, marker.args[0], **marker.kwargs) -def in_docker() -> bool: - return os.path.exists("/.dockerenv") +def in_container() -> bool: + try: + container = subprocess.check_output( + "virt-what || systemd-detect-virt --container", + stderr=subprocess.DEVNULL, + shell=True, + ).strip() + except subprocess.CalledProcessError: + container = None + if container and container != b"none": + return True + if os.path.exists("/.dockerenv"): + return True + try: + with open("/proc/1/environ", "rb") as f: + # LXC, others? + if any( + x.startswith(b"container=") for x in f.readline().split(b"\0") + ): + return True + except OSError: + pass + return False class TestUnitBase: diff --git a/test/t/test_ifdown.py b/test/t/test_ifdown.py index 16447be5f36..e91e4bacd1e 100644 --- a/test/t/test_ifdown.py +++ b/test/t/test_ifdown.py @@ -1,10 +1,10 @@ import pytest -from conftest import in_docker +from conftest import in_container class TestIfdown: - @pytest.mark.xfail(in_docker(), reason="Probably fails in docker") + @pytest.mark.xfail(in_container(), reason="Probably fails in a container") @pytest.mark.complete("ifdown ") def test_1(self, completion): assert completion diff --git a/test/t/test_ifup.py b/test/t/test_ifup.py index 62d8eb4ac10..60391e478b2 100644 --- a/test/t/test_ifup.py +++ b/test/t/test_ifup.py @@ -1,10 +1,10 @@ import pytest -from conftest import in_docker +from conftest import in_container class TestIfup: - @pytest.mark.xfail(in_docker(), reason="Probably fails in docker") + @pytest.mark.xfail(in_container(), reason="Probably fails in a container") @pytest.mark.complete("ifup ") def test_1(self, completion): assert completion diff --git a/test/t/test_make.py b/test/t/test_make.py index 9c76f83c1d2..ae468fa93e9 100644 --- a/test/t/test_make.py +++ b/test/t/test_make.py @@ -2,7 +2,7 @@ import pytest -from conftest import in_docker +from conftest import in_container class TestMake: @@ -35,7 +35,7 @@ def test_6(self, bash, completion): os.remove("%s/make/%s" % (bash.cwd, "extra_makefile")) @pytest.mark.xfail( - in_docker() and os.environ.get("DIST") == "centos6", + in_container() and os.environ.get("DIST") == "centos6", reason="Fails for some unknown reason on CentOS 6, " "even though the behavior appears to be correct", ) diff --git a/test/t/test_man.py b/test/t/test_man.py index 60021d9958c..2da3087e55f 100644 --- a/test/t/test_man.py +++ b/test/t/test_man.py @@ -2,7 +2,7 @@ import pytest -from conftest import assert_bash_exec, in_docker +from conftest import assert_bash_exec, in_container @pytest.mark.bashcomp(ignore_env=r"^[+-]MANPATH=") @@ -43,7 +43,7 @@ def test_3(self, completion): assert completion == "man/quux.8" @pytest.mark.xfail( - in_docker() and os.environ.get("DIST") == "centos6", + in_container() and os.environ.get("DIST") == "centos6", reason="TODO: Fails in CentOS for some reason, unknown " "how to trigger same behavior as tests show (is " "different and correct when tried manually, but here " diff --git a/test/t/unit/test_unit_ip_addresses.py b/test/t/unit/test_unit_ip_addresses.py index cd7a38abc19..8120c882165 100644 --- a/test/t/unit/test_unit_ip_addresses.py +++ b/test/t/unit/test_unit_ip_addresses.py @@ -1,6 +1,6 @@ import pytest -from conftest import assert_bash_exec, in_docker +from conftest import assert_bash_exec, in_container @pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+COMPREPLY=") @@ -41,7 +41,7 @@ def test_3(self, functions, completion): assert completion assert all("." in x for x in completion) - @pytest.mark.xfail(in_docker(), reason="Probably fails in docker") + @pytest.mark.xfail(in_container(), reason="Probably fails in a container") @pytest.mark.complete("ia6 ") def test_4(self, functions, completion): """_ip_addresses -6 should complete ipv6 addresses.""" From 5e706a433440af4fad630d1b362f7e75578cbcdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 30 Apr 2019 18:01:38 +0300 Subject: [PATCH 0170/1094] test_feh, test_makepkg: invoke grep as "command grep" --- test/t/test_feh.py | 2 +- test/t/test_makepkg.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/t/test_feh.py b/test/t/test_feh.py index 1802e25f2bd..d4215f53d65 100644 --- a/test/t/test_feh.py +++ b/test/t/test_feh.py @@ -7,7 +7,7 @@ def test_1(self, completion): assert completion @pytest.mark.complete( - "feh --lis", skipif="feh --help 2>&1 | grep -qF 'man feh'" + "feh --lis", skipif="feh --help 2>&1 | command grep -qF 'man feh'" ) def test_2(self, completion): assert completion diff --git a/test/t/test_makepkg.py b/test/t/test_makepkg.py index 65f49ea8243..fee963148cf 100644 --- a/test/t/test_makepkg.py +++ b/test/t/test_makepkg.py @@ -1,7 +1,9 @@ import pytest -@pytest.mark.bashcomp(skipif="! makepkg --help 2>&1 | grep -qiF slackware") +@pytest.mark.bashcomp( + skipif="! makepkg --help 2>&1 | command grep -qiF slackware" +) class TestMakepkg: @pytest.mark.complete("makepkg ") def test_1(self, completion): From 70afc1ed3697c3171a004b7db2f19220117d2862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 30 Apr 2019 18:04:13 +0300 Subject: [PATCH 0171/1094] test_getconf: skip if -a doesn't output any POSIX_V* Refs https://github.com/scop/bash-completion/issues/312 --- test/t/test_getconf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/t/test_getconf.py b/test/t/test_getconf.py index 6f9192d2517..96713dbe4ce 100644 --- a/test/t/test_getconf.py +++ b/test/t/test_getconf.py @@ -14,7 +14,9 @@ def test_2(self, completion): def test_3(self, completion): assert completion - @pytest.mark.complete("getconf -v ") + @pytest.mark.complete( + "getconf -v ", skipif="! getconf -a 2>&1 | command grep -q ^POSIX_V" + ) def test_4(self, completion): assert completion From 2cdac1b9f24df62a1fa80c1824ee8524c9b02393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 1 May 2019 13:42:52 +0300 Subject: [PATCH 0172/1094] test_iconv: skip option completion if --help fails Such as on Alpine Linux (musl libc). Refs https://github.com/scop/bash-completion/issues/312 --- test/t/test_iconv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/t/test_iconv.py b/test/t/test_iconv.py index dc5f8961a66..2edc439b089 100644 --- a/test/t/test_iconv.py +++ b/test/t/test_iconv.py @@ -2,7 +2,7 @@ class TestIconv: - @pytest.mark.complete("iconv -") + @pytest.mark.complete("iconv -", skipif="! iconv --help &>/dev/null") def test_1(self, completion): assert completion From 0ba7af221b3ec3ec7b1efecd3c8458068f1934b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 1 May 2019 13:47:06 +0300 Subject: [PATCH 0173/1094] test_iconv: add basic file completion test --- test/t/test_iconv.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/t/test_iconv.py b/test/t/test_iconv.py index 2edc439b089..d1992efe1ce 100644 --- a/test/t/test_iconv.py +++ b/test/t/test_iconv.py @@ -9,3 +9,7 @@ def test_1(self, completion): @pytest.mark.complete("iconv -f UTF") def test_2(self, completion): assert completion + + @pytest.mark.complete("iconv ") + def test_3(self, completion): + assert completion From 40be1f491bfbeec50787cbe6bd2c6a794b19ef46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 1 May 2019 13:50:17 +0300 Subject: [PATCH 0174/1094] iconv: weed out ... from encoding completions The Alpine Linux one outputs that at end of its list of supported encodings, https://git.alpinelinux.org/aports/tree/main/musl/iconv.c?id=dbf9f3832723d92fe77a807f177d8826d07c9145 --- completions/iconv | 3 ++- test/t/test_iconv.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/completions/iconv b/completions/iconv index 2fb1c92d05f..788785ce417 100644 --- a/completions/iconv +++ b/completions/iconv @@ -3,7 +3,8 @@ _iconv_charsets() { COMPREPLY+=( $(compgen -W '$(${1:-iconv} -l | \ - command sed -e "s@/*\$@@" -e "s/[,()]//g")' -- "$cur") ) + command sed -e "s@/*\$@@" -e "s/[,()]//g" -e "s/ \.\.\.\$//")' \ + -- "$cur") ) } _iconv() diff --git a/test/t/test_iconv.py b/test/t/test_iconv.py index d1992efe1ce..bf18185e81f 100644 --- a/test/t/test_iconv.py +++ b/test/t/test_iconv.py @@ -13,3 +13,7 @@ def test_2(self, completion): @pytest.mark.complete("iconv ") def test_3(self, completion): assert completion + + @pytest.mark.complete("iconv -f ") + def test_4(self, completion): + assert "..." not in completion From 316289fb0837676f310925748070e1e1e87de750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 1 May 2019 14:40:17 +0300 Subject: [PATCH 0175/1094] test: add Alpine Linux container, allow failures for now Closes https://github.com/scop/bash-completion/issues/317 --- .travis.yml | 5 +++++ test/docker/Dockerfile-alpine | 5 +++++ test/docker/docker-script.sh | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 test/docker/Dockerfile-alpine diff --git a/.travis.yml b/.travis.yml index 7f7bd35e83a..299abfe2d2a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,12 +6,17 @@ services: - docker env: + - DIST=alpine - DIST=centos6 - DIST=fedoradev - DIST=ubuntu14 - DIST=ubuntu14 BSD=true NETWORK=none - DIST=tools +matrix: + allow_failures: + - env: DIST=alpine + before_install: - docker build -t bash-completion:$DIST -f test/docker/Dockerfile-$DIST . diff --git a/test/docker/Dockerfile-alpine b/test/docker/Dockerfile-alpine new file mode 100644 index 00000000000..5ed23afae4e --- /dev/null +++ b/test/docker/Dockerfile-alpine @@ -0,0 +1,5 @@ +FROM vskytta/bash-completion:alpine + +WORKDIR /work +COPY . . +CMD ["bash"] diff --git a/test/docker/docker-script.sh b/test/docker/docker-script.sh index ec310b35a8e..8dabd73f279 100755 --- a/test/docker/docker-script.sh +++ b/test/docker/docker-script.sh @@ -21,7 +21,7 @@ if [ "$BSD" ]; then fi case $DIST in - centos6|ubuntu14) + alpine|centos6|ubuntu14) : ${PYTEST:=/root/.local/bin/pytest} ;; *) From b3fecab48c22c07015a6fef7a00d4cb0ea1b74f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 1 May 2019 17:26:04 +0300 Subject: [PATCH 0176/1094] test: support xfail in our markers like skipif, use it a lot Often better to get the test to run, even if expecting failure; that way we may have unexpected passes to work on. --- test/t/conftest.py | 18 +++++++++++++++++- test/t/test_chkconfig.py | 2 +- test/t/test_chromium_browser.py | 2 +- test/t/test_createdb.py | 2 +- test/t/test_createuser.py | 2 +- test/t/test_dpkg.py | 4 +--- test/t/test_dropdb.py | 2 +- test/t/test_feh.py | 2 +- test/t/test_flake8.py | 2 +- test/t/test_fmt.py | 2 +- test/t/test_fold.py | 2 +- test/t/test_getconf.py | 2 +- test/t/test_gprof.py | 2 +- test/t/test_head.py | 2 +- test/t/test_iconv.py | 2 +- test/t/test_ifstat.py | 4 ++-- test/t/test_jq.py | 3 +-- test/t/test_kill.py | 2 +- test/t/test_ls.py | 2 +- test/t/test_lvchange.py | 4 +--- test/t/test_lvcreate.py | 4 +--- test/t/test_lvdisplay.py | 2 +- test/t/test_lvextend.py | 4 +--- test/t/test_lvmdiskscan.py | 2 +- test/t/test_lvreduce.py | 4 +--- test/t/test_lvremove.py | 4 +--- test/t/test_lvrename.py | 4 +--- test/t/test_lvresize.py | 4 +--- test/t/test_lvs.py | 2 +- test/t/test_lvscan.py | 2 +- test/t/test_m4.py | 2 +- test/t/test_makepkg.py | 2 +- test/t/test_modinfo.py | 2 +- test/t/test_modprobe.py | 2 +- test/t/test_mr.py | 14 +++++++------- test/t/test_postconf.py | 2 +- test/t/test_psql.py | 2 +- test/t/test_pvchange.py | 4 +--- test/t/test_pvcreate.py | 4 +--- test/t/test_pvdisplay.py | 2 +- test/t/test_pvremove.py | 4 +--- test/t/test_pvs.py | 2 +- test/t/test_scrub.py | 2 +- test/t/test_sed.py | 2 +- test/t/test_split.py | 2 +- test/t/test_synclient.py | 2 +- test/t/test_sysctl.py | 2 +- test/t/test_tail.py | 2 +- test/t/test_touch.py | 2 +- test/t/test_tr.py | 2 +- test/t/test_uname.py | 2 +- test/t/test_unexpand.py | 4 +--- test/t/test_uniq.py | 2 +- test/t/test_units.py | 2 +- test/t/test_vgcfgbackup.py | 2 +- test/t/test_vgcfgrestore.py | 2 +- test/t/test_vgck.py | 2 +- test/t/test_vgconvert.py | 2 +- test/t/test_vgdisplay.py | 2 +- test/t/test_vgexport.py | 2 +- test/t/test_vgextend.py | 2 +- test/t/test_vgimport.py | 2 +- test/t/test_vgmerge.py | 2 +- test/t/test_vgmknodes.py | 2 +- test/t/test_vgreduce.py | 2 +- test/t/test_vgremove.py | 2 +- test/t/test_vgrename.py | 2 +- test/t/test_vgs.py | 2 +- test/t/test_vgscan.py | 2 +- test/t/test_wc.py | 2 +- test/t/test_who.py | 2 +- 71 files changed, 94 insertions(+), 103 deletions(-) diff --git a/test/t/conftest.py b/test/t/conftest.py index f65856288e6..242c042f6fd 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -131,7 +131,7 @@ def bash(request) -> pexpect.spawn: # Run pre-test commands, early so they're usable in skipif for pre_cmd in marker.kwargs.get("pre_cmds", []): assert_bash_exec(bash, pre_cmd) - # Process skip conditions + # Process skip and xfail conditions skipif = marker.kwargs.get("skipif") if skipif: try: @@ -142,6 +142,14 @@ def bash(request) -> pexpect.spawn: bash.close() pytest.skip(skipif) return + xfail = marker.kwargs.get("xfail") + if xfail: + try: + assert_bash_exec(bash, xfail) + except AssertionError: + pass + else: + pytest.xfail(xfail) if not cmd_found: match = re.search( r"^test_(.+)\.py$", os.path.basename(str(request.fspath)) @@ -370,6 +378,14 @@ def assert_complete( else: pytest.skip(skipif) return CompletionResult("", []) + xfail = kwargs.get("xfail") + if xfail: + try: + assert_bash_exec(bash, xfail) + except AssertionError: + pass + else: + pytest.xfail(xfail) cwd = kwargs.get("cwd") if cwd: assert_bash_exec(bash, "cd '%s'" % cwd) diff --git a/test/t/test_chkconfig.py b/test/t/test_chkconfig.py index c610a5d5ba9..08e9827f58a 100644 --- a/test/t/test_chkconfig.py +++ b/test/t/test_chkconfig.py @@ -9,7 +9,7 @@ def test_1(self, completion): # systemd may not be running e.g. in a docker container, and listing # services will then fail. @pytest.mark.complete( - "chkconfig ", skipif="! systemctl list-units &>/dev/null" + "chkconfig ", xfail="! systemctl list-units &>/dev/null" ) def test_2(self, completion): assert completion diff --git a/test/t/test_chromium_browser.py b/test/t/test_chromium_browser.py index f0104bbaaf9..8ba822e59a1 100644 --- a/test/t/test_chromium_browser.py +++ b/test/t/test_chromium_browser.py @@ -8,7 +8,7 @@ def test_1(self, completion): assert completion @pytest.mark.complete( - "chromium-browser -", skipif="! chromium-browser --help &>/dev/null" + "chromium-browser -", xfail="! chromium-browser --help &>/dev/null" ) def test_2(self, completion): assert completion diff --git a/test/t/test_createdb.py b/test/t/test_createdb.py index 7e22643894e..d281dc794e0 100644 --- a/test/t/test_createdb.py +++ b/test/t/test_createdb.py @@ -4,6 +4,6 @@ class TestCreatedb: # --help can fail due to missing package dependencies, e.g. on Ubuntu 14 - @pytest.mark.complete("createdb -", skipif="! createdb --help &>/dev/null") + @pytest.mark.complete("createdb -", xfail="! createdb --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_createuser.py b/test/t/test_createuser.py index f25f10f783f..ea8d0e38b59 100644 --- a/test/t/test_createuser.py +++ b/test/t/test_createuser.py @@ -5,7 +5,7 @@ class TestCreateuser: # --help can fail due to missing package dependencies, e.g. on Ubuntu 14 @pytest.mark.complete( - "createuser -", skipif="! createuser --help &>/dev/null" + "createuser -", xfail="! createuser --help &>/dev/null" ) def test_1(self, completion): assert completion diff --git a/test/t/test_dpkg.py b/test/t/test_dpkg.py index e609ee86214..84860cf87ff 100644 --- a/test/t/test_dpkg.py +++ b/test/t/test_dpkg.py @@ -6,9 +6,7 @@ class TestDpkg: def test_1(self, completion): assert completion - @pytest.mark.complete( - "dpkg -L ", skipif='test -z "$(dpkg -l 2>/dev/null)"' - ) + @pytest.mark.complete("dpkg -L ", xfail='test -z "$(dpkg -l 2>/dev/null)"') def test_2(self, completion): assert completion diff --git a/test/t/test_dropdb.py b/test/t/test_dropdb.py index 7e0b7929d57..82e2aef6f0f 100644 --- a/test/t/test_dropdb.py +++ b/test/t/test_dropdb.py @@ -4,6 +4,6 @@ class TestDropdb: # --help can fail due to missing package dependencies, e.g. on Ubuntu 14 - @pytest.mark.complete("dropdb -", skipif="! dropdb --help &>/dev/null") + @pytest.mark.complete("dropdb -", xfail="! dropdb --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_feh.py b/test/t/test_feh.py index d4215f53d65..c0aab08759c 100644 --- a/test/t/test_feh.py +++ b/test/t/test_feh.py @@ -7,7 +7,7 @@ def test_1(self, completion): assert completion @pytest.mark.complete( - "feh --lis", skipif="feh --help 2>&1 | command grep -qF 'man feh'" + "feh --lis", xfail="feh --help 2>&1 | command grep -qF 'man feh'" ) def test_2(self, completion): assert completion diff --git a/test/t/test_flake8.py b/test/t/test_flake8.py index 9922fb8526b..52246e1e256 100644 --- a/test/t/test_flake8.py +++ b/test/t/test_flake8.py @@ -1,7 +1,7 @@ import pytest -@pytest.mark.bashcomp(skipif="! flake8 --help &>/dev/null") +@pytest.mark.bashcomp(xfail="! flake8 --help &>/dev/null") class TestFlake8: @pytest.mark.complete("flake8 ") def test_1(self, completion): diff --git a/test/t/test_fmt.py b/test/t/test_fmt.py index dc3473ba406..4de31e34bf9 100644 --- a/test/t/test_fmt.py +++ b/test/t/test_fmt.py @@ -2,6 +2,6 @@ class TestFmt: - @pytest.mark.complete("fmt -", skipif="! fmt --help &>/dev/null") + @pytest.mark.complete("fmt -", xfail="! fmt --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_fold.py b/test/t/test_fold.py index 9a8fd2aa20b..e36007c451f 100644 --- a/test/t/test_fold.py +++ b/test/t/test_fold.py @@ -2,6 +2,6 @@ class TestFold: - @pytest.mark.complete("fold --", skipif="! fold --help &>/dev/null") + @pytest.mark.complete("fold --", xfail="! fold --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_getconf.py b/test/t/test_getconf.py index 96713dbe4ce..c80c803ecd3 100644 --- a/test/t/test_getconf.py +++ b/test/t/test_getconf.py @@ -15,7 +15,7 @@ def test_3(self, completion): assert completion @pytest.mark.complete( - "getconf -v ", skipif="! getconf -a 2>&1 | command grep -q ^POSIX_V" + "getconf -v ", xfail="! getconf -a 2>&1 | command grep -q ^POSIX_V" ) def test_4(self, completion): assert completion diff --git a/test/t/test_gprof.py b/test/t/test_gprof.py index 417e09146a4..d4e8d591ad7 100644 --- a/test/t/test_gprof.py +++ b/test/t/test_gprof.py @@ -2,6 +2,6 @@ class TestGprof: - @pytest.mark.complete("gprof --", skipif="! gprof --help &>/dev/null") + @pytest.mark.complete("gprof --", xfail="! gprof --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_head.py b/test/t/test_head.py index a287034ab60..1add811cb75 100644 --- a/test/t/test_head.py +++ b/test/t/test_head.py @@ -2,6 +2,6 @@ class TestHead: - @pytest.mark.complete("head --", skipif="! head --help &>/dev/null") + @pytest.mark.complete("head --", xfail="! head --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_iconv.py b/test/t/test_iconv.py index bf18185e81f..5639cf8e210 100644 --- a/test/t/test_iconv.py +++ b/test/t/test_iconv.py @@ -2,7 +2,7 @@ class TestIconv: - @pytest.mark.complete("iconv -", skipif="! iconv --help &>/dev/null") + @pytest.mark.complete("iconv -", xfail="! iconv --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_ifstat.py b/test/t/test_ifstat.py index e4d828eeffb..7f88a642120 100644 --- a/test/t/test_ifstat.py +++ b/test/t/test_ifstat.py @@ -7,13 +7,13 @@ def test_1(self, completion): assert completion @pytest.mark.complete( - "ifstat -i ", skipif="ifstat -v | command grep -qF iproute2" + "ifstat -i ", xfail="ifstat -v | command grep -qF iproute2" ) def test_2(self, completion): assert completion @pytest.mark.complete( - "ifstat -d ", skipif="ifstat -v | command grep -qF iproute2" + "ifstat -d ", xfail="ifstat -v | command grep -qF iproute2" ) def test_3(self, completion): assert completion diff --git a/test/t/test_jq.py b/test/t/test_jq.py index c858411fc9b..47014143e10 100644 --- a/test/t/test_jq.py +++ b/test/t/test_jq.py @@ -12,8 +12,7 @@ def test_2(self, completion): @pytest.mark.complete( "jq -", - skipif="! (jq --help 2>&1 || :) | " - "command grep -qF 'options include'", + xfail="! (jq --help 2>&1 || :) | command grep -qF 'options include'", ) def test_3(self, completion): assert completion diff --git a/test/t/test_kill.py b/test/t/test_kill.py index 59d5fa2beae..9699435c04e 100644 --- a/test/t/test_kill.py +++ b/test/t/test_kill.py @@ -2,7 +2,7 @@ class TestKill: - @pytest.mark.complete("kill 1", skipif="! type ps &>/dev/null") + @pytest.mark.complete("kill 1", xfail="! type ps &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_ls.py b/test/t/test_ls.py index ed5ad9c49c9..d7132ce3710 100644 --- a/test/t/test_ls.py +++ b/test/t/test_ls.py @@ -8,7 +8,7 @@ class TestLs: - @pytest.mark.complete("ls --", skipif="! ls --help &>/dev/null") + @pytest.mark.complete("ls --", xfail="! ls --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_lvchange.py b/test/t/test_lvchange.py index 5722a581b44..aac59e8b186 100644 --- a/test/t/test_lvchange.py +++ b/test/t/test_lvchange.py @@ -2,8 +2,6 @@ class TestLvchange: - @pytest.mark.complete( - "lvchange --", skipif="! lvchange --help &>/dev/null" - ) + @pytest.mark.complete("lvchange --", xfail="! lvchange --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_lvcreate.py b/test/t/test_lvcreate.py index e60432f6bb6..a1835b42ac1 100644 --- a/test/t/test_lvcreate.py +++ b/test/t/test_lvcreate.py @@ -2,8 +2,6 @@ class TestLvcreate: - @pytest.mark.complete( - "lvcreate --", skipif="! lvcreate --help &>/dev/null" - ) + @pytest.mark.complete("lvcreate --", xfail="! lvcreate --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_lvdisplay.py b/test/t/test_lvdisplay.py index e9a955edfbb..4979a1ffa53 100644 --- a/test/t/test_lvdisplay.py +++ b/test/t/test_lvdisplay.py @@ -3,7 +3,7 @@ class TestLvdisplay: @pytest.mark.complete( - "lvdisplay --", skipif="! lvdisplay --help &>/dev/null" + "lvdisplay --", xfail="! lvdisplay --help &>/dev/null" ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvextend.py b/test/t/test_lvextend.py index 68e17848199..300ee805350 100644 --- a/test/t/test_lvextend.py +++ b/test/t/test_lvextend.py @@ -2,8 +2,6 @@ class TestLvextend: - @pytest.mark.complete( - "lvextend --", skipif="! lvextend --help &>/dev/null" - ) + @pytest.mark.complete("lvextend --", xfail="! lvextend --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_lvmdiskscan.py b/test/t/test_lvmdiskscan.py index 0716d5c49fd..81aadba93ae 100644 --- a/test/t/test_lvmdiskscan.py +++ b/test/t/test_lvmdiskscan.py @@ -3,7 +3,7 @@ class TestLvmdiskscan: @pytest.mark.complete( - "lvmdiskscan --", skipif="! lvmdiskscan --help &>/dev/null" + "lvmdiskscan --", xfail="! lvmdiskscan --help &>/dev/null" ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvreduce.py b/test/t/test_lvreduce.py index 50b038fddb7..3fe8da15128 100644 --- a/test/t/test_lvreduce.py +++ b/test/t/test_lvreduce.py @@ -2,8 +2,6 @@ class TestLvreduce: - @pytest.mark.complete( - "lvreduce --", skipif="! lvreduce --help &>/dev/null" - ) + @pytest.mark.complete("lvreduce --", xfail="! lvreduce --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_lvremove.py b/test/t/test_lvremove.py index 53950aecf80..3c6d72c42ce 100644 --- a/test/t/test_lvremove.py +++ b/test/t/test_lvremove.py @@ -2,8 +2,6 @@ class TestLvremove: - @pytest.mark.complete( - "lvremove --", skipif="! lvremove --help &>/dev/null" - ) + @pytest.mark.complete("lvremove --", xfail="! lvremove --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_lvrename.py b/test/t/test_lvrename.py index c60469f5757..897f314788e 100644 --- a/test/t/test_lvrename.py +++ b/test/t/test_lvrename.py @@ -2,8 +2,6 @@ class TestLvrename: - @pytest.mark.complete( - "lvrename --", skipif="! lvrename --help &>/dev/null" - ) + @pytest.mark.complete("lvrename --", xfail="! lvrename --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_lvresize.py b/test/t/test_lvresize.py index aecc8bf4d88..5cc5fc152e2 100644 --- a/test/t/test_lvresize.py +++ b/test/t/test_lvresize.py @@ -2,8 +2,6 @@ class TestLvresize: - @pytest.mark.complete( - "lvresize --", skipif="! lvresize --help &>/dev/null" - ) + @pytest.mark.complete("lvresize --", xfail="! lvresize --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_lvs.py b/test/t/test_lvs.py index 456368b9a84..f72be7e8b3a 100644 --- a/test/t/test_lvs.py +++ b/test/t/test_lvs.py @@ -2,6 +2,6 @@ class TestLvs: - @pytest.mark.complete("lvs --", skipif="! lvs --help &>/dev/null") + @pytest.mark.complete("lvs --", xfail="! lvs --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_lvscan.py b/test/t/test_lvscan.py index 4848fe4c1c8..c840babedfc 100644 --- a/test/t/test_lvscan.py +++ b/test/t/test_lvscan.py @@ -2,6 +2,6 @@ class TestLvscan: - @pytest.mark.complete("lvscan --", skipif="! lvscan --help &>/dev/null") + @pytest.mark.complete("lvscan --", xfail="! lvscan --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_m4.py b/test/t/test_m4.py index d80a7538965..0c32cdb694f 100644 --- a/test/t/test_m4.py +++ b/test/t/test_m4.py @@ -2,6 +2,6 @@ class TestM4: - @pytest.mark.complete("m4 --", skipif="! m4 --help &>/dev/null") + @pytest.mark.complete("m4 --", xfail="! m4 --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_makepkg.py b/test/t/test_makepkg.py index fee963148cf..6cfb943c09d 100644 --- a/test/t/test_makepkg.py +++ b/test/t/test_makepkg.py @@ -2,7 +2,7 @@ @pytest.mark.bashcomp( - skipif="! makepkg --help 2>&1 | command grep -qiF slackware" + xfail="! makepkg --help 2>&1 | command grep -qiF slackware" ) class TestMakepkg: @pytest.mark.complete("makepkg ") diff --git a/test/t/test_modinfo.py b/test/t/test_modinfo.py index 4c96eef0291..d3c78a218e6 100644 --- a/test/t/test_modinfo.py +++ b/test/t/test_modinfo.py @@ -11,7 +11,7 @@ def test_1(self, completion): # "in": intel*, ... @pytest.mark.complete( "modinfo in", - skipif="! ls /lib/modules/%s &>/dev/null" + xfail="! ls /lib/modules/%s &>/dev/null" % subprocess.check_output( "uname -r 2>/dev/null || " "echo non-existent-kernel", shell=True ) diff --git a/test/t/test_modprobe.py b/test/t/test_modprobe.py index 339240f6ffe..38d290aed55 100644 --- a/test/t/test_modprobe.py +++ b/test/t/test_modprobe.py @@ -11,7 +11,7 @@ def test_1(self, completion): # "in": intel*, ... @pytest.mark.complete( "modprobe in", - skipif="! ls /lib/modules/%s &>/dev/null" + xfail="! ls /lib/modules/%s &>/dev/null" % subprocess.check_output( "uname -r 2>/dev/null || " "echo non-existent-kernel", shell=True ) diff --git a/test/t/test_mr.py b/test/t/test_mr.py index ab45350bc46..2f9a504b037 100644 --- a/test/t/test_mr.py +++ b/test/t/test_mr.py @@ -9,35 +9,35 @@ def test_1(self, completion): # man -h tests below: Some mr versions require man to be around in order # to provide useful output. - @pytest.mark.complete("mr --", skipif="! man -h &>/dev/null") + @pytest.mark.complete("mr --", xfail="! man -h &>/dev/null") def test_2(self, completion): assert completion @pytest.mark.complete( - "mr -c shared/default/foo.d/", skipif="! man -h &>/dev/null" + "mr -c shared/default/foo.d/", xfail="! man -h &>/dev/null" ) def test_3(self, completion): assert completion == "shared/default/foo.d/foo" @pytest.mark.complete( - "mr bootstrap shared/default/", skipif="! man -h &>/dev/null" + "mr bootstrap shared/default/", xfail="! man -h &>/dev/null" ) def test_4(self, completion): assert completion == ["bar", "bar bar.d/", "foo", "foo.d/"] @pytest.mark.xfail # "clean" doesn't exist before mr 1.20141023 - @pytest.mark.complete("mr clean -", skipif="! man -h &>/dev/null") + @pytest.mark.complete("mr clean -", xfail="! man -h &>/dev/null") def test_5(self, completion): assert completion == "-f" - @pytest.mark.complete("mr commit -", skipif="! man -h &>/dev/null") + @pytest.mark.complete("mr commit -", xfail="! man -h &>/dev/null") def test_6(self, completion): assert completion == "-m" - @pytest.mark.complete("mr status ", skipif="! man -h &>/dev/null") + @pytest.mark.complete("mr status ", xfail="! man -h &>/dev/null") def test_7(self, completion): assert not completion - @pytest.mark.complete("mr run ", skipif="! man -h &>/dev/null") + @pytest.mark.complete("mr run ", xfail="! man -h &>/dev/null") def test_8(self, completion): assert completion diff --git a/test/t/test_postconf.py b/test/t/test_postconf.py index 641b27340dd..172285f1114 100644 --- a/test/t/test_postconf.py +++ b/test/t/test_postconf.py @@ -13,6 +13,6 @@ def test_1(self, completion): # for ::1 # ...and output can be cut off somewhere near lmtp_tls_secur*. # ...or be completely missing, so all we can do is to skip. - @pytest.mark.complete("postconf al", skipif="! postconf &>/dev/null") + @pytest.mark.complete("postconf al", xfail="! postconf &>/dev/null") def test_2(self, completion): assert completion diff --git a/test/t/test_psql.py b/test/t/test_psql.py index 60ed097c8d7..8f447236fb8 100644 --- a/test/t/test_psql.py +++ b/test/t/test_psql.py @@ -4,6 +4,6 @@ class TestPsql: # --help can fail due to missing package dependencies, e.g. on Ubuntu 14 - @pytest.mark.complete("psql -", skipif="! psql --help &>/dev/null") + @pytest.mark.complete("psql -", xfail="! psql --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_pvchange.py b/test/t/test_pvchange.py index 78e534ac720..f9f7dfff840 100644 --- a/test/t/test_pvchange.py +++ b/test/t/test_pvchange.py @@ -2,8 +2,6 @@ class TestPvchange: - @pytest.mark.complete( - "pvchange --", skipif="! pvchange --help &>/dev/null" - ) + @pytest.mark.complete("pvchange --", xfail="! pvchange --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_pvcreate.py b/test/t/test_pvcreate.py index 372b9e39cdf..b3f39d34790 100644 --- a/test/t/test_pvcreate.py +++ b/test/t/test_pvcreate.py @@ -2,8 +2,6 @@ class TestPvcreate: - @pytest.mark.complete( - "pvcreate --", skipif="! pvcreate --help &>/dev/null" - ) + @pytest.mark.complete("pvcreate --", xfail="! pvcreate --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_pvdisplay.py b/test/t/test_pvdisplay.py index e5fa07f62a5..fccd92126ca 100644 --- a/test/t/test_pvdisplay.py +++ b/test/t/test_pvdisplay.py @@ -3,7 +3,7 @@ class TestPvdisplay: @pytest.mark.complete( - "pvdisplay --", skipif="! pvdisplay --help &>/dev/null" + "pvdisplay --", xfail="! pvdisplay --help &>/dev/null" ) def test_1(self, completion): assert completion diff --git a/test/t/test_pvremove.py b/test/t/test_pvremove.py index 08bf63b0070..bf3274f3652 100644 --- a/test/t/test_pvremove.py +++ b/test/t/test_pvremove.py @@ -2,8 +2,6 @@ class TestPvremove: - @pytest.mark.complete( - "pvremove --", skipif="! pvremove --help &>/dev/null" - ) + @pytest.mark.complete("pvremove --", xfail="! pvremove --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_pvs.py b/test/t/test_pvs.py index 6063888e587..0df61fbc10f 100644 --- a/test/t/test_pvs.py +++ b/test/t/test_pvs.py @@ -2,6 +2,6 @@ class TestPvs: - @pytest.mark.complete("pvs --", skipif="! pvs --help &>/dev/null") + @pytest.mark.complete("pvs --", xfail="! pvs --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_scrub.py b/test/t/test_scrub.py index 0a521fafd5e..cedcc061ed9 100644 --- a/test/t/test_scrub.py +++ b/test/t/test_scrub.py @@ -13,7 +13,7 @@ def test_2(self, completion): # Not all scrub versions list available patterns in --help output @pytest.mark.complete( "scrub -p ", - skipif="! (scrub --help 2>&1 || :) | " "command grep -q ^Available", + xfail="! (scrub --help 2>&1 || :) | command grep -q ^Available", ) def test_3(self, completion): assert completion diff --git a/test/t/test_sed.py b/test/t/test_sed.py index 3fc0559ffdc..1dbade164ad 100644 --- a/test/t/test_sed.py +++ b/test/t/test_sed.py @@ -2,6 +2,6 @@ class TestSed: - @pytest.mark.complete("sed --", skipif="! sed --help &>/dev/null") + @pytest.mark.complete("sed --", xfail="! sed --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_split.py b/test/t/test_split.py index 79013663f1d..955ff0fd63c 100644 --- a/test/t/test_split.py +++ b/test/t/test_split.py @@ -2,6 +2,6 @@ class TestSplit: - @pytest.mark.complete("split --", skipif="! split --help &>/dev/null") + @pytest.mark.complete("split --", xfail="! split --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_synclient.py b/test/t/test_synclient.py index 23138294be1..28780a5c868 100644 --- a/test/t/test_synclient.py +++ b/test/t/test_synclient.py @@ -5,7 +5,7 @@ class TestSynclient: # synclient -l may error out with e.g. # "Couldn't find synaptics properties. No synaptics driver loaded?" - @pytest.mark.complete("synclient ", skipif="! synclient -l &>/dev/null") + @pytest.mark.complete("synclient ", xfail="! synclient -l &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_sysctl.py b/test/t/test_sysctl.py index 773b59107f2..e666c4c044e 100644 --- a/test/t/test_sysctl.py +++ b/test/t/test_sysctl.py @@ -8,7 +8,7 @@ def test_1(self, completion): @pytest.mark.complete( "sysctl kern", - skipif="! sysctl -N -a 2>/dev/null | " "command grep -q ^kern", + xfail="! sysctl -N -a 2>/dev/null | command grep -q ^kern", ) def test_2(self, completion): assert completion diff --git a/test/t/test_tail.py b/test/t/test_tail.py index 1b818f7d7a4..c9bbf0fd2b6 100644 --- a/test/t/test_tail.py +++ b/test/t/test_tail.py @@ -2,6 +2,6 @@ class TestTail: - @pytest.mark.complete("tail --", skipif="! tail --help &>/dev/null") + @pytest.mark.complete("tail --", xfail="! tail --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_touch.py b/test/t/test_touch.py index cc398d81f51..487fd923b42 100644 --- a/test/t/test_touch.py +++ b/test/t/test_touch.py @@ -2,6 +2,6 @@ class TestTouch: - @pytest.mark.complete("touch --", skipif="! touch --help &>/dev/null") + @pytest.mark.complete("touch --", xfail="! touch --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_tr.py b/test/t/test_tr.py index 845970126b5..193e34a6a58 100644 --- a/test/t/test_tr.py +++ b/test/t/test_tr.py @@ -2,6 +2,6 @@ class TestTr: - @pytest.mark.complete("tr --", skipif="! tr --help &>/dev/null") + @pytest.mark.complete("tr --", xfail="! tr --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_uname.py b/test/t/test_uname.py index 743f317c620..3a9075343ba 100644 --- a/test/t/test_uname.py +++ b/test/t/test_uname.py @@ -2,6 +2,6 @@ class TestUname: - @pytest.mark.complete("uname --", skipif="! uname --help &>/dev/null") + @pytest.mark.complete("uname --", xfail="! uname --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_unexpand.py b/test/t/test_unexpand.py index 6b77b3bbf15..fa4bc8cc998 100644 --- a/test/t/test_unexpand.py +++ b/test/t/test_unexpand.py @@ -2,8 +2,6 @@ class TestUnexpand: - @pytest.mark.complete( - "unexpand --", skipif="! unexpand --help &>/dev/null" - ) + @pytest.mark.complete("unexpand --", xfail="! unexpand --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_uniq.py b/test/t/test_uniq.py index 8647c615f66..1bcc46ae1cd 100644 --- a/test/t/test_uniq.py +++ b/test/t/test_uniq.py @@ -2,6 +2,6 @@ class TestUniq: - @pytest.mark.complete("uniq --", skipif="! uniq --help &>/dev/null") + @pytest.mark.complete("uniq --", xfail="! uniq --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_units.py b/test/t/test_units.py index aa1f89c821a..fbdd6595e7b 100644 --- a/test/t/test_units.py +++ b/test/t/test_units.py @@ -2,6 +2,6 @@ class TestUnits: - @pytest.mark.complete("units --", skipif="! units --help &>/dev/null") + @pytest.mark.complete("units --", xfail="! units --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgcfgbackup.py b/test/t/test_vgcfgbackup.py index 20ef09cc4e1..7d6705a3a5f 100644 --- a/test/t/test_vgcfgbackup.py +++ b/test/t/test_vgcfgbackup.py @@ -3,7 +3,7 @@ class TestVgcfgbackup: @pytest.mark.complete( - "vgcfgbackup -", skipif="! vgcfgbackup --help &>/dev/null" + "vgcfgbackup -", xfail="! vgcfgbackup --help &>/dev/null" ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgcfgrestore.py b/test/t/test_vgcfgrestore.py index 260965556d7..c7686ecfa55 100644 --- a/test/t/test_vgcfgrestore.py +++ b/test/t/test_vgcfgrestore.py @@ -3,7 +3,7 @@ class TestVgcfgrestore: @pytest.mark.complete( - "vgcfgrestore -", skipif="! vgcfgrestore --help &>/dev/null" + "vgcfgrestore -", xfail="! vgcfgrestore --help &>/dev/null" ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgck.py b/test/t/test_vgck.py index 347f8f9b3a0..f231673569f 100644 --- a/test/t/test_vgck.py +++ b/test/t/test_vgck.py @@ -2,6 +2,6 @@ class TestVgck: - @pytest.mark.complete("vgck -", skipif="! vgck --help &>/dev/null") + @pytest.mark.complete("vgck -", xfail="! vgck --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgconvert.py b/test/t/test_vgconvert.py index 9810bc2fd19..7a39d70bae3 100644 --- a/test/t/test_vgconvert.py +++ b/test/t/test_vgconvert.py @@ -3,7 +3,7 @@ class TestVgconvert: @pytest.mark.complete( - "vgconvert -", skipif="! vgconvert --help &>/dev/null" + "vgconvert -", xfail="! vgconvert --help &>/dev/null" ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgdisplay.py b/test/t/test_vgdisplay.py index a6919a6c66a..f1b01fec110 100644 --- a/test/t/test_vgdisplay.py +++ b/test/t/test_vgdisplay.py @@ -3,7 +3,7 @@ class TestVgdisplay: @pytest.mark.complete( - "vgdisplay -", skipif="! vgdisplay --help &>/dev/null" + "vgdisplay -", xfail="! vgdisplay --help &>/dev/null" ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgexport.py b/test/t/test_vgexport.py index ce9a93bf85c..97d4ee4a175 100644 --- a/test/t/test_vgexport.py +++ b/test/t/test_vgexport.py @@ -2,6 +2,6 @@ class TestVgexport: - @pytest.mark.complete("vgexport -", skipif="! vgexport --help &>/dev/null") + @pytest.mark.complete("vgexport -", xfail="! vgexport --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgextend.py b/test/t/test_vgextend.py index 3d3347f10a7..b0cde6f1703 100644 --- a/test/t/test_vgextend.py +++ b/test/t/test_vgextend.py @@ -2,6 +2,6 @@ class TestVgextend: - @pytest.mark.complete("vgextend -", skipif="! vgextend --help &>/dev/null") + @pytest.mark.complete("vgextend -", xfail="! vgextend --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgimport.py b/test/t/test_vgimport.py index 1a3efab0f70..151684f5f15 100644 --- a/test/t/test_vgimport.py +++ b/test/t/test_vgimport.py @@ -2,6 +2,6 @@ class TestVgimport: - @pytest.mark.complete("vgimport -", skipif="! vgimport --help &>/dev/null") + @pytest.mark.complete("vgimport -", xfail="! vgimport --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgmerge.py b/test/t/test_vgmerge.py index 971eb69a244..94fa69cde35 100644 --- a/test/t/test_vgmerge.py +++ b/test/t/test_vgmerge.py @@ -2,6 +2,6 @@ class TestVgmerge: - @pytest.mark.complete("vgmerge -", skipif="! vgmerge --help &>/dev/null") + @pytest.mark.complete("vgmerge -", xfail="! vgmerge --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgmknodes.py b/test/t/test_vgmknodes.py index 3209de9f51b..ae308894f19 100644 --- a/test/t/test_vgmknodes.py +++ b/test/t/test_vgmknodes.py @@ -3,7 +3,7 @@ class TestVgmknodes: @pytest.mark.complete( - "vgmknodes -", skipif="! vgmknodes --help &>/dev/null" + "vgmknodes -", xfail="! vgmknodes --help &>/dev/null" ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgreduce.py b/test/t/test_vgreduce.py index 97641b420d1..4aab62c3964 100644 --- a/test/t/test_vgreduce.py +++ b/test/t/test_vgreduce.py @@ -2,6 +2,6 @@ class TestVgreduce: - @pytest.mark.complete("vgreduce -", skipif="! vgreduce --help &>/dev/null") + @pytest.mark.complete("vgreduce -", xfail="! vgreduce --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgremove.py b/test/t/test_vgremove.py index 9c47752c69c..2801ef6a9db 100644 --- a/test/t/test_vgremove.py +++ b/test/t/test_vgremove.py @@ -2,6 +2,6 @@ class TestVgremove: - @pytest.mark.complete("vgremove -", skipif="! vgremove --help &>/dev/null") + @pytest.mark.complete("vgremove -", xfail="! vgremove --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgrename.py b/test/t/test_vgrename.py index ea5bc0507c1..9010c49fc72 100644 --- a/test/t/test_vgrename.py +++ b/test/t/test_vgrename.py @@ -2,6 +2,6 @@ class TestVgrename: - @pytest.mark.complete("vgrename -", skipif="! vgrename --help &>/dev/null") + @pytest.mark.complete("vgrename -", xfail="! vgrename --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgs.py b/test/t/test_vgs.py index d492fe8dc81..8c470d331d6 100644 --- a/test/t/test_vgs.py +++ b/test/t/test_vgs.py @@ -2,6 +2,6 @@ class TestVgs: - @pytest.mark.complete("vgs -", skipif="! vgs --help &>/dev/null") + @pytest.mark.complete("vgs -", xfail="! vgs --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgscan.py b/test/t/test_vgscan.py index 061ff4e2ba2..f4060e9a763 100644 --- a/test/t/test_vgscan.py +++ b/test/t/test_vgscan.py @@ -2,6 +2,6 @@ class TestVgscan: - @pytest.mark.complete("vgscan -", skipif="! vgscan --help &>/dev/null") + @pytest.mark.complete("vgscan -", xfail="! vgscan --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_wc.py b/test/t/test_wc.py index eb7b5a855e6..e87c031b40e 100644 --- a/test/t/test_wc.py +++ b/test/t/test_wc.py @@ -2,6 +2,6 @@ class TestWc: - @pytest.mark.complete("wc --", skipif="! wc --help &>/dev/null") + @pytest.mark.complete("wc --", xfail="! wc --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_who.py b/test/t/test_who.py index d1f29ea77d0..1a2ad69334b 100644 --- a/test/t/test_who.py +++ b/test/t/test_who.py @@ -2,6 +2,6 @@ class TestWho: - @pytest.mark.complete("who --", skipif="! who --help &>/dev/null") + @pytest.mark.complete("who --", xfail="! who --help &>/dev/null") def test_1(self, completion): assert completion From 0a777ff73bf5ddbd5de92f2bf1e3f8429e471f72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 1 May 2019 17:34:40 +0300 Subject: [PATCH 0177/1094] test: expect failures for various completions without useful --help busybox doesn't fail to --help calls, but outputs the usage message to stderr, and doesn't tend to have any long options implemented. Check nonzero exit statuses and xfail also on those separately, in case some other implementation (rightfully) echoes --help to stderr as an unrecognized option. --- test/t/test_dd.py | 8 +++++++- test/t/test_env.py | 8 +++++++- test/t/test_expand.py | 8 +++++++- test/t/test_fold.py | 8 +++++++- test/t/test_grep.py | 8 +++++++- test/t/test_head.py | 8 +++++++- test/t/test_less.py | 8 +++++++- test/t/test_nproc.py | 8 +++++++- test/t/test_sed.py | 8 +++++++- test/t/test_seq.py | 8 +++++++- test/t/test_sha1sum.py | 8 +++++++- test/t/test_sort.py | 8 +++++++- test/t/test_split.py | 8 +++++++- test/t/test_tac.py | 8 +++++++- test/t/test_tail.py | 8 +++++++- test/t/test_touch.py | 8 +++++++- test/t/test_tr.py | 8 +++++++- test/t/test_uname.py | 8 +++++++- test/t/test_unexpand.py | 8 +++++++- test/t/test_uniq.py | 8 +++++++- test/t/test_wc.py | 8 +++++++- 21 files changed, 147 insertions(+), 21 deletions(-) diff --git a/test/t/test_dd.py b/test/t/test_dd.py index 616f4d4aff9..be1829d33f5 100644 --- a/test/t/test_dd.py +++ b/test/t/test_dd.py @@ -2,7 +2,13 @@ class TestDd: - @pytest.mark.complete("dd --") + @pytest.mark.complete( + "dd --", + xfail=( + "! dd --help &>/dev/null || " + "! dd --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_env.py b/test/t/test_env.py index 57ed9769b65..431cc36fff8 100644 --- a/test/t/test_env.py +++ b/test/t/test_env.py @@ -2,6 +2,12 @@ class TestEnv: - @pytest.mark.complete("env --", skipif="! env --help &>/dev/null") + @pytest.mark.complete( + "env --", + xfail=( + "! env --help &>/dev/null || " + "! env --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_expand.py b/test/t/test_expand.py index 004c018b6b4..d93f66cd026 100644 --- a/test/t/test_expand.py +++ b/test/t/test_expand.py @@ -2,6 +2,12 @@ class TestExpand: - @pytest.mark.complete("expand --", skipif="! expand --help &>/dev/null") + @pytest.mark.complete( + "expand --", + xfail=( + "! expand --help &>/dev/null || " + "! expand --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_fold.py b/test/t/test_fold.py index e36007c451f..fffaef9a571 100644 --- a/test/t/test_fold.py +++ b/test/t/test_fold.py @@ -2,6 +2,12 @@ class TestFold: - @pytest.mark.complete("fold --", xfail="! fold --help &>/dev/null") + @pytest.mark.complete( + "fold --", + xfail=( + "! fold --help &>/dev/null || " + "! fold --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_grep.py b/test/t/test_grep.py index d7d742ec154..42da802ea18 100644 --- a/test/t/test_grep.py +++ b/test/t/test_grep.py @@ -2,7 +2,13 @@ class TestGrep: - @pytest.mark.complete("grep --") + @pytest.mark.complete( + "grep --", + xfail=( + "! grep --help &>/dev/null || " + "! grep --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_head.py b/test/t/test_head.py index 1add811cb75..cf9e990e445 100644 --- a/test/t/test_head.py +++ b/test/t/test_head.py @@ -2,6 +2,12 @@ class TestHead: - @pytest.mark.complete("head --", xfail="! head --help &>/dev/null") + @pytest.mark.complete( + "head --", + xfail=( + "! head --help &>/dev/null || " + "! head --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_less.py b/test/t/test_less.py index 79cdf183788..7d89a759dd1 100644 --- a/test/t/test_less.py +++ b/test/t/test_less.py @@ -2,6 +2,12 @@ class TestLess: - @pytest.mark.complete("less --") + @pytest.mark.complete( + "less --", + xfail=( + "! less --help &>/dev/null || " + "! less --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_nproc.py b/test/t/test_nproc.py index 6ab8017c9c2..66a49acba62 100644 --- a/test/t/test_nproc.py +++ b/test/t/test_nproc.py @@ -6,6 +6,12 @@ class TestNproc: def test_1(self, completion): assert not completion - @pytest.mark.complete("nproc -") + @pytest.mark.complete( + "nproc --", + xfail=( + "! nproc --help &>/dev/null || " + "! nproc --help 2>&1 | command grep -qF -- --help" + ), + ) def test_2(self, completion): assert completion diff --git a/test/t/test_sed.py b/test/t/test_sed.py index 1dbade164ad..cb120f69c11 100644 --- a/test/t/test_sed.py +++ b/test/t/test_sed.py @@ -2,6 +2,12 @@ class TestSed: - @pytest.mark.complete("sed --", xfail="! sed --help &>/dev/null") + @pytest.mark.complete( + "sed --", + xfail=( + "! sed --help &>/dev/null || " + "! sed --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_seq.py b/test/t/test_seq.py index 9658045040d..617c910d107 100644 --- a/test/t/test_seq.py +++ b/test/t/test_seq.py @@ -2,6 +2,12 @@ class TestSeq: - @pytest.mark.complete("seq --") + @pytest.mark.complete( + "seq --", + xfail=( + "! seq --help &>/dev/null || " + "! seq --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_sha1sum.py b/test/t/test_sha1sum.py index efe8dfec198..404fc386fb2 100644 --- a/test/t/test_sha1sum.py +++ b/test/t/test_sha1sum.py @@ -2,6 +2,12 @@ class TestSha1sum: - @pytest.mark.complete("sha1sum --") + @pytest.mark.complete( + "sha1sum --", + xfail=( + "! sha1sum --help &>/dev/null || " + "! sha1sum --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_sort.py b/test/t/test_sort.py index 7dbb5b9d914..556a20bcaae 100644 --- a/test/t/test_sort.py +++ b/test/t/test_sort.py @@ -2,6 +2,12 @@ class TestSort: - @pytest.mark.complete("sort --") + @pytest.mark.complete( + "sort --", + xfail=( + "! sort --help &>/dev/null || " + "! sort --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_split.py b/test/t/test_split.py index 955ff0fd63c..bffa2e9caea 100644 --- a/test/t/test_split.py +++ b/test/t/test_split.py @@ -2,6 +2,12 @@ class TestSplit: - @pytest.mark.complete("split --", xfail="! split --help &>/dev/null") + @pytest.mark.complete( + "split --", + xfail=( + "! split --help &>/dev/null || " + "! split --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_tac.py b/test/t/test_tac.py index f612cc907d5..43100978ac0 100644 --- a/test/t/test_tac.py +++ b/test/t/test_tac.py @@ -2,6 +2,12 @@ class TestTac: - @pytest.mark.complete("tac --") + @pytest.mark.complete( + "tac --", + xfail=( + "! tac --help &>/dev/null || " + "! tac --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_tail.py b/test/t/test_tail.py index c9bbf0fd2b6..bc75624284d 100644 --- a/test/t/test_tail.py +++ b/test/t/test_tail.py @@ -2,6 +2,12 @@ class TestTail: - @pytest.mark.complete("tail --", xfail="! tail --help &>/dev/null") + @pytest.mark.complete( + "tail --", + xfail=( + "! tail --help &>/dev/null || " + "! tail --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_touch.py b/test/t/test_touch.py index 487fd923b42..83c889cdcbf 100644 --- a/test/t/test_touch.py +++ b/test/t/test_touch.py @@ -2,6 +2,12 @@ class TestTouch: - @pytest.mark.complete("touch --", xfail="! touch --help &>/dev/null") + @pytest.mark.complete( + "touch --", + xfail=( + "! touch --help &>/dev/null || " + "! touch --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_tr.py b/test/t/test_tr.py index 193e34a6a58..adbff48cad5 100644 --- a/test/t/test_tr.py +++ b/test/t/test_tr.py @@ -2,6 +2,12 @@ class TestTr: - @pytest.mark.complete("tr --", xfail="! tr --help &>/dev/null") + @pytest.mark.complete( + "tr --", + xfail=( + "! tr --help &>/dev/null || " + "! tr --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_uname.py b/test/t/test_uname.py index 3a9075343ba..8c7a797b12d 100644 --- a/test/t/test_uname.py +++ b/test/t/test_uname.py @@ -2,6 +2,12 @@ class TestUname: - @pytest.mark.complete("uname --", xfail="! uname --help &>/dev/null") + @pytest.mark.complete( + "uname --", + xfail=( + "! uname --help &>/dev/null || " + "! uname --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_unexpand.py b/test/t/test_unexpand.py index fa4bc8cc998..701f8d54b09 100644 --- a/test/t/test_unexpand.py +++ b/test/t/test_unexpand.py @@ -2,6 +2,12 @@ class TestUnexpand: - @pytest.mark.complete("unexpand --", xfail="! unexpand --help &>/dev/null") + @pytest.mark.complete( + "unexpand --", + xfail=( + "! unexpand --help &>/dev/null || " + "! unexpand --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_uniq.py b/test/t/test_uniq.py index 1bcc46ae1cd..22286da7eaf 100644 --- a/test/t/test_uniq.py +++ b/test/t/test_uniq.py @@ -2,6 +2,12 @@ class TestUniq: - @pytest.mark.complete("uniq --", xfail="! uniq --help &>/dev/null") + @pytest.mark.complete( + "uniq --", + xfail=( + "! uniq --help &>/dev/null || " + "! uniq --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion diff --git a/test/t/test_wc.py b/test/t/test_wc.py index e87c031b40e..904c2494c8c 100644 --- a/test/t/test_wc.py +++ b/test/t/test_wc.py @@ -2,6 +2,12 @@ class TestWc: - @pytest.mark.complete("wc --", xfail="! wc --help &>/dev/null") + @pytest.mark.complete( + "wc --", + xfail=( + "! wc --help &>/dev/null || " + "! wc --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion From e717ce4503ab646055cd6b88d4087c162a529137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 1 May 2019 18:28:29 +0300 Subject: [PATCH 0178/1094] test_lsusb: xfail with unparseable --help --- test/t/test_lsusb.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/t/test_lsusb.py b/test/t/test_lsusb.py index 9c546d3259e..c68d046b3d5 100644 --- a/test/t/test_lsusb.py +++ b/test/t/test_lsusb.py @@ -2,6 +2,9 @@ class TestLsusb: - @pytest.mark.complete("lsusb -") + @pytest.mark.complete( + "lsusb -", + xfail="! (lsusb --help 2>&1 || :) | command grep -qF -- --help", + ) def test_1(self, completion): assert completion From ddd4b396b9a29c25715f6b2b768737b0b015c6c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 1 May 2019 18:37:52 +0300 Subject: [PATCH 0179/1094] test_wget: test --s instead of --h busybox wget lists --spider as its only long option in --help. --- test/t/test_wget.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/t/test_wget.py b/test/t/test_wget.py index f8af4fb37a7..297434605b3 100644 --- a/test/t/test_wget.py +++ b/test/t/test_wget.py @@ -6,6 +6,6 @@ class TestWget: def test_1(self, completion): assert not completion - @pytest.mark.complete("wget --h") + @pytest.mark.complete("wget --s") def test_2(self, completion): assert completion From 7683eefe974d7c508c7a7c3e2aa8f318f30c2699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 1 May 2019 18:45:00 +0300 Subject: [PATCH 0180/1094] timeout: fallback to _parse_usage from _parse_help --- completions/timeout | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/completions/timeout b/completions/timeout index b5851baae0f..bcc9a865950 100644 --- a/completions/timeout +++ b/completions/timeout @@ -29,7 +29,8 @@ _timeout() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) + local opts=$(_parse_help "$1") + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && From 071dc199c1413146d485ee28bfa6c9a189c3681b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 1 May 2019 18:46:47 +0300 Subject: [PATCH 0181/1094] test_ifup: accept short option completions too --- test/t/test_ifup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/t/test_ifup.py b/test/t/test_ifup.py index 60391e478b2..65767dd7603 100644 --- a/test/t/test_ifup.py +++ b/test/t/test_ifup.py @@ -9,7 +9,7 @@ class TestIfup: def test_1(self, completion): assert completion - @pytest.mark.complete("ifup --", skipif="! ifup --help &>/dev/null") + @pytest.mark.complete("ifup -", skipif="! ifup --help &>/dev/null") def test_2(self, completion): assert completion From 495dab2d80001aeabfe6136bd046a0231ff5d115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 2 May 2019 16:49:28 +0300 Subject: [PATCH 0182/1094] test: use one Dockerfile for all dists --- .travis.yml | 3 ++- test/docker/Dockerfile | 6 ++++++ test/docker/Dockerfile-alpine | 5 ----- test/docker/Dockerfile-centos6 | 11 ----------- test/docker/Dockerfile-fedoradev | 11 ----------- test/docker/Dockerfile-tools | 3 --- test/docker/Dockerfile-ubuntu14 | 13 ------------- 7 files changed, 8 insertions(+), 44 deletions(-) create mode 100644 test/docker/Dockerfile delete mode 100644 test/docker/Dockerfile-alpine delete mode 100644 test/docker/Dockerfile-centos6 delete mode 100644 test/docker/Dockerfile-fedoradev delete mode 100644 test/docker/Dockerfile-tools delete mode 100644 test/docker/Dockerfile-ubuntu14 diff --git a/.travis.yml b/.travis.yml index 299abfe2d2a..940990b9384 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,8 @@ matrix: - env: DIST=alpine before_install: - - docker build -t bash-completion:$DIST -f test/docker/Dockerfile-$DIST . + - docker build + --build-arg DIST=$DIST -t bash-completion:$DIST -f test/docker/Dockerfile . script: - docker run --name bash-completion diff --git a/test/docker/Dockerfile b/test/docker/Dockerfile new file mode 100644 index 00000000000..37cf8e81885 --- /dev/null +++ b/test/docker/Dockerfile @@ -0,0 +1,6 @@ +ARG DIST +FROM vskytta/bash-completion:$DIST + +WORKDIR /work +COPY . . +CMD ["bash"] diff --git a/test/docker/Dockerfile-alpine b/test/docker/Dockerfile-alpine deleted file mode 100644 index 5ed23afae4e..00000000000 --- a/test/docker/Dockerfile-alpine +++ /dev/null @@ -1,5 +0,0 @@ -FROM vskytta/bash-completion:alpine - -WORKDIR /work -COPY . . -CMD ["bash"] diff --git a/test/docker/Dockerfile-centos6 b/test/docker/Dockerfile-centos6 deleted file mode 100644 index 6f886ffa20e..00000000000 --- a/test/docker/Dockerfile-centos6 +++ /dev/null @@ -1,11 +0,0 @@ -FROM vskytta/bash-completion:centos6 - -# When adding new completions, install packages desired for their testing here -# in case they're not in the base image, and remove later when the base image -# has caught up. -#RUN yum -y install \ -# some-package - -WORKDIR /work -COPY . . -CMD ["bash"] diff --git a/test/docker/Dockerfile-fedoradev b/test/docker/Dockerfile-fedoradev deleted file mode 100644 index 8c4f86d7db9..00000000000 --- a/test/docker/Dockerfile-fedoradev +++ /dev/null @@ -1,11 +0,0 @@ -FROM vskytta/bash-completion:fedoradev - -# When adding new completions, install packages desired for their testing here -# in case they're not in the base image, and remove later when the base image -# has caught up. -#RUN dnf --nogpgcheck --refresh -y install \ -# some-package - -WORKDIR /work -COPY . . -CMD ["bash"] diff --git a/test/docker/Dockerfile-tools b/test/docker/Dockerfile-tools deleted file mode 100644 index 2328808ef55..00000000000 --- a/test/docker/Dockerfile-tools +++ /dev/null @@ -1,3 +0,0 @@ -FROM vskytta/bash-completion:tools - -COPY . . diff --git a/test/docker/Dockerfile-ubuntu14 b/test/docker/Dockerfile-ubuntu14 deleted file mode 100644 index a1086addb20..00000000000 --- a/test/docker/Dockerfile-ubuntu14 +++ /dev/null @@ -1,13 +0,0 @@ -FROM vskytta/bash-completion:ubuntu14 - -# When adding new completions, install packages desired for their testing here -# in case they're not in the base image, and remove later when the base image -# has caught up. -#RUN apt-get update \ -# && \ -# DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ -# some-package - -WORKDIR /work -COPY . . -CMD ["bash"] From a59f00aeb2efa0decb3767e99c2445890a340d35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 2 May 2019 16:51:28 +0300 Subject: [PATCH 0183/1094] test: run our docker script in test containers by default --- .travis.yml | 2 +- test/docker/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 940990b9384..a79873cc492 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,7 @@ script: - docker run --name bash-completion -e CI=true -e DIST=$DIST -e BSD=$BSD ${NETWORK:+--network $NETWORK} - -t bash-completion:$DIST test/docker/docker-script.sh + -t bash-completion:$DIST - if test $DIST = tools; then test/run-shellcheck -f gcc bash_completion completions/!(Makefile*); test/run-shellcheck -f gcc -s sh bash_completion.sh.in; diff --git a/test/docker/Dockerfile b/test/docker/Dockerfile index 37cf8e81885..200f9182876 100644 --- a/test/docker/Dockerfile +++ b/test/docker/Dockerfile @@ -3,4 +3,4 @@ FROM vskytta/bash-completion:$DIST WORKDIR /work COPY . . -CMD ["bash"] +CMD ["test/docker/docker-script.sh"] From 5443c819622495fcdc759d5dd4e5c31633eab389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 2 May 2019 16:57:25 +0300 Subject: [PATCH 0184/1094] _pnames: adapt for busybox ps, rewrite in pure bash Closes https://github.com/scop/bash-completion/issues/318 --- bash_completion | 51 ++++++++++++++++++++++++++++++------------ test/t/test_killall.py | 4 ++++ 2 files changed, 41 insertions(+), 14 deletions(-) diff --git a/bash_completion b/bash_completion index 58987a7fc1e..bf7d02c7531 100644 --- a/bash_completion +++ b/bash_completion @@ -1069,23 +1069,46 @@ _pnames() } || _pnames() { + local -a procs if [[ "$1" == -s ]]; then - COMPREPLY=( $(compgen -X '' \ - -W '$(command ps axo comm | command sed -e 1d)' -- "$cur") ) + procs=( $(command ps axo comm | command sed -e 1d) ) else - # FIXME: completes "[kblockd/0]" to "0". Previously it was completed - # to "kblockd" which isn't correct either. "kblockd/0" would be - # arguably most correct, but killall from psmisc 22 treats arguments - # containing "/" specially unless -r is given so that wouldn't quite - # work either. Perhaps it'd be best to not complete these to anything - # for now. - COMPREPLY=( $(compgen -X '' -W '$(command ps axo command= | command sed -e \ - "s/ .*//" -e \ - "s:.*/::" -e \ - "s/:$//" -e \ - "s/^[[(-]//" -e \ - "s/[])]$//" | sort -u)' -- "$cur") ) + local line i=-1 OIFS=$IFS + IFS=$'\n' + local -a psout=( $(command ps axo command=) ) + IFS=$OIFS + for line in "${psout[@]}"; do + if [[ $i -eq -1 ]]; then + # First line, see if it has COMMAND column header. For example + # the busybox ps does that, i.e. doesn't respect axo command= + if [[ $line =~ ^(.*[[:space:]])COMMAND([[:space:]]|$) ]]; then + # It does; store its index. + i=${#BASH_REMATCH[1]} + else + # Nope, fall through to "regular axo command=" parsing. + break + fi + else + # + line=${line:$i} # take command starting from found index + line=${line%% *} # trim arguments + procs+=( $line ) + fi + done + if [[ $i -eq -1 ]]; then + # Regular axo command= parsing + for line in "${psout[@]}"; do + if [[ $line =~ ^[[(](.+)[])]$ ]]; then + procs+=( ${BASH_REMATCH[1]} ) + else + line=${line%% *} # trim arguments + line=${line##@(*/|-)} # trim leading path and - + procs+=( $line ) + fi + done + fi fi + COMPREPLY=( $(compgen -X "" -W '${procs[@]}' -- "$cur" ) ) } # This function completes on user IDs diff --git a/test/t/test_killall.py b/test/t/test_killall.py index 725a16e4d60..136eee7373b 100644 --- a/test/t/test_killall.py +++ b/test/t/test_killall.py @@ -11,3 +11,7 @@ def test_1(self, completion): @pytest.mark.complete("killall --signal ") def test_2(self, completion): assert all(x in completion for x in "INT KILL TERM".split()) + + @pytest.mark.complete("killall ") + def test_3(self, completion): + assert "command=" not in completion From 2748b79d678db1d06dac733b0ddc5a51a77cef1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 2 May 2019 20:14:25 +0300 Subject: [PATCH 0185/1094] test: disallow Alpine failure on Travis --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a79873cc492..e7303c5ca83 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,10 +13,6 @@ env: - DIST=ubuntu14 BSD=true NETWORK=none - DIST=tools -matrix: - allow_failures: - - env: DIST=alpine - before_install: - docker build --build-arg DIST=$DIST -t bash-completion:$DIST -f test/docker/Dockerfile . From 32e8b934c4bb3089b9a2b6e1677e7c014509f734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 2 May 2019 20:40:47 +0300 Subject: [PATCH 0186/1094] iconv, lz4, tipc, xsltproc: replace some seds with compgen -X --- completions/iconv | 5 ++--- completions/lz4 | 5 ++--- completions/tipc | 7 +++---- completions/xsltproc | 4 ++-- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/completions/iconv b/completions/iconv index 788785ce417..372c525bb4b 100644 --- a/completions/iconv +++ b/completions/iconv @@ -2,9 +2,8 @@ _iconv_charsets() { - COMPREPLY+=( $(compgen -W '$(${1:-iconv} -l | \ - command sed -e "s@/*\$@@" -e "s/[,()]//g" -e "s/ \.\.\.\$//")' \ - -- "$cur") ) + COMPREPLY+=( $(compgen -X ... -W '$(${1:-iconv} -l | \ + command sed -e "s@/*\$@@" -e "s/[,()]//g")' -- "$cur") ) } _iconv() diff --git a/completions/lz4 b/completions/lz4 index db8198f8395..76c24bfae83 100644 --- a/completions/lz4 +++ b/completions/lz4 @@ -13,9 +13,8 @@ _lz4() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W \ - '$(_parse_help "$1" -h | command sed -e "/#/d") -B{4..7} -i{1..9}' \ - -- "$cur") ) + COMPREPLY=( $(compgen -X '-*#*' -W \ + '$(_parse_help "$1" -h) -B{4..7} -i{1..9}' -- "$cur") ) return fi diff --git a/completions/tipc b/completions/tipc index d85f5e9c435..830040d9d21 100644 --- a/completions/tipc +++ b/completions/tipc @@ -65,10 +65,9 @@ _tipc_link() { # awk drops link state and last trailing : local links=$(tipc link list 2>/dev/null | \ awk '{print substr($1, 0, length($1))}') - if [[ $filter == "peers" ]]; then - links=$(command sed '/broadcast-link/d' <<<"$links") - fi - COMPREPLY=( $(compgen -W '$links' -- $cur) ) + local -a exclude + [[ $filter == peers ]] && exclude=( -X broadcast-link ) + COMPREPLY=( $(compgen "${exclude[@]}" -W '$links' -- $cur) ) fi } diff --git a/completions/xsltproc b/completions/xsltproc index 241de67b953..dbe68c45f0c 100644 --- a/completions/xsltproc +++ b/completions/xsltproc @@ -16,8 +16,8 @@ _xsltproc() ;; --encoding) # some aliases removed - COMPREPLY=( $(compgen -W "$(iconv -l | command sed -e '/^UTF[1378]/d' \ - -e '/^ISO[0-9_]/d' -e '/^8859/d' -e 's/\/.*//')" -- "$cur") ) + COMPREPLY=( $(compgen -X '@(UTF[1378]|8859|ISO[0-9_])*' \ + -W "$(iconv -l | command sed -e 's/\/.*//')" -- "$cur") ) return ;; --param|--stringparam) From 37522086868ae6da2e3630b24056b443ba9706e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 3 May 2019 22:03:02 +0300 Subject: [PATCH 0187/1094] test: port compgen and quote tests to pytest+pexpect --- test/t/Makefile.am | 1 + test/t/conftest.py | 4 +-- test/t/test_compgen.py | 7 ++++ test/t/unit/Makefile.am | 1 + test/t/unit/test_unit_quote.py | 36 +++++++++++++++++++ test/unit/compgen.exp | 35 ------------------ test/unit/quote.exp | 65 ---------------------------------- 7 files changed, 47 insertions(+), 102 deletions(-) create mode 100644 test/t/test_compgen.py create mode 100644 test/t/unit/test_unit_quote.py delete mode 100644 test/unit/compgen.exp delete mode 100644 test/unit/quote.exp diff --git a/test/t/Makefile.am b/test/t/Makefile.am index fb7665f17d8..dd3c2a88933 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -87,6 +87,7 @@ EXTRA_DIST = \ test_clone_member.py \ test_co.py \ test_compare.py \ + test_compgen.py \ test_complete.py \ test_composite.py \ test_config_list.py \ diff --git a/test/t/conftest.py b/test/t/conftest.py index 242c042f6fd..029c73c71ea 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -215,7 +215,7 @@ def load_completion_for(bash: pexpect.spawn, cmd: str) -> bool: def assert_bash_exec( - bash: pexpect.spawn, cmd: str, want_output: bool = False + bash: pexpect.spawn, cmd: str, want_output: bool = False, want_newline=True ) -> str: # Send command @@ -223,7 +223,7 @@ def assert_bash_exec( bash.expect_exact(cmd) # Find prompt, output is before it - bash.expect_exact("\r\n" + PS1) + bash.expect_exact("%s%s" % ("\r\n" if want_newline else "", PS1)) output = bash.before # Retrieve exit status diff --git a/test/t/test_compgen.py b/test/t/test_compgen.py new file mode 100644 index 00000000000..893abdf8a22 --- /dev/null +++ b/test/t/test_compgen.py @@ -0,0 +1,7 @@ +import pytest + + +class TestCompgen: + @pytest.mark.complete(r"compgen -f a\'b/", cwd="compgen") + def test_1(self, completion): + assert not completion diff --git a/test/t/unit/Makefile.am b/test/t/unit/Makefile.am index a0ab750231f..0ef0cccae78 100644 --- a/test/t/unit/Makefile.am +++ b/test/t/unit/Makefile.am @@ -11,6 +11,7 @@ EXTRA_DIST = \ test_unit_longopt.py \ test_unit_parse_help.py \ test_unit_parse_usage.py \ + test_unit_quote.py \ test_unit_tilde.py all: diff --git a/test/t/unit/test_unit_quote.py b/test/t/unit/test_unit_quote.py new file mode 100644 index 00000000000..e9f81c2d453 --- /dev/null +++ b/test/t/unit/test_unit_quote.py @@ -0,0 +1,36 @@ +import pytest + +from conftest import assert_bash_exec, TestUnitBase + + +@pytest.mark.bashcomp(cmd=None) +class TestUnitQuote(TestUnitBase): + def test_1(self, bash): + output = assert_bash_exec( + bash, 'quote "a b"', want_output=True, want_newline=False + ) + assert output.strip() == "'a b'" + + def test_2(self, bash): + output = assert_bash_exec( + bash, 'quote "a b"', want_output=True, want_newline=False + ) + assert output.strip() == "'a b'" + + def test_3(self, bash): + output = assert_bash_exec( + bash, 'quote " a "', want_output=True, want_newline=False + ) + assert output.strip() == "' a '" + + def test_4(self, bash): + output = assert_bash_exec( + bash, "quote \"a'b'c\"", want_output=True, want_newline=False + ) + assert output.strip() == r"'a'\''b'\''c'" + + def test_5(self, bash): + output = assert_bash_exec( + bash, 'quote "a\'"', want_output=True, want_newline=False + ) + assert output.strip() == r"'a'\'''" diff --git a/test/unit/compgen.exp b/test/unit/compgen.exp deleted file mode 100644 index 9fc1efba65a..00000000000 --- a/test/unit/compgen.exp +++ /dev/null @@ -1,35 +0,0 @@ -proc setup {} { - save_env -} - - -proc teardown {} { - assert_env_unmodified {/OLDPWD/d} -} - - -setup - - -set test {compgen -f a\\\'b/ should return a\'b/c} -set cmd {compgen -f a\\\'b/} -set dir $::srcdir/fixtures/compgen -assert_bash_exec "cd $dir" -send "$cmd\r" -expect -ex "$cmd\r\n" -expect { - -re {a\\\'b/c} { pass $test } - -re {a'b/c} { fail $test } - -re /@ { pass "$test" } - -re eof { unresolved "eof" } -} -sync_after_int -assert_bash_exec {cd "$TESTDIR"} - -#assert_bash_list_dir {a\\\'b/c} $cmd $::srcdir/fixtures/compgen - - -sync_after_int - - -teardown diff --git a/test/unit/quote.exp b/test/unit/quote.exp deleted file mode 100644 index 1764e6b0207..00000000000 --- a/test/unit/quote.exp +++ /dev/null @@ -1,65 +0,0 @@ -proc setup {} { - save_env -} - - -proc teardown {} { - assert_env_unmodified -} - - -setup - - -set cmd {quote "a b"} -set test {quote "a b" should output 'a b'} -send "$cmd\r" -expect -ex "$cmd\r\n" -expect { - -re {'a b'} { pass $test } - default { fail $test } -} -sync_after_int - -set cmd {quote "a b"} -set test {quote "a b" should output 'a b'} -send "$cmd\r" -expect -ex "$cmd\r\n" -expect { - -re {'a b'} { pass $test } - default { fail $test } -} -sync_after_int - -set cmd {quote " a "} -set test {quote " a " should output ' a '} -send "$cmd\r" -expect -ex "$cmd\r\n" -expect { - -re {' a '} { pass $test } - default { fail $test } -} -sync_after_int - -set cmd {quote "a'b'c"} -set test {quote "a'b'c" should output 'a'\''b'\''c'} -send "$cmd\r" -expect -ex "$cmd\r\n" -expect { - -re {'a'\\''b'\\''c'} { pass $test } - default { fail $test } -} -sync_after_int - -set cmd {quote "a'"} -set test {quote "a'" should output 'a'\'''} -send "$cmd\r" -expect -ex "$cmd\r\n" -expect { - -re {'a'\\'''} { pass $test } - default { fail $test } -} -sync_after_int - - -teardown From b670968232cbc91e494658b2b06330693ee42939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 4 May 2019 12:17:19 +0300 Subject: [PATCH 0188/1094] test: port _variables unit tests to pytest+pexpect --- test/t/unit/Makefile.am | 3 ++- test/t/unit/test_unit_variables.py | 41 ++++++++++++++++++++++++++++++ test/unit/_variables.exp | 39 ---------------------------- 3 files changed, 43 insertions(+), 40 deletions(-) create mode 100644 test/t/unit/test_unit_variables.py delete mode 100644 test/unit/_variables.exp diff --git a/test/t/unit/Makefile.am b/test/t/unit/Makefile.am index 0ef0cccae78..b96b326cd7d 100644 --- a/test/t/unit/Makefile.am +++ b/test/t/unit/Makefile.am @@ -12,7 +12,8 @@ EXTRA_DIST = \ test_unit_parse_help.py \ test_unit_parse_usage.py \ test_unit_quote.py \ - test_unit_tilde.py + test_unit_tilde.py \ + test_unit_variables.py all: diff --git a/test/t/unit/test_unit_variables.py b/test/t/unit/test_unit_variables.py new file mode 100644 index 00000000000..dd7a4219899 --- /dev/null +++ b/test/t/unit/test_unit_variables.py @@ -0,0 +1,41 @@ +import pytest + +from conftest import assert_bash_exec + + +@pytest.mark.bashcomp(cmd=None, ignore_env=r"^[+-](___var|assoc[12])=") +class TestUnitVariables: + @pytest.fixture(scope="class") + def functions(self, request, bash): + assert_bash_exec(bash, "unset assoc1 && declare -A assoc1=([idx]=1)") + assert_bash_exec( + bash, "unset assoc2 && declare -A assoc2=([idx1]=1 [idx2]=2)" + ) + assert_bash_exec(bash, "unset ${!___v*} && declare ___var=''") + request.addfinalizer( + lambda: assert_bash_exec(bash, "unset ___var assoc1 assoc2") + ) + + @pytest.mark.complete(": $___v") + def test_simple_variable_name(self, functions, completion): + assert completion == "$___var".split() + + @pytest.mark.complete(": ${assoc1[") + def test_single_array_index(self, functions, completion): + assert completion == "${assoc1[idx]}".split() + + @pytest.mark.complete(": ${assoc2[") + def test_multiple_array_indexes(self, functions, completion): + assert completion == "${assoc2[idx1]} ${assoc2[idx2]}".split() + + @pytest.mark.complete(": ${assoc1[bogus]") + def test_closing_curly_after_square(self, functions, completion): + assert completion == "${assoc1[bogus]}".split() + + @pytest.mark.complete(": ${assoc1[@") + def test_closing_brackets_after_at(self, functions, completion): + assert completion == "${assoc1[@]}".split() + + @pytest.mark.complete(": ${#___v") + def test_hash_prefix(self, functions, completion): + assert completion == "${#___var}".split() diff --git a/test/unit/_variables.exp b/test/unit/_variables.exp deleted file mode 100644 index 31411d53042..00000000000 --- a/test/unit/_variables.exp +++ /dev/null @@ -1,39 +0,0 @@ -proc setup {} { - assert_bash_exec { unset assoc1 && declare -A assoc1=([idx]=1)} - assert_bash_exec { unset assoc2 && declare -A assoc2=([idx1]=1 [idx2]=2)} - assert_bash_exec { unset ${!___v*} && declare ___var='' } - save_env -} - - -proc teardown {} { - assert_bash_exec {unset assoc1 assoc2} -} - - -setup - -set test "Complete simple variable names" -assert_complete "\$___var" ": \$___v" $test - -set test "Complete single array index" -assert_complete "\$\{assoc1\[idx\]\}" ": \$\{assoc1\[" $test -sync_after_int - -set test "Complete closing curly bracket after square bracket" -assert_complete "\$\{assoc1\[bogus\]\}" ": \$\{assoc1\[bogus\]" $test -sync_after_int - -set test "Complete closing brackets after @ index" -assert_complete "\$\{assoc1\[@\]\}" ": \$\{assoc1\[@" $test -sync_after_int - -# For some reason -expect-cmd-minus is necessary here -set test "Complete multiple array indexes" -assert_complete_partial { \$\{assoc2\[idx1\]\} \$\{assoc2\[idx2\]\} } ":" "\$\{assoc2\[" $test -expect-cmd-minus "\${assoc2\[" -sync_after_int - -set test "Complete variables prefixed with #" -assert_complete "\$\{#___var\}" ": \$\{#___v" $test - -teardown From cd9f0616567eee91eb971575baabcb8d97f3780e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 4 May 2019 13:14:27 +0300 Subject: [PATCH 0189/1094] README: add some badges, tweak existing --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d3815e6329b..ed151b09a5b 100644 --- a/README.md +++ b/README.md @@ -9,17 +9,21 @@ available in many operating system distributions, some examples are listed below. The package's name is usually bash-completion. [![Alpine](https://img.shields.io/badge/Alpine-%28see%20website%29-lightgray.svg)](https://pkgs.alpinelinux.org/packages?name=bash-completion) -[![Arch](https://img.shields.io/badge/dynamic/json.svg?uri=https%3A%2F%2Fwww.archlinux.org%2Fpackages%2Fextra%2Fany%2Fbash-completion%2Fjson%2F&query=%24.pkgver&label=Arch)](https://www.archlinux.org/packages/extra/any/bash-completion/) +[![Arch](https://img.shields.io/archlinux/v/extra/any/bash-completion.svg?label=Arch)](https://www.archlinux.org/packages/extra/any/bash-completion/) [![Cygwin](https://img.shields.io/badge/Cygwin-%28see%20website%29-lightgray.svg)](https://cygwin.com/packages/x86/bash-completion/) -[![Debian](https://img.shields.io/badge/dynamic/json.svg?uri=https%3A%2F%2Fapi.ftp-master.debian.org%2Fmadison%3Fpackage%3Dbash-completion%26f%3Djson%26s%3Dunstable&query=%24..source_version&label=Debian)](https://packages.debian.org/search?keywords=bash-completion&searchon=names&exact=1) -[![Fedora](https://img.shields.io/badge/dynamic/json.svg?uri=https%3A%2F%2Fapps.fedoraproject.org%2Fmdapi%2Frawhide%2Fpkg%2Fbash-completion&query=%24.version&label=Fedora)](https://apps.fedoraproject.org/packages/bash-completion) +[![Debian](https://img.shields.io/debian/v/bash-completion/testing.svg?label=Debian)](https://packages.debian.org/search?keywords=bash-completion&searchon=names&exact=1) +[![Fedora](https://img.shields.io/fedora/v/bash-completion.svg?label=Fedora)](https://apps.fedoraproject.org/packages/bash-completion) [![FreshPorts](https://img.shields.io/badge/FreshPorts-%28see%20website%29-lightgray.svg)](https://www.freshports.org/shells/bash-completion) [![Gentoo](https://img.shields.io/badge/Gentoo-%28see%20website%29-lightgray.svg)](https://packages.gentoo.org/packages/app-shells/bash-completion) -[![Homebrew](https://img.shields.io/homebrew/v/bash-completion%402.svg)](http://formulae.brew.sh/formula/bash-completion%402) +[![Homebrew](https://img.shields.io/homebrew/v/bash-completion%402.svg?label=Homebrew)](http://formulae.brew.sh/formula/bash-completion%402) +[![Mageia](https://img.shields.io/badge/Mageia-%28see%20website%29-lightgray.svg)](https://madb.mageia.org/package/show/name/bash-completion/release/cauldron/application/0) +[![NetBSD](https://img.shields.io/badge/NetBSD-%28see%20website%29-lightgray.svg)](https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/shells/bash-completion/README.html) [![OpenCSW](https://img.shields.io/badge/OpenCSW-%28see%20website%29-lightgray.svg)](https://www.opencsw.org/package/bash_completion/) +[![OpenMandriva](https://img.shields.io/badge/OpenMandriva-%28see%20website%29-lightgray.svg)](https://abf.openmandriva.org/openmandriva/bash-completion/build_lists) [![openSUSE](https://img.shields.io/badge/openSUSE-%28see%20website%29-lightgray.svg)](https://software.opensuse.org/package/bash-completion?baseproject=openSUSE%3AFactory) +[![Sisyphus](https://img.shields.io/badge/Sisyphus-%28see%20website%29-lightgray.svg)](http://sisyphus.ru/en/srpm/bash-completion) [![Slackware](https://img.shields.io/badge/Slackware-%28see%20website%29-lightgray.svg)](https://packages.slackware.com/?search=bash-completion) -[![Ubuntu](https://img.shields.io/badge/Ubuntu-%28see%20website%29-lightgray.svg)](https://packages.ubuntu.com/search?keywords=bash-completion&searchon=names&exact=1) +[![Ubuntu](https://img.shields.io/ubuntu/v/bash-completion.svg?label=Ubuntu)](https://packages.ubuntu.com/search?keywords=bash-completion&searchon=names&exact=1) Depending on the package, you may still need to source it from either `/etc/bashrc` or `~/.bashrc` (or any From f3537dd02acb7e8cc8d6150f9e38785ee75f958d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 4 May 2019 13:36:34 +0300 Subject: [PATCH 0190/1094] test: convert finger partial test case to pytest+pexpect --- test/lib/completions/finger.exp | 7 ------- test/lib/library.exp | 31 ------------------------------- test/t/test_finger.py | 17 ++++++++++++++--- 3 files changed, 14 insertions(+), 41 deletions(-) diff --git a/test/lib/completions/finger.exp b/test/lib/completions/finger.exp index fa9f5b6b28e..c055f354191 100644 --- a/test/lib/completions/finger.exp +++ b/test/lib/completions/finger.exp @@ -14,13 +14,6 @@ setup sync_after_int -set test "Tab should complete partial username" -assert_complete_partial [exec bash -c "compgen -A user -S @"] "finger" "" $test -nospace - - -sync_after_int - - set test "Tab should complete partial hostname" # Build string list of hostnames, starting with the character of the first # host, unless host starts with a COMP_WORDBREAKS character, e.g. a colon (:). diff --git a/test/lib/library.exp b/test/lib/library.exp index c984cbb78eb..c90c927cf8d 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -378,37 +378,6 @@ proc assert_complete_dir {expected cmd dir {test ""} {args {}}} { -# Make sure a partial argument is completed. -# A completion is tried with `$partial', or if this is empty, the first -# character of the first item of `$expected'. Only the items from $expected, -# starting with this character are then expected as completions. -# @param list $expected List of all completions. -# @param string $cmd Command given to generate items -# @param string $partial Word to complete -# @param string $test Test title -# @param list $args See: assert_complete() -proc assert_complete_partial {expected cmd {partial ""} {test ""} {args {}}} { - if {$test == ""} {set test "$cmd should complete partial argument"} - if {[llength $expected] == 0} { - unresolved "$test" - } else { - set pick {} - # Make sure expected items are unique - set expected [lsort -unique $expected] - foreach item $expected { - if {$partial == ""} {set partial [string range $item 0 0]} - # Only append item if starting with $partial - if {[string range $item 0 [expr [string length $partial] - 1]] == "$partial"} { - lappend pick $item - } - } - # NOTE: The `eval' is necessary to flatten the $args list - # See also: http://wiki.tcl.tk/11787 - {expand} - eval assert_complete \$pick \"\$cmd \$partial\" \$test $args; #" - } -} - - # If cword contains colon (:), left-trim completions with cword # @param string $cmd Command to complete # @param list $items Reference to list of completions to trim diff --git a/test/t/test_finger.py b/test/t/test_finger.py index e3cdfacd31b..92c983fa282 100644 --- a/test/t/test_finger.py +++ b/test/t/test_finger.py @@ -4,11 +4,22 @@ class TestFinger: - @pytest.mark.complete("finger ") - def test_1(self, bash, completion): - users_at = sorted( + @pytest.fixture(scope="class") + def users_at(self, bash): + return sorted( assert_bash_exec( bash, "compgen -A user -S @", want_output=True ).split() ) + + @pytest.mark.complete("finger ") + def test_1(self, bash, completion, users_at): assert completion == users_at + + @pytest.mark.complete("finger r") + def test_2(self, bash, completion, users_at): + if not any(x.startswith("r") for x in users_at): + pytest.skip("No users starting with r") + assert completion + assert all(x.startswith("r") for x in completion) + assert not completion.endswith(" ") From 2da46c3299403d93d1754b5ee2d8903cc874d267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 8 May 2019 23:47:28 +0700 Subject: [PATCH 0191/1094] test: convert bunch of _filedir unit tests to pytest+pexpect --- test/t/unit/test_unit_filedir.py | 110 ++++++++++++++++++++++++++++++- test/unit/_filedir.exp | 57 ---------------- 2 files changed, 109 insertions(+), 58 deletions(-) diff --git a/test/t/unit/test_unit_filedir.py b/test/t/unit/test_unit_filedir.py index dcd524031e2..d0f10001f6a 100644 --- a/test/t/unit/test_unit_filedir.py +++ b/test/t/unit/test_unit_filedir.py @@ -1,9 +1,117 @@ import pytest -from conftest import assert_bash_exec +from conftest import assert_bash_exec, assert_complete @pytest.mark.bashcomp(cmd=None, ignore_env=r"^\+COMPREPLY=") class TestUnitFiledir: + @pytest.fixture(scope="class") + def functions(self, request, bash): + assert_bash_exec( + bash, + "_f() { local cur=$(_get_cword); unset COMPREPLY; _filedir; }; " + "complete -F _f f; " + "complete -F _f -o filenames f2", + ) + assert_bash_exec( + bash, + "_g() { local cur=$(_get_cword); unset COMPREPLY; _filedir e1; }; " + "complete -F _g g", + ) + assert_bash_exec( + bash, + "_fd() { local cur=$(_get_cword); unset COMPREPLY; _filedir -d; }; " + "complete -F _fd fd", + ) + def test_1(self, bash): assert_bash_exec(bash, "_filedir >/dev/null") + + @pytest.mark.parametrize("funcname", "f f2".split()) + def test_2(self, bash, functions, funcname): + completion = assert_complete(bash, "%s ab/" % funcname, cwd="_filedir") + assert completion == "ab/e" + + @pytest.mark.parametrize("funcname", "f f2".split()) + def test_3(self, bash, functions, funcname): + completion = assert_complete( + bash, r"%s a\ b/" % funcname, cwd="_filedir" + ) + assert completion == "a b/i" + + @pytest.mark.parametrize("funcname", "f f2".split()) + def test_4(self, bash, functions, funcname): + completion = assert_complete( + bash, r"%s a\'b/" % funcname, cwd="_filedir" + ) + assert completion == "a'b/c" + + @pytest.mark.parametrize("funcname", "f f2".split()) + def test_5(self, bash, functions, funcname): + completion = assert_complete( + bash, r"%s a\&b/" % funcname, cwd="_filedir" + ) + assert completion == "a&b/f" + + @pytest.mark.parametrize("funcname", "f f2".split()) + def test_6(self, bash, functions, funcname): + completion = assert_complete( + bash, r"%s a\$" % funcname, cwd="_filedir" + ) + assert completion == "a$b/" + + @pytest.mark.parametrize("funcname", "f f2".split()) + def test_7(self, bash, functions, funcname): + completion = assert_complete( + bash, r"%s 'ab/" % funcname, cwd="_filedir" + ) + assert completion == "ab/e" + + @pytest.mark.parametrize("funcname", "f f2".split()) + def test_8(self, bash, functions, funcname): + completion = assert_complete( + bash, r"%s 'a b/" % funcname, cwd="_filedir" + ) + assert completion == "a b/i" + + @pytest.mark.parametrize("funcname", "f f2".split()) + def test_9(self, bash, functions, funcname): + completion = assert_complete( + bash, r"%s 'a$b/" % funcname, cwd="_filedir" + ) + assert completion == "a$b/h" + + @pytest.mark.parametrize("funcname", "f f2".split()) + def test_10(self, bash, functions, funcname): + completion = assert_complete( + bash, r"%s 'a&b/" % funcname, cwd="_filedir" + ) + assert completion == "a&b/f" + + @pytest.mark.parametrize("funcname", "f f2".split()) + def test_11(self, bash, functions, funcname): + completion = assert_complete( + bash, r'%s "ab/' % funcname, cwd="_filedir" + ) + assert completion == "ab/e" + + @pytest.mark.parametrize("funcname", "f f2".split()) + def test_12(self, bash, functions, funcname): + completion = assert_complete( + bash, r'%s "a b/' % funcname, cwd="_filedir" + ) + assert completion == "a b/i" + + @pytest.mark.parametrize("funcname", "f f2".split()) + def test_13(self, bash, functions, funcname): + completion = assert_complete( + bash, "%s \"a'b/" % funcname, cwd="_filedir" + ) + assert completion == "a'b/c" + + @pytest.mark.parametrize("funcname", "f f2".split()) + def test_14(self, bash, functions, funcname): + completion = assert_complete( + bash, '%s "a&b/' % funcname, cwd="_filedir" + ) + assert completion == "a&b/f" diff --git a/test/unit/_filedir.exp b/test/unit/_filedir.exp index 7395bf9a10e..d7cddcaeb9b 100644 --- a/test/unit/_filedir.exp +++ b/test/unit/_filedir.exp @@ -55,21 +55,6 @@ setup foreach name {f f2} { - set test "completing $name ab/ should return e" - set cmd "$name ab/" - assert_complete_dir e $cmd "$::srcdir/fixtures/_filedir" $test - sync_after_int - - set test "completing $name a\\ b/ should return i" - set cmd "$name a\\ b/" - assert_complete_dir i $cmd "$::srcdir/fixtures/_filedir" $test - sync_after_int - - set test "completing $name a\\\'b/ should return c" - set cmd "$name a\\\'b/" - assert_complete_dir c $cmd "$::srcdir/fixtures/_filedir" $test - sync_after_int - set test "completing $name a\\\$b/ should return h" if {[info exists ::env(CI)] && [info exists ::env(DIST)] && $::env(DIST) == "centos6"} { xfail $test @@ -91,28 +76,6 @@ foreach name {f f2} { sync_after_int } - set test "completing $name a\\&b/ should return f" - set cmd "$name a\\&b/" - assert_complete_dir f $cmd "$::srcdir/fixtures/_filedir" $test - sync_after_int - - set test "completing $name a\$ should return a\\\$b/" - set cmd "$name a\$" - assert_complete_dir "\b\\\\\$b/" $cmd "$::srcdir/fixtures/_filedir" $test -nospace - sync_after_int - - set cmd "$name 'ab/" - assert_complete_dir {e'} $cmd "$::srcdir/fixtures/_filedir" - sync_after_int - - set cmd "$name 'a b/" - assert_complete_dir {i'} $cmd "$::srcdir/fixtures/_filedir" - sync_after_int - - set cmd "$name 'a\$b/" - assert_complete_dir {h'} $cmd "$::srcdir/fixtures/_filedir" - sync_after_int - if {! [is_cygwin]} { # Illegal characters in file/dir names set cmd "$name 'a\"b/"; #" assert_complete_dir {d'} $cmd "$TESTDIR/tmp" @@ -123,22 +86,6 @@ foreach name {f f2} { sync_after_int } - set cmd "$name 'a&b/" - assert_complete_dir {f'} $cmd "$::srcdir/fixtures/_filedir" - sync_after_int - - set cmd "$name \"ab/"; #" - assert_complete_dir {e"} $cmd "$::srcdir/fixtures/_filedir"; #" - sync_after_int - - set cmd "$name \"a b/"; #" - assert_complete_dir {i"} $cmd "$::srcdir/fixtures/_filedir"; #" - sync_after_int - - set cmd "$name \"a'b/"; #" - assert_complete_dir {c"} $cmd "$::srcdir/fixtures/_filedir"; #" - sync_after_int - if {! [is_cygwin]} { # Illegal characters in file/dir names set cmd "$name \"a\\\"b/"; #" assert_complete_dir {d"} $cmd "$TESTDIR/tmp"; #" @@ -161,10 +108,6 @@ foreach name {f f2} { assert_complete_dir {g"} $cmd "$TESTDIR/tmp"; #" sync_after_int - set cmd "$name \"a&b/"; #" - assert_complete_dir {f"} $cmd "$::srcdir/fixtures/_filedir"; #" - sync_after_int - set cmd "$name \\\[x" assert_complete_dir {\[x\]} $cmd "$::srcdir/fixtures/_filedir/brackets" sync_after_int From 65aa0db5142f29ebd8a7e5d1bae91ffe8b2db516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 9 May 2019 00:22:17 +0700 Subject: [PATCH 0192/1094] test: flake8 fix --- test/t/unit/test_unit_filedir.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/t/unit/test_unit_filedir.py b/test/t/unit/test_unit_filedir.py index d0f10001f6a..0f2d9151473 100644 --- a/test/t/unit/test_unit_filedir.py +++ b/test/t/unit/test_unit_filedir.py @@ -20,7 +20,7 @@ def functions(self, request, bash): ) assert_bash_exec( bash, - "_fd() { local cur=$(_get_cword); unset COMPREPLY; _filedir -d; }; " + "_fd() { local cur=$(_get_cword); unset COMPREPLY; _filedir -d; };" "complete -F _fd fd", ) From 102e9a413101c702c1f458e55d79a861e80950a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 9 May 2019 00:30:50 +0700 Subject: [PATCH 0193/1094] test: convert more _filedir unit tests to pytest+pexpect --- test/t/unit/test_unit_filedir.py | 8 ++++++++ test/unit/_filedir.exp | 25 +++---------------------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/test/t/unit/test_unit_filedir.py b/test/t/unit/test_unit_filedir.py index 0f2d9151473..7f14f294d21 100644 --- a/test/t/unit/test_unit_filedir.py +++ b/test/t/unit/test_unit_filedir.py @@ -115,3 +115,11 @@ def test_14(self, bash, functions, funcname): bash, '%s "a&b/' % funcname, cwd="_filedir" ) assert completion == "a&b/f" + + @pytest.mark.complete(r"fd a\ ", cwd="_filedir") + def test_15(self, functions, completion): + assert completion == "a b/" + + @pytest.mark.complete("g ", cwd="_filedir/ext") + def test_16(self, functions, completion): + assert completion == sorted("ee.e1 foo/ gg.e1 ii.E1".split()) diff --git a/test/unit/_filedir.exp b/test/unit/_filedir.exp index d7cddcaeb9b..1de49504966 100644 --- a/test/unit/_filedir.exp +++ b/test/unit/_filedir.exp @@ -1,6 +1,6 @@ proc setup {} { assert_bash_exec {unset COMPREPLY cur} - assert_bash_exec {unset -f _f _fd} + assert_bash_exec {unset -f _f} save_env # Declare bash completion function `_f' assert_bash_exec { \ @@ -11,16 +11,6 @@ proc setup {} { assert_bash_exec { \ complete -F _f -o filenames f2 \ } - # Declare bash completion function `_g' to complete on `.e1' files - assert_bash_exec { \ - _g() { local cur=$(_get_cword); unset COMPREPLY; _filedir e1; }; \ - complete -F _g g \ - } - # Declare bash completion function `_fd' to complete on dirs - assert_bash_exec { \ - _fd() { local cur=$(_get_cword); unset COMPREPLY; _filedir -d; }; \ - complete -F _fd fd \ - } # Create directories `a"b', `a*b', and `a\b' only when not running on # Cygwin/Windows (`"', `*', or `\' aren't allowed in filenames there) if {! [is_cygwin]} { @@ -41,8 +31,8 @@ proc teardown {} { assert_bash_exec {(cd $TESTDIR/tmp && rm -- a\*b/j && rmdir a\*b/ || true)} } assert_bash_exec {unset COMPREPLY cur} - assert_bash_exec {unset -f _f _g _fd} - assert_bash_exec {complete -r f g fd} + assert_bash_exec {unset -f _f} + assert_bash_exec {complete -r f} assert_env_unmodified { /OLDPWD/d /OLD_CTYPE/d @@ -114,10 +104,6 @@ foreach name {f f2} { }; # foreach -set test "completing with filter '.e1' should show completions" -assert_complete_dir {ee.e1 foo/ gg.e1 ii.E1} "g " "$::srcdir/fixtures/_filedir/ext" $test -sync_after_int - set test "completing f aé should return g" # Execute this test only with LC_CTYPE matching *UTF-8* # See also: http://www.mail-archive.com/bash-completion-devel\ @@ -134,10 +120,5 @@ if { } sync_after_int -set test "completing fd a\\ should return a\\ b/" -set cmd "fd a\\ " -assert_complete_dir "a\\ b/" $cmd "$::srcdir/fixtures/_filedir" $test -nospace -sync_after_int - teardown From 06cea18e2ff03e90d1c663614e4d90422cfce246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 9 May 2019 00:39:50 +0700 Subject: [PATCH 0194/1094] test: add basic autossh test --- test/t/Makefile.am | 1 + test/t/test_autossh.py | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 test/t/test_autossh.py diff --git a/test/t/Makefile.am b/test/t/Makefile.am index dd3c2a88933..1a035aa0587 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -34,6 +34,7 @@ EXTRA_DIST = \ test_autoreconf.py \ test_autorpm.py \ test_autoscan.py \ + test_autossh.py \ test_autoupdate.py \ test_avctrl.py \ test_awk.py \ diff --git a/test/t/test_autossh.py b/test/t/test_autossh.py new file mode 100644 index 00000000000..e0c86c709a0 --- /dev/null +++ b/test/t/test_autossh.py @@ -0,0 +1,7 @@ +import pytest + + +class TestAutossh: + @pytest.mark.complete("autossh -") + def test_1(self, completion): + assert completion From 696f90d30a5cd6769be0affc166b2003de8a44e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 9 May 2019 00:46:38 +0700 Subject: [PATCH 0195/1094] chsh, pwck: try _parse_help before _parse_usage --- completions/_chsh | 3 ++- completions/pwck | 3 ++- test/t/test_chsh.py | 4 ++++ test/t/test_pwck.py | 4 ++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/completions/_chsh b/completions/_chsh index 48473fe8400..64ce5a1b195 100644 --- a/completions/_chsh +++ b/completions/_chsh @@ -19,7 +19,8 @@ _chsh() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) + local opts=$(_parse_help "$1") + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) else _allowed_users fi diff --git a/completions/pwck b/completions/pwck index 7723f66ddf0..cc5f2e42346 100644 --- a/completions/pwck +++ b/completions/pwck @@ -6,7 +6,8 @@ _pwck() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) + local opts=$(_parse_help "$1") + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) return fi diff --git a/test/t/test_chsh.py b/test/t/test_chsh.py index 26e3a0a3426..15e7d83f29b 100644 --- a/test/t/test_chsh.py +++ b/test/t/test_chsh.py @@ -9,3 +9,7 @@ def test_1(self, completion): @pytest.mark.complete("chsh -s ") def test_2(self, completion): assert completion + + @pytest.mark.complete("chsh -") + def test_3(self, completion): + assert completion diff --git a/test/t/test_pwck.py b/test/t/test_pwck.py index 143c76f13f7..a19d5c28910 100644 --- a/test/t/test_pwck.py +++ b/test/t/test_pwck.py @@ -5,3 +5,7 @@ class TestPwck: @pytest.mark.complete("pwck ") def test_1(self, completion): assert completion + + @pytest.mark.complete("pwck -") + def test_2(self, completion): + assert completion From dcef445f19d6c879144c09c5e6e96108fbe7c933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 9 May 2019 01:13:37 +0700 Subject: [PATCH 0196/1094] test: add bunch of basic _parse_usage use test cases --- test/t/test_badblocks.py | 4 ++++ test/t/test_cal.py | 4 ++++ test/t/test_dumpe2fs.py | 4 ++++ test/t/test_e2freefrag.py | 4 ++++ test/t/test_filefrag.py | 4 ++++ test/t/test_lua.py | 4 ++++ test/t/test_make.py | 4 ++++ test/t/test_nethogs.py | 4 ++++ test/t/test_pgrep.py | 4 ++++ test/t/test_pkill.py | 4 ++++ test/t/test_postcat.py | 4 ++++ test/t/test_postfix.py | 4 ++++ test/t/test_postmap.py | 4 ++++ test/t/test_quota.py | 4 ++++ test/t/test_radvdump.py | 4 ++++ test/t/test_setquota.py | 4 ++++ test/t/test_sftp.py | 4 ++++ test/t/test_ssh.py | 4 ++++ test/t/test_tune2fs.py | 4 ++++ test/t/test_xmlwf.py | 4 ++++ 20 files changed, 80 insertions(+) diff --git a/test/t/test_badblocks.py b/test/t/test_badblocks.py index 57a559de5d6..b436d4ec167 100644 --- a/test/t/test_badblocks.py +++ b/test/t/test_badblocks.py @@ -5,3 +5,7 @@ class TestBadblocks: @pytest.mark.complete("badblocks ") def test_1(self, completion): assert completion + + @pytest.mark.complete("badblocks -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_cal.py b/test/t/test_cal.py index 27102c7a028..f77390fc7bb 100644 --- a/test/t/test_cal.py +++ b/test/t/test_cal.py @@ -5,3 +5,7 @@ class TestCal: @pytest.mark.complete("cal ") def test_1(self, completion): assert completion + + @pytest.mark.complete("cal -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_dumpe2fs.py b/test/t/test_dumpe2fs.py index fa7590e6301..d1587906f81 100644 --- a/test/t/test_dumpe2fs.py +++ b/test/t/test_dumpe2fs.py @@ -5,3 +5,7 @@ class TestDumpe2fs: @pytest.mark.complete("dumpe2fs ") def test_1(self, completion): assert completion + + @pytest.mark.complete("dumpe2fs -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_e2freefrag.py b/test/t/test_e2freefrag.py index 6685382ded2..324f93e5286 100644 --- a/test/t/test_e2freefrag.py +++ b/test/t/test_e2freefrag.py @@ -5,3 +5,7 @@ class TestE2freefrag: @pytest.mark.complete("e2freefrag ") def test_1(self, completion): assert completion + + @pytest.mark.complete("e2freefrag -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_filefrag.py b/test/t/test_filefrag.py index 860b2512462..b83e5d631b9 100644 --- a/test/t/test_filefrag.py +++ b/test/t/test_filefrag.py @@ -5,3 +5,7 @@ class TestFilefrag: @pytest.mark.complete("filefrag ") def test_1(self, completion): assert completion + + @pytest.mark.complete("filefrag -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_lua.py b/test/t/test_lua.py index edcae88350d..70b977f4329 100644 --- a/test/t/test_lua.py +++ b/test/t/test_lua.py @@ -5,3 +5,7 @@ class TestLua: @pytest.mark.complete("lua ") def test_1(self, completion): assert completion + + @pytest.mark.complete("lua -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_make.py b/test/t/test_make.py index ae468fa93e9..47bb9e1884c 100644 --- a/test/t/test_make.py +++ b/test/t/test_make.py @@ -48,3 +48,7 @@ def test_7(self, bash, completion): def test_8(self, bash, completion): assert completion == "all clean extra_makefile install sample".split() os.remove("%s/make/%s" % (bash.cwd, "extra_makefile")) + + @pytest.mark.complete("make -") + def test_9(self, completion): + assert completion diff --git a/test/t/test_nethogs.py b/test/t/test_nethogs.py index a36c587feba..2c35a143141 100644 --- a/test/t/test_nethogs.py +++ b/test/t/test_nethogs.py @@ -5,3 +5,7 @@ class TestNethogs: @pytest.mark.complete("nethogs ") def test_1(self, completion): assert completion + + @pytest.mark.complete("nethogs -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_pgrep.py b/test/t/test_pgrep.py index 1155e582b70..92dffb26735 100644 --- a/test/t/test_pgrep.py +++ b/test/t/test_pgrep.py @@ -7,3 +7,7 @@ class TestPgrep: @pytest.mark.complete("pgrep p") def test_1(self, completion): assert completion + + @pytest.mark.complete("pgrep -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_pkill.py b/test/t/test_pkill.py index b0af6c3dc9b..a0d0e0bc71e 100644 --- a/test/t/test_pkill.py +++ b/test/t/test_pkill.py @@ -5,3 +5,7 @@ class TestPkill: @pytest.mark.complete("pkill ") def test_1(self, completion): assert completion + + @pytest.mark.complete("pkill -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_postcat.py b/test/t/test_postcat.py index 653cca2522c..f716b8a4c7c 100644 --- a/test/t/test_postcat.py +++ b/test/t/test_postcat.py @@ -5,3 +5,7 @@ class TestPostcat: @pytest.mark.complete("postcat ") def test_1(self, completion): assert completion + + @pytest.mark.complete("postcat -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_postfix.py b/test/t/test_postfix.py index f7af7b4cce9..72edaf62046 100644 --- a/test/t/test_postfix.py +++ b/test/t/test_postfix.py @@ -5,3 +5,7 @@ class TestPostfix: @pytest.mark.complete("postfix ") def test_1(self, completion): assert completion + + @pytest.mark.complete("postfix -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_postmap.py b/test/t/test_postmap.py index f3430fbdbcc..aab837d585e 100644 --- a/test/t/test_postmap.py +++ b/test/t/test_postmap.py @@ -5,3 +5,7 @@ class TestPostmap: @pytest.mark.complete("postmap ") def test_1(self, completion): assert completion + + @pytest.mark.complete("postmap -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_quota.py b/test/t/test_quota.py index 750988759b2..9ecdfa100c9 100644 --- a/test/t/test_quota.py +++ b/test/t/test_quota.py @@ -5,3 +5,7 @@ class TestQuota: @pytest.mark.complete("quota ") def test_1(self, completion): assert completion + + @pytest.mark.complete("quota -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_radvdump.py b/test/t/test_radvdump.py index e3d9242d485..265961010fc 100644 --- a/test/t/test_radvdump.py +++ b/test/t/test_radvdump.py @@ -5,3 +5,7 @@ class TestRadvdump: @pytest.mark.complete("radvdump ") def test_1(self, completion): assert completion + + @pytest.mark.complete("radvdump -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_setquota.py b/test/t/test_setquota.py index a2822bca1fb..62ccaa4b013 100644 --- a/test/t/test_setquota.py +++ b/test/t/test_setquota.py @@ -5,3 +5,7 @@ class TestSetquota: @pytest.mark.complete("setquota ") def test_1(self, completion): assert completion + + @pytest.mark.complete("setquota -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_sftp.py b/test/t/test_sftp.py index e76a6f59c09..47e3e22ed57 100644 --- a/test/t/test_sftp.py +++ b/test/t/test_sftp.py @@ -5,3 +5,7 @@ class TestSftp: @pytest.mark.complete("sftp -Fsp", cwd="sftp") def test_1(self, completion): assert completion == "-Fspaced conf" + + @pytest.mark.complete("sftp -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_ssh.py b/test/t/test_ssh.py index 97a4a73318b..282a248a49c 100644 --- a/test/t/test_ssh.py +++ b/test/t/test_ssh.py @@ -28,3 +28,7 @@ def test_4(self, completion): @pytest.mark.complete("ssh -vo userknownhostsf") def test_5(self, completion): assert "UserKnownHostsFile=" in completion + + @pytest.mark.complete("ssh -") + def test_6(self, completion): + assert completion diff --git a/test/t/test_tune2fs.py b/test/t/test_tune2fs.py index c8f4e8737af..b738870edb7 100644 --- a/test/t/test_tune2fs.py +++ b/test/t/test_tune2fs.py @@ -5,3 +5,7 @@ class TestTune2fs: @pytest.mark.complete("tune2fs ") def test_1(self, completion): assert completion + + @pytest.mark.complete("tune2fs -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_xmlwf.py b/test/t/test_xmlwf.py index 8751f865084..9a98d41e15a 100644 --- a/test/t/test_xmlwf.py +++ b/test/t/test_xmlwf.py @@ -5,3 +5,7 @@ class TestXmlwf: @pytest.mark.complete("xmlwf ") def test_1(self, completion): assert completion + + @pytest.mark.complete("xmlwf -") + def test_2(self, completion): + assert completion From 2500b504a16cfe8fd73caa5d1d53f377d1a90f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 9 May 2019 01:36:50 +0700 Subject: [PATCH 0197/1094] cal: try _parse_help before _parse_usage --- completions/_cal | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/completions/_cal b/completions/_cal index 9aefa704780..ed304aa71a5 100644 --- a/completions/_cal +++ b/completions/_cal @@ -24,7 +24,8 @@ _cal() esac if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) + local opts=$(_parse_help "$1") + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) return fi From 2deda5b49d1fe722008c3d676a4e95a551237586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 9 May 2019 01:47:12 +0700 Subject: [PATCH 0198/1094] postfix: option completion is expected to fail at the moment --- completions/postfix | 2 ++ test/t/test_postfix.py | 1 + 2 files changed, 3 insertions(+) diff --git a/completions/postfix b/completions/postfix index 89ff4dd476f..eda9ad46633 100644 --- a/completions/postfix +++ b/completions/postfix @@ -17,6 +17,8 @@ _postfix() esac if [[ $cur == -* ]]; then + # TODO: doesn't seem to work; the usage message doesn't get output + # if we try to grep it, it's only output on the console? COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) return fi diff --git a/test/t/test_postfix.py b/test/t/test_postfix.py index 72edaf62046..d5d5385ab79 100644 --- a/test/t/test_postfix.py +++ b/test/t/test_postfix.py @@ -6,6 +6,7 @@ class TestPostfix: def test_1(self, completion): assert completion + @pytest.mark.xfail # see TODO in completion @pytest.mark.complete("postfix -") def test_2(self, completion): assert completion From e8ac021ed13e5b110b9e0701b29d6c9704d33461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 9 May 2019 01:49:33 +0700 Subject: [PATCH 0199/1094] badblocks: fix $i leak --- completions/badblocks | 5 +---- test/t/test_badblocks.py | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/completions/badblocks b/completions/badblocks index a366338cb30..221f42b923b 100644 --- a/completions/badblocks +++ b/completions/badblocks @@ -16,11 +16,8 @@ _badblocks() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) # Filter out -w (dangerous) and -X (internal use) - for i in "${!COMPREPLY[@]}"; do - [[ ${COMPREPLY[i]} == -[wX] ]] && unset 'COMPREPLY[i]' - done + COMPREPLY=( $(compgen -X -[wX] -W '$(_parse_usage "$1")' -- "$cur") ) return fi diff --git a/test/t/test_badblocks.py b/test/t/test_badblocks.py index b436d4ec167..28fd54af609 100644 --- a/test/t/test_badblocks.py +++ b/test/t/test_badblocks.py @@ -9,3 +9,4 @@ def test_1(self, completion): @pytest.mark.complete("badblocks -") def test_2(self, completion): assert completion + assert all(x not in completion for x in "-w -X".split()) From 44ed05ac88888bbc0d156e89b62e63d630e1c2fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 9 May 2019 01:50:05 +0700 Subject: [PATCH 0200/1094] .gitignore: add configure.lineno --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a7d66548a43..d207dbc0612 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ autom4te.cache config.log config.status configure +configure.lineno install-sh missing doc/*.xml From 6b4fd9b783b1fe623f7fc1e55538a626076e5a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 10 May 2019 01:21:02 +0700 Subject: [PATCH 0201/1094] test: add bunch of basic _parse_help use test cases --- test/t/test_2to3.py | 4 ++++ test/t/test_a2x.py | 4 ++++ test/t/test_aclocal.py | 4 ++++ test/t/test_adb.py | 4 ++++ test/t/test_asciidoc.py | 4 ++++ test/t/test_automake.py | 4 ++++ test/t/test_autoscan.py | 4 ++++ test/t/test_bzip2.py | 4 ++++ test/t/test_chage.py | 4 ++++ test/t/test_convert.py | 4 ++++ test/t/test_cryptsetup.py | 4 ++++ test/t/test_cvs.py | 4 ++++ test/t/test_desktop_file_validate.py | 4 ++++ test/t/test_ecryptfs_migrate_home.py | 4 ++++ test/t/test_eog.py | 4 ++++ test/t/test_evince.py | 4 ++++ test/t/test_fusermount.py | 4 ++++ test/t/test_genisoimage.py | 4 ++++ test/t/test_getent.py | 4 ++++ test/t/test_gnokii.py | 4 ++++ test/t/test_gpasswd.py | 4 ++++ test/t/test_groupdel.py | 4 ++++ test/t/test_gzip.py | 4 ++++ test/t/test_hcitool.py | 4 ++++ test/t/test_htpasswd.py | 4 ++++ test/t/test_iftop.py | 4 ++++ test/t/test_interdiff.py | 4 ++++ test/t/test_iperf.py | 4 ++++ test/t/test_ipmitool.py | 4 ++++ test/t/test_javaws.py | 4 ++++ test/t/test_jpegoptim.py | 4 ++++ test/t/test_jshint.py | 4 ++++ test/t/test_k3b.py | 4 ++++ test/t/test_killall.py | 4 ++++ test/t/test_lftp.py | 4 ++++ test/t/test_lrzip.py | 4 ++++ test/t/test_luserdel.py | 4 ++++ test/t/test_lz4.py | 4 ++++ test/t/test_lzip.py | 4 ++++ test/t/test_man.py | 4 ++++ test/t/test_mcrypt.py | 4 ++++ test/t/test_mii_tool.py | 4 ++++ test/t/test_monodevelop.py | 4 ++++ test/t/test_newusers.py | 4 ++++ test/t/test_optipng.py | 4 ++++ test/t/test_patch.py | 4 ++++ test/t/test_pdftotext.py | 4 ++++ test/t/test_protoc.py | 4 ++++ test/t/test_pwdx.py | 4 ++++ test/t/test_pydoc.py | 4 ++++ test/t/test_pyflakes.py | 4 ++++ test/t/test_repomanage.py | 4 ++++ test/t/test_rpm.py | 4 ++++ test/t/test_rtcwake.py | 4 ++++ test/t/test_ssh_add.py | 8 ++++++++ test/t/test_strings.py | 4 ++++ test/t/test_su.py | 4 ++++ test/t/test_sysbench.py | 4 ++++ test/t/test_udevadm.py | 4 ++++ test/t/test_xrandr.py | 4 ++++ test/t/test_xrdb.py | 4 ++++ test/t/test_xz.py | 4 ++++ test/t/test_xzdec.py | 4 ++++ test/t/test_zopfli.py | 4 ++++ test/t/test_zopflipng.py | 3 +++ 65 files changed, 263 insertions(+) diff --git a/test/t/test_2to3.py b/test/t/test_2to3.py index 966ed1f5c5f..3c8afea9de8 100644 --- a/test/t/test_2to3.py +++ b/test/t/test_2to3.py @@ -5,3 +5,7 @@ class Test2to3: @pytest.mark.complete("2to3 ") def test_1(self, completion): assert completion + + @pytest.mark.complete("2to3 -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_a2x.py b/test/t/test_a2x.py index 3741e28d2c0..7847ed86f26 100644 --- a/test/t/test_a2x.py +++ b/test/t/test_a2x.py @@ -5,3 +5,7 @@ class TestA2x: @pytest.mark.complete("a2x ") def test_1(self, completion): assert completion + + @pytest.mark.complete("a2x -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_aclocal.py b/test/t/test_aclocal.py index cb3aca1bffe..52e19f6e4ac 100644 --- a/test/t/test_aclocal.py +++ b/test/t/test_aclocal.py @@ -5,3 +5,7 @@ class TestAclocal: @pytest.mark.complete("aclocal ") def test_1(self, completion): assert completion + + @pytest.mark.complete("aclocal -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_adb.py b/test/t/test_adb.py index 081a10470aa..304ba754f30 100644 --- a/test/t/test_adb.py +++ b/test/t/test_adb.py @@ -5,3 +5,7 @@ class TestAdb: @pytest.mark.complete("adb ") def test_1(self, completion): assert completion + + @pytest.mark.complete("adb -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_asciidoc.py b/test/t/test_asciidoc.py index b295a27d529..9f9096c923e 100644 --- a/test/t/test_asciidoc.py +++ b/test/t/test_asciidoc.py @@ -5,3 +5,7 @@ class TestAsciidoc: @pytest.mark.complete("asciidoc ") def test_1(self, completion): assert completion + + @pytest.mark.complete("asciidoc -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_automake.py b/test/t/test_automake.py index 5d25c6a7e69..a1feeb95acf 100644 --- a/test/t/test_automake.py +++ b/test/t/test_automake.py @@ -5,3 +5,7 @@ class TestAutomake: @pytest.mark.complete("automake ") def test_1(self, completion): assert completion + + @pytest.mark.complete("automake -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_autoscan.py b/test/t/test_autoscan.py index b2667543176..ae0014f7901 100644 --- a/test/t/test_autoscan.py +++ b/test/t/test_autoscan.py @@ -5,3 +5,7 @@ class TestAutoscan: @pytest.mark.complete("autoscan ") def test_1(self, completion): assert completion + + @pytest.mark.complete("autoscan -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_bzip2.py b/test/t/test_bzip2.py index d1cad249aee..3b501ea44e2 100644 --- a/test/t/test_bzip2.py +++ b/test/t/test_bzip2.py @@ -9,3 +9,7 @@ def test_1(self, completion): @pytest.mark.complete("bzip2 ~") def test_2(self, completion): assert completion + + @pytest.mark.complete("bzip2 -") + def test_3(self, completion): + assert completion diff --git a/test/t/test_chage.py b/test/t/test_chage.py index 6ef344357b9..383e798910e 100644 --- a/test/t/test_chage.py +++ b/test/t/test_chage.py @@ -5,3 +5,7 @@ class TestChage: @pytest.mark.complete("chage ") def test_1(self, completion): assert completion + + @pytest.mark.complete("chage -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_convert.py b/test/t/test_convert.py index 90dfb4776bf..bf1615ee051 100644 --- a/test/t/test_convert.py +++ b/test/t/test_convert.py @@ -9,3 +9,7 @@ def test_1(self, completion): @pytest.mark.complete("convert -format ") def test_2(self, completion): assert completion + + @pytest.mark.complete("convert -") + def test_3(self, completion): + assert completion diff --git a/test/t/test_cryptsetup.py b/test/t/test_cryptsetup.py index 235ac4fca0f..b2b368eb639 100644 --- a/test/t/test_cryptsetup.py +++ b/test/t/test_cryptsetup.py @@ -5,3 +5,7 @@ class TestCryptsetup: @pytest.mark.complete("cryptsetup ") def test_1(self, completion): assert completion + + @pytest.mark.complete("cryptsetup -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_cvs.py b/test/t/test_cvs.py index 825acbf5229..411ce6f7c71 100644 --- a/test/t/test_cvs.py +++ b/test/t/test_cvs.py @@ -14,3 +14,7 @@ def test_2(self, completion): @pytest.mark.complete("cvs diff foo/", cwd="cvs") def test_3(self, completion): assert completion == "foo/bar" + + @pytest.mark.complete("cvs -") + def test_4(self, completion): + assert completion diff --git a/test/t/test_desktop_file_validate.py b/test/t/test_desktop_file_validate.py index e007a956649..fd02604060c 100644 --- a/test/t/test_desktop_file_validate.py +++ b/test/t/test_desktop_file_validate.py @@ -6,3 +6,7 @@ class TestDesktopFileValidate: @pytest.mark.complete("desktop-file-validate ") def test_1(self, completion): assert completion + + @pytest.mark.complete("desktop-file-validate -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_ecryptfs_migrate_home.py b/test/t/test_ecryptfs_migrate_home.py index fd49ca8bcb8..1f567c004f5 100644 --- a/test/t/test_ecryptfs_migrate_home.py +++ b/test/t/test_ecryptfs_migrate_home.py @@ -6,3 +6,7 @@ class TestEcryptfsMigrateHome: @pytest.mark.complete("ecryptfs-migrate-home ") def test_1(self, completion): assert completion + + @pytest.mark.complete("ecryptfs-migrate-home -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_eog.py b/test/t/test_eog.py index c095934fec3..670ce89361e 100644 --- a/test/t/test_eog.py +++ b/test/t/test_eog.py @@ -5,3 +5,7 @@ class TestEog: @pytest.mark.complete("eog ") def test_1(self, completion): assert completion + + @pytest.mark.complete("eog -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_evince.py b/test/t/test_evince.py index 0dc44f38efe..ec65a4a711f 100644 --- a/test/t/test_evince.py +++ b/test/t/test_evince.py @@ -16,3 +16,7 @@ def test_1(self, completion): ".ps.bz2 .ps.BZ2 .PS.bz2 .PS.BZ2 .ps.gz .ps.GZ .PS.gz .PS.GZ " ".tga .TGA .tif .TIF .tiff .TIFF .xpm .XPM .xwd .XWD".split() ) + + @pytest.mark.complete("evince -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_fusermount.py b/test/t/test_fusermount.py index 3781586dd56..363096d18a5 100644 --- a/test/t/test_fusermount.py +++ b/test/t/test_fusermount.py @@ -5,3 +5,7 @@ class TestFusermount: @pytest.mark.complete("fusermount ") def test_1(self, completion): assert completion + + @pytest.mark.complete("fusermount -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_genisoimage.py b/test/t/test_genisoimage.py index ba16cea2bc0..aa578766cfb 100644 --- a/test/t/test_genisoimage.py +++ b/test/t/test_genisoimage.py @@ -5,3 +5,7 @@ class TestGenisoimage: @pytest.mark.complete("genisoimage ") def test_1(self, completion): assert completion + + @pytest.mark.complete("genisoimage -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_getent.py b/test/t/test_getent.py index fa84880c7cf..f3de573db32 100644 --- a/test/t/test_getent.py +++ b/test/t/test_getent.py @@ -5,3 +5,7 @@ class TestGetent: @pytest.mark.complete("getent ") def test_1(self, completion): assert completion + + @pytest.mark.complete("getent -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_gnokii.py b/test/t/test_gnokii.py index 106005f9349..7f696bf4e7e 100644 --- a/test/t/test_gnokii.py +++ b/test/t/test_gnokii.py @@ -5,3 +5,7 @@ class TestGnokii: @pytest.mark.complete("gnokii ") def test_1(self, completion): assert completion + + @pytest.mark.complete("gnokii -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_gpasswd.py b/test/t/test_gpasswd.py index 43826a58052..141ae847af8 100644 --- a/test/t/test_gpasswd.py +++ b/test/t/test_gpasswd.py @@ -5,3 +5,7 @@ class TestGpasswd: @pytest.mark.complete("gpasswd ") def test_1(self, completion): assert completion + + @pytest.mark.complete("gpasswd -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_groupdel.py b/test/t/test_groupdel.py index 1409e6cc668..9decc622edf 100644 --- a/test/t/test_groupdel.py +++ b/test/t/test_groupdel.py @@ -5,3 +5,7 @@ class TestGroupdel: @pytest.mark.complete("groupdel ") def test_1(self, completion): assert completion + + @pytest.mark.complete("groupdel -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_gzip.py b/test/t/test_gzip.py index 3c2ecb6fb60..da97fecb874 100644 --- a/test/t/test_gzip.py +++ b/test/t/test_gzip.py @@ -9,3 +9,7 @@ def test_1(self, completion): @pytest.mark.complete("gzip ~") def test_2(self, completion): assert completion + + @pytest.mark.complete("gzip -") + def test_3(self, completion): + assert completion diff --git a/test/t/test_hcitool.py b/test/t/test_hcitool.py index 8725533f30e..5395d8d22a1 100644 --- a/test/t/test_hcitool.py +++ b/test/t/test_hcitool.py @@ -5,3 +5,7 @@ class TestHcitool: @pytest.mark.complete("hcitool ") def test_1(self, completion): assert completion + + @pytest.mark.complete("hcitool -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_htpasswd.py b/test/t/test_htpasswd.py index c17c0585ef6..aaf8944715e 100644 --- a/test/t/test_htpasswd.py +++ b/test/t/test_htpasswd.py @@ -17,3 +17,7 @@ def test_3(self, completion): @pytest.mark.complete("htpasswd -D htpasswd ", cwd="htpasswd") def test_4(self, completion): assert completion == "foo quux".split() + + @pytest.mark.complete("htpasswd -") + def test_5(self, completion): + assert completion diff --git a/test/t/test_iftop.py b/test/t/test_iftop.py index 9a25c28aa39..3d66f4af187 100644 --- a/test/t/test_iftop.py +++ b/test/t/test_iftop.py @@ -5,3 +5,7 @@ class TestIftop: @pytest.mark.complete("iftop ") def test_1(self, completion): assert completion + + @pytest.mark.complete("iftop -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_interdiff.py b/test/t/test_interdiff.py index e681fd6c334..69da5cbe487 100644 --- a/test/t/test_interdiff.py +++ b/test/t/test_interdiff.py @@ -5,3 +5,7 @@ class TestInterdiff: @pytest.mark.complete("interdiff ") def test_1(self, completion): assert completion + + @pytest.mark.complete("interdiff -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_iperf.py b/test/t/test_iperf.py index 23f4df5546d..da91b648d9e 100644 --- a/test/t/test_iperf.py +++ b/test/t/test_iperf.py @@ -18,3 +18,7 @@ def test_3(self, completion): @pytest.mark.complete("iperf --server --") def test_4(self, completion): assert "--daemon" in completion + + @pytest.mark.complete("iperf -") + def test_5(self, completion): + assert completion diff --git a/test/t/test_ipmitool.py b/test/t/test_ipmitool.py index 5f50ec7934b..b90d10d3d25 100644 --- a/test/t/test_ipmitool.py +++ b/test/t/test_ipmitool.py @@ -5,3 +5,7 @@ class TestIpmitool: @pytest.mark.complete("ipmitool ") def test_1(self, completion): assert completion + + @pytest.mark.complete("ipmitool -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_javaws.py b/test/t/test_javaws.py index 9f51c58b50a..3fd564fd7c6 100644 --- a/test/t/test_javaws.py +++ b/test/t/test_javaws.py @@ -5,3 +5,7 @@ class TestJavaws: @pytest.mark.complete("javaws ") def test_1(self, completion): assert completion + + @pytest.mark.complete("javaws -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_jpegoptim.py b/test/t/test_jpegoptim.py index 01eb739c29c..78a2fc7e87e 100644 --- a/test/t/test_jpegoptim.py +++ b/test/t/test_jpegoptim.py @@ -5,3 +5,7 @@ class TestJpegoptim: @pytest.mark.complete("jpegoptim ") def test_1(self, completion): assert completion + + @pytest.mark.complete("jpegoptim -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_jshint.py b/test/t/test_jshint.py index 511e7c9d6a2..1d4ae55ba49 100644 --- a/test/t/test_jshint.py +++ b/test/t/test_jshint.py @@ -5,3 +5,7 @@ class TestJshint: @pytest.mark.complete("jshint ") def test_1(self, completion): assert completion + + @pytest.mark.complete("jshint -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_k3b.py b/test/t/test_k3b.py index d9940ba54e2..9219972d73a 100644 --- a/test/t/test_k3b.py +++ b/test/t/test_k3b.py @@ -5,3 +5,7 @@ class TestK3b: @pytest.mark.complete("k3b ") def test_1(self, completion): assert completion + + @pytest.mark.complete("k3b -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_killall.py b/test/t/test_killall.py index 136eee7373b..b2c0dc74af0 100644 --- a/test/t/test_killall.py +++ b/test/t/test_killall.py @@ -15,3 +15,7 @@ def test_2(self, completion): @pytest.mark.complete("killall ") def test_3(self, completion): assert "command=" not in completion + + @pytest.mark.complete("killall -") + def test_4(self, completion): + assert completion diff --git a/test/t/test_lftp.py b/test/t/test_lftp.py index 18506f61783..ea2ea65cb0e 100644 --- a/test/t/test_lftp.py +++ b/test/t/test_lftp.py @@ -12,3 +12,7 @@ def test_1(self, bash, completion): ).split() assert all(x in completion for x in hosts) assert "lftptest" in completion # defined in lftp/.lftp/bookmarks + + @pytest.mark.complete("lftp -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_lrzip.py b/test/t/test_lrzip.py index 266d8a30ff8..a98f6cbb747 100644 --- a/test/t/test_lrzip.py +++ b/test/t/test_lrzip.py @@ -9,3 +9,7 @@ def test_1(self, completion): @pytest.mark.complete("lrzip ~") def test_2(self, completion): assert completion + + @pytest.mark.complete("lrzip -") + def test_3(self, completion): + assert completion diff --git a/test/t/test_luserdel.py b/test/t/test_luserdel.py index cdca2a57b0b..c450f3350c5 100644 --- a/test/t/test_luserdel.py +++ b/test/t/test_luserdel.py @@ -5,3 +5,7 @@ class TestLuserdel: @pytest.mark.complete("luserdel ") def test_1(self, completion): assert completion + + @pytest.mark.complete("luserdel -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_lz4.py b/test/t/test_lz4.py index 0d873b661a4..d3aeed383f6 100644 --- a/test/t/test_lz4.py +++ b/test/t/test_lz4.py @@ -9,3 +9,7 @@ def test_1(self, completion): @pytest.mark.complete("lz4 ~") def test_2(self, completion): assert completion + + @pytest.mark.complete("lz4 -") + def test_3(self, completion): + assert completion diff --git a/test/t/test_lzip.py b/test/t/test_lzip.py index 6f1dc023e54..bb106bc7c8f 100644 --- a/test/t/test_lzip.py +++ b/test/t/test_lzip.py @@ -5,3 +5,7 @@ class TestLzip: @pytest.mark.complete("lzip ") def test_1(self, completion): assert completion + + @pytest.mark.complete("lzip -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_man.py b/test/t/test_man.py index 2da3087e55f..19146549ead 100644 --- a/test/t/test_man.py +++ b/test/t/test_man.py @@ -106,3 +106,7 @@ def test_9(self, bash, completion): ) def test_10(self, bash, colonpath, completion): assert completion == "Bash::Completion" + + @pytest.mark.complete("man -") + def test_11(self, completion): + assert completion diff --git a/test/t/test_mcrypt.py b/test/t/test_mcrypt.py index da80ef5d9db..0baa1f05a84 100644 --- a/test/t/test_mcrypt.py +++ b/test/t/test_mcrypt.py @@ -13,3 +13,7 @@ def test_2(self, completion): @pytest.mark.complete("mcrypt -m ") def test_3(self, completion): assert completion + + @pytest.mark.complete("mcrypt -") + def test_4(self, completion): + assert completion diff --git a/test/t/test_mii_tool.py b/test/t/test_mii_tool.py index 32568f8252a..90c7eabad99 100644 --- a/test/t/test_mii_tool.py +++ b/test/t/test_mii_tool.py @@ -6,3 +6,7 @@ class TestMiiTool: @pytest.mark.complete("mii-tool ") def test_1(self, completion): assert completion + + @pytest.mark.complete("mii-tool -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_monodevelop.py b/test/t/test_monodevelop.py index 472b1abafc0..315bcbac7c3 100644 --- a/test/t/test_monodevelop.py +++ b/test/t/test_monodevelop.py @@ -5,3 +5,7 @@ class TestMonodevelop: @pytest.mark.complete("monodevelop ") def test_1(self, completion): assert completion + + @pytest.mark.complete("monodevelop -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_newusers.py b/test/t/test_newusers.py index acd93ad2a2c..66d18f502b6 100644 --- a/test/t/test_newusers.py +++ b/test/t/test_newusers.py @@ -5,3 +5,7 @@ class TestNewusers: @pytest.mark.complete("newusers ") def test_1(self, completion): assert completion + + @pytest.mark.complete("newusers -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_optipng.py b/test/t/test_optipng.py index 393b0645af9..e4650ba988d 100644 --- a/test/t/test_optipng.py +++ b/test/t/test_optipng.py @@ -5,3 +5,7 @@ class TestOptipng: @pytest.mark.complete("optipng ") def test_1(self, completion): assert completion + + @pytest.mark.complete("optipng -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_patch.py b/test/t/test_patch.py index 455ebd9a33f..59f6a44caa7 100644 --- a/test/t/test_patch.py +++ b/test/t/test_patch.py @@ -5,3 +5,7 @@ class TestPatch: @pytest.mark.complete("patch ") def test_1(self, completion): assert completion + + @pytest.mark.complete("patch -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_pdftotext.py b/test/t/test_pdftotext.py index 9e332f06d5e..9ce4be5797e 100644 --- a/test/t/test_pdftotext.py +++ b/test/t/test_pdftotext.py @@ -5,3 +5,7 @@ class TestPdftotext: @pytest.mark.complete("pdftotext ") def test_1(self, completion): assert completion + + @pytest.mark.complete("pdftotext -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_protoc.py b/test/t/test_protoc.py index 65549d357d5..2f298c8970c 100644 --- a/test/t/test_protoc.py +++ b/test/t/test_protoc.py @@ -5,3 +5,7 @@ class TestProtoc: @pytest.mark.complete("protoc ") def test_1(self, completion): assert completion + + @pytest.mark.complete("protoc -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_pwdx.py b/test/t/test_pwdx.py index 411d7a59cb4..ffdcba01d63 100644 --- a/test/t/test_pwdx.py +++ b/test/t/test_pwdx.py @@ -5,3 +5,7 @@ class TestPwdx: @pytest.mark.complete("pwdx ") def test_1(self, completion): assert completion + + @pytest.mark.complete("pwdx -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_pydoc.py b/test/t/test_pydoc.py index e61736765e9..5e6274b5646 100644 --- a/test/t/test_pydoc.py +++ b/test/t/test_pydoc.py @@ -5,3 +5,7 @@ class TestPydoc: @pytest.mark.complete("pydoc r") def test_1(self, completion): assert completion + + @pytest.mark.complete("pydoc -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_pyflakes.py b/test/t/test_pyflakes.py index ae3853a7e37..d87fca46008 100644 --- a/test/t/test_pyflakes.py +++ b/test/t/test_pyflakes.py @@ -5,3 +5,7 @@ class TestPyflakes: @pytest.mark.complete("pyflakes ") def test_1(self, completion): assert completion + + @pytest.mark.complete("pyflakes -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_repomanage.py b/test/t/test_repomanage.py index 6def4a8c17d..9d5a1994268 100644 --- a/test/t/test_repomanage.py +++ b/test/t/test_repomanage.py @@ -5,3 +5,7 @@ class TestRepomanage: @pytest.mark.complete("repomanage ") def test_1(self, completion): assert completion + + @pytest.mark.complete("repomanage -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_rpm.py b/test/t/test_rpm.py index 939090dd727..069691a03fc 100644 --- a/test/t/test_rpm.py +++ b/test/t/test_rpm.py @@ -9,3 +9,7 @@ def test_1(self, completion): @pytest.mark.complete("rpm -q ", skipif='test -z "$(rpm -qa 2>/dev/null)"') def test_2(self, completion): assert completion + + @pytest.mark.complete("rpm -") + def test_3(self, completion): + assert completion diff --git a/test/t/test_rtcwake.py b/test/t/test_rtcwake.py index e9c12d07e20..2868c66ef95 100644 --- a/test/t/test_rtcwake.py +++ b/test/t/test_rtcwake.py @@ -5,3 +5,7 @@ class TestRtcwake: @pytest.mark.complete("rtcwake ") def test_1(self, completion): assert completion + + @pytest.mark.complete("rtcwake -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_ssh_add.py b/test/t/test_ssh_add.py index 33e679c71d1..bf95bfd12df 100644 --- a/test/t/test_ssh_add.py +++ b/test/t/test_ssh_add.py @@ -6,3 +6,11 @@ class TestSshAdd: @pytest.mark.complete("ssh-add ") def test_1(self, completion): assert completion + + @pytest.mark.complete( + "ssh-add -", + xfail="ssh-add --help 2>&1 | " + "command grep -qiF 'Could not open a connection'", + ) + def test_2(self, completion): + assert completion diff --git a/test/t/test_strings.py b/test/t/test_strings.py index 3922ecef785..36ce48aec2a 100644 --- a/test/t/test_strings.py +++ b/test/t/test_strings.py @@ -5,3 +5,7 @@ class TestStrings: @pytest.mark.complete("strings ") def test_1(self, completion): assert completion + + @pytest.mark.complete("strings -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_su.py b/test/t/test_su.py index e6c5ef4bf9c..340c10d70ea 100644 --- a/test/t/test_su.py +++ b/test/t/test_su.py @@ -5,3 +5,7 @@ class TestSu: @pytest.mark.complete("su ") def test_1(self, completion): assert completion + + @pytest.mark.complete("su -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_sysbench.py b/test/t/test_sysbench.py index afe21eca050..f50f1807a69 100644 --- a/test/t/test_sysbench.py +++ b/test/t/test_sysbench.py @@ -5,3 +5,7 @@ class TestSysbench: @pytest.mark.complete("sysbench ") def test_1(self, completion): assert completion + + @pytest.mark.complete("sysbench -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_udevadm.py b/test/t/test_udevadm.py index d5dcddbb224..d06e58e43ab 100644 --- a/test/t/test_udevadm.py +++ b/test/t/test_udevadm.py @@ -5,3 +5,7 @@ class TestUdevadm: @pytest.mark.complete("udevadm ") def test_1(self, completion): assert completion + + @pytest.mark.complete("udevadm -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_xrandr.py b/test/t/test_xrandr.py index e4e0d6b75ea..6bde5a0aab5 100644 --- a/test/t/test_xrandr.py +++ b/test/t/test_xrandr.py @@ -9,3 +9,7 @@ def test_1(self, completion): @pytest.mark.complete("xrandr --mode ") def test_2(self, completion): assert not completion + + @pytest.mark.complete("xrandr -") + def test_3(self, completion): + assert completion diff --git a/test/t/test_xrdb.py b/test/t/test_xrdb.py index 8f675e6840d..8ecb1f9a008 100644 --- a/test/t/test_xrdb.py +++ b/test/t/test_xrdb.py @@ -5,3 +5,7 @@ class TestXrdb: @pytest.mark.complete("xrdb ") def test_1(self, completion): assert completion + + @pytest.mark.complete("xrdb -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_xz.py b/test/t/test_xz.py index 6b92f480173..dee8ca95545 100644 --- a/test/t/test_xz.py +++ b/test/t/test_xz.py @@ -20,3 +20,7 @@ def test_3(self, completion): @pytest.mark.complete("xz ~") def test_4(self, completion): assert completion + + @pytest.mark.complete("xz -") + def test_5(self, completion): + assert completion diff --git a/test/t/test_xzdec.py b/test/t/test_xzdec.py index e57c1b65ca2..131481dd1f2 100644 --- a/test/t/test_xzdec.py +++ b/test/t/test_xzdec.py @@ -5,3 +5,7 @@ class TestXzdec: @pytest.mark.complete("xzdec ") def test_1(self, completion): assert completion + + @pytest.mark.complete("xzdec -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_zopfli.py b/test/t/test_zopfli.py index 127eda28d4d..3e856c7b308 100644 --- a/test/t/test_zopfli.py +++ b/test/t/test_zopfli.py @@ -9,3 +9,7 @@ def test_1(self, completion): @pytest.mark.complete("zopfli ~") def test_2(self, completion): assert completion + + @pytest.mark.complete("zopfli -") + def test_3(self, completion): + assert completion diff --git a/test/t/test_zopflipng.py b/test/t/test_zopflipng.py index a01e7bd7fed..6e67e50f2c8 100644 --- a/test/t/test_zopflipng.py +++ b/test/t/test_zopflipng.py @@ -5,3 +5,6 @@ class TestZopflipng: @pytest.mark.complete("zopflipng ") def test_1(self, completion): assert completion + @pytest.mark.complete("zopflipng -") + def test_2(self, completion): + assert completion From c64a4acd6637f0718b8dabfb53f40e8a6d8b71d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 11 May 2019 07:29:44 +0700 Subject: [PATCH 0202/1094] test: add more basic _parse_help use test cases --- test/t/test_appdata_validate.py | 4 ++++ test/t/test_ether_wake.py | 4 ++++ test/t/test_gnome_mplayer.py | 4 ++++ test/t/test_hping2.py | 4 ++++ test/t/test_luac.py | 4 ++++ test/t/test_mii_diag.py | 4 ++++ test/t/test_mock.py | 4 ++++ test/t/test_munin_node_configure.py | 4 ++++ test/t/test_opera.py | 4 ++++ test/t/test_pidof.py | 4 ++++ test/t/test_qemu.py | 4 ++++ test/t/test_wol.py | 4 ++++ test/t/test_wsimport.py | 4 ++++ 13 files changed, 52 insertions(+) diff --git a/test/t/test_appdata_validate.py b/test/t/test_appdata_validate.py index d57aa99208e..eeb4ef1728c 100644 --- a/test/t/test_appdata_validate.py +++ b/test/t/test_appdata_validate.py @@ -6,3 +6,7 @@ class TestAppdataValidate: @pytest.mark.complete("appdata-validate ") def test_1(self, completion): assert completion + + @pytest.mark.complete("appdata-validate -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_ether_wake.py b/test/t/test_ether_wake.py index b9dac0b44ba..4134e42e53f 100644 --- a/test/t/test_ether_wake.py +++ b/test/t/test_ether_wake.py @@ -6,3 +6,7 @@ class TestEtherWake: @pytest.mark.complete("ether-wake ") def test_1(self, completion): assert completion + + @pytest.mark.complete("ether-wake -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_gnome_mplayer.py b/test/t/test_gnome_mplayer.py index 5ee952c10db..3045c310ebe 100644 --- a/test/t/test_gnome_mplayer.py +++ b/test/t/test_gnome_mplayer.py @@ -6,3 +6,7 @@ class TestGnomeMplayer: @pytest.mark.complete("gnome-mplayer ") def test_1(self, completion): assert completion + + @pytest.mark.complete("gnome-mplayer -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_hping2.py b/test/t/test_hping2.py index 77e2ee26262..c5112378312 100644 --- a/test/t/test_hping2.py +++ b/test/t/test_hping2.py @@ -5,3 +5,7 @@ class TestHping2: @pytest.mark.complete("hping2 ") def test_1(self, completion): assert completion + + @pytest.mark.complete("hping2 -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_luac.py b/test/t/test_luac.py index f14d400a064..afeb62a285c 100644 --- a/test/t/test_luac.py +++ b/test/t/test_luac.py @@ -5,3 +5,7 @@ class TestLuac: @pytest.mark.complete("luac ") def test_1(self, completion): assert completion + + @pytest.mark.complete("luac -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_mii_diag.py b/test/t/test_mii_diag.py index fa527e9472a..ee185cfa342 100644 --- a/test/t/test_mii_diag.py +++ b/test/t/test_mii_diag.py @@ -6,3 +6,7 @@ class TestMiiDiag: @pytest.mark.complete("mii-diag ") def test_1(self, completion): assert completion + + @pytest.mark.complete("mii-diag -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_mock.py b/test/t/test_mock.py index 7dc5de2a3fd..7b314ff91e7 100644 --- a/test/t/test_mock.py +++ b/test/t/test_mock.py @@ -5,3 +5,7 @@ class TestMock: @pytest.mark.complete("mock ") def test_1(self, completion): assert completion + + @pytest.mark.complete("mock -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_munin_node_configure.py b/test/t/test_munin_node_configure.py index f3f23e7d5dc..bc853b145df 100644 --- a/test/t/test_munin_node_configure.py +++ b/test/t/test_munin_node_configure.py @@ -6,3 +6,7 @@ class TestMuninNodeConfigure: @pytest.mark.complete("munin-node-configure --libdir ") def test_1(self, completion): assert completion + + @pytest.mark.complete("munin-node-configure -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_opera.py b/test/t/test_opera.py index 5ab056f4cfa..94b7d6dd755 100644 --- a/test/t/test_opera.py +++ b/test/t/test_opera.py @@ -5,3 +5,7 @@ class TestOpera: @pytest.mark.complete("opera ") def test_1(self, completion): assert completion + + @pytest.mark.complete("opera -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_pidof.py b/test/t/test_pidof.py index fb553e5539a..45dfd56f27d 100644 --- a/test/t/test_pidof.py +++ b/test/t/test_pidof.py @@ -7,3 +7,7 @@ class TestPidof: @pytest.mark.complete("pidof p") def test_1(self, completion): assert completion + + @pytest.mark.complete("pidof -", xfail="! pidof --help &>/dev/null") + def test_2(self, completion): + assert completion diff --git a/test/t/test_qemu.py b/test/t/test_qemu.py index 3be6f64bf3e..b2bacbd305e 100644 --- a/test/t/test_qemu.py +++ b/test/t/test_qemu.py @@ -5,3 +5,7 @@ class TestQemu: @pytest.mark.complete("qemu ") def test_1(self, completion): assert completion + + @pytest.mark.complete("qemu -") + def test_2(self, completion): + assert completion diff --git a/test/t/test_wol.py b/test/t/test_wol.py index 8a6bea210e8..af966075a6d 100644 --- a/test/t/test_wol.py +++ b/test/t/test_wol.py @@ -13,3 +13,7 @@ def test_1(self, completion): @pytest.mark.complete("wol 00:") def test_2(self, completion): assert completion == "00:00:00:00:00:00" + + @pytest.mark.complete("wol -") + def test_3(self, completion): + assert completion diff --git a/test/t/test_wsimport.py b/test/t/test_wsimport.py index b75bf0f738f..a4da23642f7 100644 --- a/test/t/test_wsimport.py +++ b/test/t/test_wsimport.py @@ -5,3 +5,7 @@ class TestWsimport: @pytest.mark.complete("wsimport ") def test_1(self, completion): assert completion + + @pytest.mark.complete("wsimport -") + def test_2(self, completion): + assert completion From ef215a624a3f83a0aadd02fe9ddd9da775a6aa91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 11 May 2019 07:53:50 +0700 Subject: [PATCH 0203/1094] test: xfail getent and pwdx option completions with unparseable --help --- test/t/test_getent.py | 8 +++++++- test/t/test_pwdx.py | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/test/t/test_getent.py b/test/t/test_getent.py index f3de573db32..a5b250c5eea 100644 --- a/test/t/test_getent.py +++ b/test/t/test_getent.py @@ -6,6 +6,12 @@ class TestGetent: def test_1(self, completion): assert completion - @pytest.mark.complete("getent -") + @pytest.mark.complete( + "getent -", + xfail=( + "! (getent --help 2>&1 || :) | " + "command grep -q -- '[[:space:]]-'" + ), + ) def test_2(self, completion): assert completion diff --git a/test/t/test_pwdx.py b/test/t/test_pwdx.py index ffdcba01d63..ef5afa784b0 100644 --- a/test/t/test_pwdx.py +++ b/test/t/test_pwdx.py @@ -6,6 +6,9 @@ class TestPwdx: def test_1(self, completion): assert completion - @pytest.mark.complete("pwdx -") + @pytest.mark.complete( + "pwdx -", + xfail="! (pwdx --help 2>&1 || :) | command grep -q -- '[[:space:]]-'", + ) def test_2(self, completion): assert completion From 026e52a9b419cfb251f943be892b589b8520ff55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 11 May 2019 07:55:38 +0700 Subject: [PATCH 0204/1094] test: zopflipng flake8 fix --- test/t/test_zopflipng.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/t/test_zopflipng.py b/test/t/test_zopflipng.py index 6e67e50f2c8..7d89ea2d752 100644 --- a/test/t/test_zopflipng.py +++ b/test/t/test_zopflipng.py @@ -5,6 +5,7 @@ class TestZopflipng: @pytest.mark.complete("zopflipng ") def test_1(self, completion): assert completion + @pytest.mark.complete("zopflipng -") def test_2(self, completion): assert completion From 69c94b9bf81811aba2b1b7f7bb7ade587880e95b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 11 May 2019 11:00:26 +0700 Subject: [PATCH 0205/1094] test: enforce minimum pytest version --- test/Makefile.am | 1 + test/setup.cfg | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 test/setup.cfg diff --git a/test/Makefile.am b/test/Makefile.am index 454f1ecd479..003ec13270b 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -8,6 +8,7 @@ EXTRA_DIST = completion \ config \ fixtures \ lib \ + setup.cfg \ unit all: diff --git a/test/setup.cfg b/test/setup.cfg new file mode 100644 index 00000000000..1f68bc1fc1a --- /dev/null +++ b/test/setup.cfg @@ -0,0 +1,2 @@ +[tool:pytest] +minversion = 3.5 From 35188d93848de125dc82c798dbcac0d6e93fb255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 11 May 2019 11:05:53 +0700 Subject: [PATCH 0206/1094] build: make pytest executable configurable, look for pytest-3 too pytest-3 is more likely to be the Python 3 version, but as pip installs don't install it that way, prefer plain pytest as default, for example for cases where a system pytest-3 is too old and the intent is to use user pip installed one instead. --- configure.ac | 4 ++++ test/t/Makefile.am | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 1f3b37e8065..3c4640a257c 100644 --- a/configure.ac +++ b/configure.ac @@ -4,6 +4,10 @@ AM_INIT_AUTOMAKE([foreign dist-xz no-dist-gzip -Wall -Wno-portability -Werror]) AC_PROG_LN_S AC_PROG_MKDIR_P AC_PROG_SED +AC_ARG_WITH([pytest],[ --with-pytest=executable],[PYTEST="$withval"]) +if test -z "$PYTEST"; then + AC_CHECK_PROGS([PYTEST],[pytest pytest-3],[pytest]) +fi AC_SUBST(compatdir, $sysconfdir/bash_completion.d) AC_CONFIG_FILES([ Makefile diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 1a035aa0587..f5ac703088e 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -673,7 +673,7 @@ EXTRA_DIST = \ all: -PYTEST = pytest +PYTEST = @PYTEST@ check-local: $(PYTEST) $(PYTESTFLAGS) $(srcdir) From 98a7aa6cfd694149a9ca3857d224fe85a4acf538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 13 May 2019 08:48:45 +0300 Subject: [PATCH 0207/1094] test_pwdx: xfail more unparseable help cases --- test/t/test_pwdx.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/t/test_pwdx.py b/test/t/test_pwdx.py index ef5afa784b0..0cc42d728ee 100644 --- a/test/t/test_pwdx.py +++ b/test/t/test_pwdx.py @@ -8,7 +8,11 @@ def test_1(self, completion): @pytest.mark.complete( "pwdx -", - xfail="! (pwdx --help 2>&1 || :) | command grep -q -- '[[:space:]]-'", + xfail=( + "! (pwdx --help 2>&1 || :) | " + "command grep -vF 'invalid process id: --help' | " + "command grep -q -- '[[:space:]]-'" + ), ) def test_2(self, completion): assert completion From 139acc9fe3b35b000d899f54e06a7b638cc3e2e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 13 May 2019 08:49:16 +0300 Subject: [PATCH 0208/1094] test: xfail unparseable mock and munin-node-configure --help cases --- test/t/test_mock.py | 2 +- test/t/test_munin_node_configure.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/t/test_mock.py b/test/t/test_mock.py index 7b314ff91e7..e262d4a637f 100644 --- a/test/t/test_mock.py +++ b/test/t/test_mock.py @@ -6,6 +6,6 @@ class TestMock: def test_1(self, completion): assert completion - @pytest.mark.complete("mock -") + @pytest.mark.complete("mock -", xfail="! mock --help &>/dev/null") def test_2(self, completion): assert completion diff --git a/test/t/test_munin_node_configure.py b/test/t/test_munin_node_configure.py index bc853b145df..b74c5b81b25 100644 --- a/test/t/test_munin_node_configure.py +++ b/test/t/test_munin_node_configure.py @@ -7,6 +7,12 @@ class TestMuninNodeConfigure: def test_1(self, completion): assert completion - @pytest.mark.complete("munin-node-configure -") + @pytest.mark.complete( + "munin-node-configure -", + xfail=( + "! (munin-node-configure --help 2>&1 || :) " + "| command grep -q -- '[[:space:]]-'" + ), + ) def test_2(self, completion): assert completion From 5cb4be4220d649a78e85a6e772dcbe85622f9840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 14 May 2019 07:18:14 +0300 Subject: [PATCH 0209/1094] pgrep: fix fallback to _parse_usage --- completions/pgrep | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/pgrep b/completions/pgrep index e45d7d7fe01..1c507a4217d 100644 --- a/completions/pgrep +++ b/completions/pgrep @@ -36,7 +36,7 @@ _pgrep() esac if [[ $cur == -* ]]; then - local help='$(_parse_help "$1")' + local help=$(_parse_help "$1") [[ $help ]] || help='$("$1" --usage 2>&1 | command sed -e "s/\[-signal\]//" -e "s/\[-SIGNAL\]//" | _parse_usage -)' From bfe14e7b8e02f97d490a3b3c8087588e5318b5ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 14 May 2019 07:28:14 +0300 Subject: [PATCH 0210/1094] test: don't try to install black on Python < 3.6 --- test/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/requirements.txt b/test/requirements.txt index 23ced80163d..1ccafd6d945 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -1,4 +1,4 @@ -black>=19.3b0 +black>=19.3b0;python_version>"3.6" pexpect>=4 pytest>=3.5 pytest-xdist From 2baab4f1a8ad70500cea543758aadc13cc219878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 14 May 2019 07:36:51 +0300 Subject: [PATCH 0211/1094] test_wsimport: xfail options test on unparseable -help --- test/t/test_wsimport.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/t/test_wsimport.py b/test/t/test_wsimport.py index a4da23642f7..7dbfd13b1e8 100644 --- a/test/t/test_wsimport.py +++ b/test/t/test_wsimport.py @@ -6,6 +6,12 @@ class TestWsimport: def test_1(self, completion): assert completion - @pytest.mark.complete("wsimport -") + @pytest.mark.complete( + "wsimport -", + xfail=( + "! (wsimport -help 2>&1 || :) | " + "command grep -q -- '[[:space:]]-'" + ), + ) def test_2(self, completion): assert completion From 2e1cb45991af0e52a6be93b46264ffd45097d980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 14 May 2019 07:41:13 +0300 Subject: [PATCH 0212/1094] man: fall back to _parse_usage for _parse_help --- completions/man | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/completions/man b/completions/man index 02bd4f704ab..e5a4736176b 100644 --- a/completions/man +++ b/completions/man @@ -40,7 +40,8 @@ _man() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) + local opts=$(_parse_help "$1" -h) + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi From a81a1e80163147c1aabd9476507338dfa255b880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 14 May 2019 07:53:32 +0300 Subject: [PATCH 0213/1094] test: add basic tox fixture The newly added test/setup.cfg causes tox to emit a "python" env and break existing tests. Might as well test against a real fixture. --- test/fixtures/tox/tox.ini | 6 ++++++ test/t/test_tox.py | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 test/fixtures/tox/tox.ini diff --git a/test/fixtures/tox/tox.ini b/test/fixtures/tox/tox.ini new file mode 100644 index 00000000000..a64454fcc55 --- /dev/null +++ b/test/fixtures/tox/tox.ini @@ -0,0 +1,6 @@ +[tox] +envlist = py37 + +[testenv] +deps = pytest +commands = pytest diff --git a/test/t/test_tox.py b/test/t/test_tox.py index b6149362257..73d0c9a7d77 100644 --- a/test/t/test_tox.py +++ b/test/t/test_tox.py @@ -6,10 +6,10 @@ class TestTox: def test_1(self, completion): assert completion - @pytest.mark.complete("tox -e ") + @pytest.mark.complete("tox -e ", cwd="tox") def test_2(self, completion): - assert completion == "ALL" + assert all(x in completion for x in "py37 ALL".split()) - @pytest.mark.complete("tox -e foo,") + @pytest.mark.complete("tox -e foo,", cwd="tox") def test_3(self, completion): - assert completion == "foo,ALL" + assert all(x in completion for x in "py37 ALL".split()) From d7c92e602fc776272724c3c37a14181a4b01edf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 14 May 2019 08:37:35 +0300 Subject: [PATCH 0214/1094] tox: do simple parse on tox.ini if --listenvs* yields nothing Old versions do not have --listenvs-all or --listenvs. --- completions/tox | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/completions/tox b/completions/tox index a6418acad4d..93c3a2bb603 100644 --- a/completions/tox +++ b/completions/tox @@ -20,8 +20,11 @@ _tox() -!(-*)e) local envs=$( { "$1" --listenvs-all || "$1" --listenvs; } 2>/dev/null ) + [[ $envs ]] || envs=$( + command sed -e 's/,/ /g' -ne 's/^envlist[[:space:]]*=//p' \ + tox.ini 2>/dev/null) local prefix=""; [[ $cur == *,* ]] && prefix="${cur%,*}," - COMPREPLY=( $(compgen -W "$envs ALL" -- "${cur##*,}") ) + COMPREPLY=( $(compgen -X '*[{}]*' -W "$envs ALL" -- "${cur##*,}") ) [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} ) return ;; From 35411bf821b66146d7dfcfc3abf4c7d7ba4a30bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 29 May 2019 17:45:41 +0300 Subject: [PATCH 0215/1094] README: badge title tweaks --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ed151b09a5b..dc80cb06494 100644 --- a/README.md +++ b/README.md @@ -13,16 +13,16 @@ below. The package's name is usually bash-completion. [![Cygwin](https://img.shields.io/badge/Cygwin-%28see%20website%29-lightgray.svg)](https://cygwin.com/packages/x86/bash-completion/) [![Debian](https://img.shields.io/debian/v/bash-completion/testing.svg?label=Debian)](https://packages.debian.org/search?keywords=bash-completion&searchon=names&exact=1) [![Fedora](https://img.shields.io/fedora/v/bash-completion.svg?label=Fedora)](https://apps.fedoraproject.org/packages/bash-completion) -[![FreshPorts](https://img.shields.io/badge/FreshPorts-%28see%20website%29-lightgray.svg)](https://www.freshports.org/shells/bash-completion) +[![FreeBSD](https://img.shields.io/badge/FreeBSD-%28see%20website%29-lightgray.svg)](https://www.freshports.org/shells/bash-completion) [![Gentoo](https://img.shields.io/badge/Gentoo-%28see%20website%29-lightgray.svg)](https://packages.gentoo.org/packages/app-shells/bash-completion) -[![Homebrew](https://img.shields.io/homebrew/v/bash-completion%402.svg?label=Homebrew)](http://formulae.brew.sh/formula/bash-completion%402) +[![macOS/Homebrew](https://img.shields.io/homebrew/v/bash-completion%402.svg?label=macOS%2FHomebrew)](http://formulae.brew.sh/formula/bash-completion%402) [![Mageia](https://img.shields.io/badge/Mageia-%28see%20website%29-lightgray.svg)](https://madb.mageia.org/package/show/name/bash-completion/release/cauldron/application/0) [![NetBSD](https://img.shields.io/badge/NetBSD-%28see%20website%29-lightgray.svg)](https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/shells/bash-completion/README.html) -[![OpenCSW](https://img.shields.io/badge/OpenCSW-%28see%20website%29-lightgray.svg)](https://www.opencsw.org/package/bash_completion/) [![OpenMandriva](https://img.shields.io/badge/OpenMandriva-%28see%20website%29-lightgray.svg)](https://abf.openmandriva.org/openmandriva/bash-completion/build_lists) [![openSUSE](https://img.shields.io/badge/openSUSE-%28see%20website%29-lightgray.svg)](https://software.opensuse.org/package/bash-completion?baseproject=openSUSE%3AFactory) [![Sisyphus](https://img.shields.io/badge/Sisyphus-%28see%20website%29-lightgray.svg)](http://sisyphus.ru/en/srpm/bash-completion) [![Slackware](https://img.shields.io/badge/Slackware-%28see%20website%29-lightgray.svg)](https://packages.slackware.com/?search=bash-completion) +[![Solaris/OpenCSW](https://img.shields.io/badge/Solaris%2FOpenCSW-%28see%20website%29-lightgray.svg)](https://www.opencsw.org/package/bash_completion/) [![Ubuntu](https://img.shields.io/ubuntu/v/bash-completion.svg?label=Ubuntu)](https://packages.ubuntu.com/search?keywords=bash-completion&searchon=names&exact=1) Depending on the package, you may still From 378865db6e61d9a3ecfd0281b80b5d75167e792b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 29 May 2019 17:46:17 +0300 Subject: [PATCH 0216/1094] influx: new completion --- completions/Makefile.am | 1 + completions/influx | 32 ++++++++++++++++++++++++++++++++ test/t/Makefile.am | 1 + test/t/test_influx.py | 15 +++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 completions/influx create mode 100644 test/t/test_influx.py diff --git a/completions/Makefile.am b/completions/Makefile.am index 97b2b9764b3..77f053b8fd2 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -160,6 +160,7 @@ bashcomp_DATA = 2to3 \ ifstat \ iftop \ ifup \ + influx \ info \ inject \ inotifywait \ diff --git a/completions/influx b/completions/influx new file mode 100644 index 00000000000..bbedf10f7ab --- /dev/null +++ b/completions/influx @@ -0,0 +1,32 @@ +# bash completion for influx(8) -*- shell-script -*- + +_influx() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -version|-port|-database|-password|-username|-execute|-pps) + return + ;; + -host) + _known_hosts_real -- "$cur" + return + ;; + -format|-precision|-consistency) + local args=$($1 --help 2>&1 | awk "\$1 == \"$prev\" { print \$2 }") + COMPREPLY=( $(IFS+="\"'|"; compgen -W "$args" -- "$cur") ) + return + ;; + -import|-path) + _filedir + return + ;; + esac + + [[ "$cur" == -* ]] && + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) +} && +complete -F _influx influx + +# ex: filetype=sh diff --git a/test/t/Makefile.am b/test/t/Makefile.am index f5ac703088e..2b79fce5a64 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -234,6 +234,7 @@ EXTRA_DIST = \ test_iftop.py \ test_ifup.py \ test_import.py \ + test_influx.py \ test_info.py \ test_inject.py \ test_inotifywait.py \ diff --git a/test/t/test_influx.py b/test/t/test_influx.py new file mode 100644 index 00000000000..bec55e55745 --- /dev/null +++ b/test/t/test_influx.py @@ -0,0 +1,15 @@ +import pytest + + +class TestInflux: + @pytest.mark.complete("influx ") + def test_nothing(self, completion): + assert not completion + + @pytest.mark.complete("influx -") + def test_options(self, completion): + assert completion + + @pytest.mark.complete("influx -format ") + def test_format(self, completion): + assert completion From 3702ae08454974e8c847ef565a383384094a92b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 30 May 2019 09:34:49 +0300 Subject: [PATCH 0217/1094] test: source our profile.d test env script in docker --- test/docker/docker-script.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/test/docker/docker-script.sh b/test/docker/docker-script.sh index 8dabd73f279..014603f7100 100755 --- a/test/docker/docker-script.sh +++ b/test/docker/docker-script.sh @@ -20,14 +20,7 @@ if [ "$BSD" ]; then export PATH fi -case $DIST in - alpine|centos6|ubuntu14) - : ${PYTEST:=/root/.local/bin/pytest} - ;; - *) - : ${PYTEST:=pytest-3} - ;; -esac +. /etc/profile.d/bash-completion-test.sh export bashcomp_bash=bash env @@ -37,6 +30,5 @@ autoreconf -i make -j xvfb-run make distcheck \ - PYTEST=$PYTEST \ PYTESTFLAGS="--numprocesses=auto --dist=loadfile" \ RUNTESTFLAGS="--all --verbose" From fef4c9f784f26d50af93d0b9c4f6628a91626a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 6 Jun 2019 16:40:38 +0300 Subject: [PATCH 0218/1094] chromium-browser: add --proxy-server arg completion --- completions/chromium-browser | 19 +++++++++++++++++-- test/t/test_chromium_browser.py | 10 ++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/completions/chromium-browser b/completions/chromium-browser index f8bebd97eb4..ad27c0f50cd 100644 --- a/completions/chromium-browser +++ b/completions/chromium-browser @@ -3,16 +3,31 @@ _chromium_browser() { local cur prev words cword split - _init_completion -s || return + _init_completion -s -n : || return case $prev in - --help|--app|--proxy-server|--proxy-pac-url|-h) + --help|--app|--proxy-pac-url|-h) return ;; --user-data-dir) _filedir -d return ;; + --proxy-server) + case $cur in + *://*) + local prefix="${cur%%://*}://" + _known_hosts_real -- "${cur#*://}" + COMPREPLY=( "${COMPREPLY[@]/#/$prefix}" ) + __ltrim_colon_completions "$cur" + ;; + *) + compopt -o nospace + COMPREPLY=( $(compgen -S :// -W 'http socks socks4 socks5' -- "$cur") ) + ;; + esac + return + ;; --password-store) COMPREPLY=( $(compgen -W 'basic gnome kwallet' -- "$cur") ) return diff --git a/test/t/test_chromium_browser.py b/test/t/test_chromium_browser.py index 8ba822e59a1..b0b19b2949e 100644 --- a/test/t/test_chromium_browser.py +++ b/test/t/test_chromium_browser.py @@ -13,3 +13,13 @@ def test_1(self, completion): def test_2(self, completion): assert completion assert not completion.endswith(" ") + + @pytest.mark.complete("chromium-browser --proxy-server=") + def test_proxy_server_scheme(self, completion): + assert completion + assert not completion.endswith(" ") + assert all(x.endswith("://") for x in completion) + + @pytest.mark.complete("chromium-browser --proxy-server=http://") + def test_proxy_server_host(self, completion): + assert completion From d2574f51c3cadde840a0601a561009d7a53a2ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 15 Jun 2019 10:31:12 +0300 Subject: [PATCH 0219/1094] README: drop distro badges, link to Repology instead Closes https://github.com/scop/bash-completion/issues/327 --- README.md | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index dc80cb06494..e78cf189061 100644 --- a/README.md +++ b/README.md @@ -4,26 +4,9 @@ ## Installation -The easiest way to install this software is to use a package; it is -available in many operating system distributions, some examples are listed -below. The package's name is usually bash-completion. - -[![Alpine](https://img.shields.io/badge/Alpine-%28see%20website%29-lightgray.svg)](https://pkgs.alpinelinux.org/packages?name=bash-completion) -[![Arch](https://img.shields.io/archlinux/v/extra/any/bash-completion.svg?label=Arch)](https://www.archlinux.org/packages/extra/any/bash-completion/) -[![Cygwin](https://img.shields.io/badge/Cygwin-%28see%20website%29-lightgray.svg)](https://cygwin.com/packages/x86/bash-completion/) -[![Debian](https://img.shields.io/debian/v/bash-completion/testing.svg?label=Debian)](https://packages.debian.org/search?keywords=bash-completion&searchon=names&exact=1) -[![Fedora](https://img.shields.io/fedora/v/bash-completion.svg?label=Fedora)](https://apps.fedoraproject.org/packages/bash-completion) -[![FreeBSD](https://img.shields.io/badge/FreeBSD-%28see%20website%29-lightgray.svg)](https://www.freshports.org/shells/bash-completion) -[![Gentoo](https://img.shields.io/badge/Gentoo-%28see%20website%29-lightgray.svg)](https://packages.gentoo.org/packages/app-shells/bash-completion) -[![macOS/Homebrew](https://img.shields.io/homebrew/v/bash-completion%402.svg?label=macOS%2FHomebrew)](http://formulae.brew.sh/formula/bash-completion%402) -[![Mageia](https://img.shields.io/badge/Mageia-%28see%20website%29-lightgray.svg)](https://madb.mageia.org/package/show/name/bash-completion/release/cauldron/application/0) -[![NetBSD](https://img.shields.io/badge/NetBSD-%28see%20website%29-lightgray.svg)](https://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/shells/bash-completion/README.html) -[![OpenMandriva](https://img.shields.io/badge/OpenMandriva-%28see%20website%29-lightgray.svg)](https://abf.openmandriva.org/openmandriva/bash-completion/build_lists) -[![openSUSE](https://img.shields.io/badge/openSUSE-%28see%20website%29-lightgray.svg)](https://software.opensuse.org/package/bash-completion?baseproject=openSUSE%3AFactory) -[![Sisyphus](https://img.shields.io/badge/Sisyphus-%28see%20website%29-lightgray.svg)](http://sisyphus.ru/en/srpm/bash-completion) -[![Slackware](https://img.shields.io/badge/Slackware-%28see%20website%29-lightgray.svg)](https://packages.slackware.com/?search=bash-completion) -[![Solaris/OpenCSW](https://img.shields.io/badge/Solaris%2FOpenCSW-%28see%20website%29-lightgray.svg)](https://www.opencsw.org/package/bash_completion/) -[![Ubuntu](https://img.shields.io/ubuntu/v/bash-completion.svg?label=Ubuntu)](https://packages.ubuntu.com/search?keywords=bash-completion&searchon=names&exact=1) +The easiest way to install this software is to use a package; refer to +[Repology](https://repology.org/project/bash-completion) for a comprehensive +list of operating system distributions, package names, and available versions. Depending on the package, you may still need to source it from either `/etc/bashrc` or `~/.bashrc` (or any From bbe88bb6b1b028adb103b9cbfafc7c7168ff0667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 16 Jun 2019 09:52:11 +0300 Subject: [PATCH 0220/1094] ip: invoke the tool as $1 --- completions/ip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/ip b/completions/ip index 372d2d85ba2..f7e6e7c2b7f 100644 --- a/completions/ip +++ b/completions/ip @@ -49,7 +49,7 @@ _ip() return ;; *) - COMPREPLY=( $(compgen -W "help $(ip help 2>&1 | command sed -e \ + COMPREPLY=( $(compgen -W "help $($1 help 2>&1 | command sed -e \ '/OBJECT := /,/}/!d' -e \ 's/.*{//' -e \ 's/}.*//' -e \ From 9cd7c03f898559601e81e2a933d205d1ea1a51f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 16 Jun 2019 11:36:15 +0300 Subject: [PATCH 0221/1094] test: fix required pytest version It's 3.6+ for get_closest_marker(). --- test/requirements.txt | 2 +- test/setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/requirements.txt b/test/requirements.txt index 1ccafd6d945..3a3c3f4dd7b 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -1,5 +1,5 @@ black>=19.3b0;python_version>"3.6" pexpect>=4 -pytest>=3.5 +pytest>=3.6 pytest-xdist typing;python_version<"3.5" diff --git a/test/setup.cfg b/test/setup.cfg index 1f68bc1fc1a..3b1a9cfdccc 100644 --- a/test/setup.cfg +++ b/test/setup.cfg @@ -1,2 +1,2 @@ [tool:pytest] -minversion = 3.5 +minversion = 3.6 From c18787923bc40b4ee599946deb579eab6d3fa5b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 16 Jun 2019 11:37:45 +0300 Subject: [PATCH 0222/1094] test: register our pytest markers to hush warnings from 4.5+ --- test/setup.cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/setup.cfg b/test/setup.cfg index 3b1a9cfdccc..cef707ce83b 100644 --- a/test/setup.cfg +++ b/test/setup.cfg @@ -1,2 +1,5 @@ [tool:pytest] minversion = 3.6 +markers = + bashcomp + complete From f8fac3aefd4067d039d1e088f227808259602676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 16 Jun 2019 11:40:07 +0300 Subject: [PATCH 0223/1094] gssdp-discover: new completion --- completions/Makefile.am | 1 + completions/gssdp-discover | 31 +++++++++++++++++++++++++++++++ test/t/Makefile.am | 1 + test/t/test_gssdp_discover.py | 16 ++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 completions/gssdp-discover create mode 100644 test/t/test_gssdp_discover.py diff --git a/completions/Makefile.am b/completions/Makefile.am index 77f053b8fd2..b77f3bdf082 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -143,6 +143,7 @@ bashcomp_DATA = 2to3 \ groupmod \ growisofs \ grpck \ + gssdp-discover \ gzip \ hcitool \ hddtemp \ diff --git a/completions/gssdp-discover b/completions/gssdp-discover new file mode 100644 index 00000000000..f0fa695532c --- /dev/null +++ b/completions/gssdp-discover @@ -0,0 +1,31 @@ +# bash completion for gssdp-discover -*- shell-script -*- + +_gssdp_discover() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + --help|--target|--timeout|--rescan-interval|-[htnr]) + return + ;; + --interface|-i) + _available_interfaces -a + return + ;; + --message-type|-m) + local types=$($1 --help 2>&1 | \ + command sed -ne 's/^.*--message-type=.*(\([^)]*\))$/\1/p') + COMPREPLY=( $(IFS+=,; compgen -W "$types" -- "$cur") ) + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + fi +} && +complete -F _gssdp_discover gssdp-discover + +# ex: filetype=sh diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 2b79fce5a64..4437804a9f9 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -209,6 +209,7 @@ EXTRA_DIST = \ test_growisofs.py \ test_grpck.py \ test_grub.py \ + test_gssdp_discover.py \ test_gzip.py \ test_hciattach.py \ test_hciconfig.py \ diff --git a/test/t/test_gssdp_discover.py b/test/t/test_gssdp_discover.py new file mode 100644 index 00000000000..dca62f6a2ae --- /dev/null +++ b/test/t/test_gssdp_discover.py @@ -0,0 +1,16 @@ +import pytest + + +@pytest.mark.bashcomp(cmd="gssdp-discover") +class TestGssdpDiscover: + @pytest.mark.complete("gssdp-discover ") + def test_no_args(self, completion): + assert not completion + + @pytest.mark.complete("gssdp-discover --") + def test_options(self, completion): + assert completion + + @pytest.mark.complete("gssdp-discover --message-type=") + def test_message_type(self, completion): + assert completion From c06cfb053eea2d5cbe478f5179ad5e3d824d760a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 21 Jun 2019 09:55:44 +0300 Subject: [PATCH 0224/1094] tox: complete defaults after a -- --- completions/tox | 6 ++++++ test/t/test_tox.py | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/completions/tox b/completions/tox index 93c3a2bb603..69749dd42f0 100644 --- a/completions/tox +++ b/completions/tox @@ -5,6 +5,12 @@ _tox() local cur prev words cword _init_completion || return + # Complete defaults following a "--" + if [[ "${words[*]:0:cword} " == *\ --\ * && $cur != -- ]]; then + compopt -o bashdefault -o default + return + fi + case $prev in --help|--version|--num|--index-url|--hashseed|--force-dep|-!(-*)[hni]) return diff --git a/test/t/test_tox.py b/test/t/test_tox.py index 73d0c9a7d77..61b1b97ef44 100644 --- a/test/t/test_tox.py +++ b/test/t/test_tox.py @@ -13,3 +13,7 @@ def test_2(self, completion): @pytest.mark.complete("tox -e foo,", cwd="tox") def test_3(self, completion): assert all(x in completion for x in "py37 ALL".split()) + + @pytest.mark.complete("tox -e foo -- ", cwd="tox") + def test_default_after_dashdash(self, completion): + assert completion == ".tox/ tox.ini".split() From 0ee3a3b4db0a65a4ed6a2a07d5c259c1c398de59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 21 Jun 2019 09:55:58 +0300 Subject: [PATCH 0225/1094] tox: include -- in option completions --- completions/tox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/tox b/completions/tox index 69749dd42f0..7dcddc54a0d 100644 --- a/completions/tox +++ b/completions/tox @@ -37,7 +37,7 @@ _tox() esac if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1") --' -- "$cur") ) return fi } && From ed143530a2811d605de198a11bc699a90da645fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 21 Jun 2019 11:14:31 +0300 Subject: [PATCH 0226/1094] test: drop sourcing our no longer existing profile.d script --- test/docker/docker-script.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/docker/docker-script.sh b/test/docker/docker-script.sh index 014603f7100..681f2429a9e 100755 --- a/test/docker/docker-script.sh +++ b/test/docker/docker-script.sh @@ -20,8 +20,6 @@ if [ "$BSD" ]; then export PATH fi -. /etc/profile.d/bash-completion-test.sh - export bashcomp_bash=bash env From 6dd937d3c86aa098b273002c9589f9e5ba2c5891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 22 Jun 2019 11:17:34 +0200 Subject: [PATCH 0227/1094] test: don't expect a .tox dir in fixture --- test/t/test_tox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/t/test_tox.py b/test/t/test_tox.py index 61b1b97ef44..f012a032502 100644 --- a/test/t/test_tox.py +++ b/test/t/test_tox.py @@ -16,4 +16,4 @@ def test_3(self, completion): @pytest.mark.complete("tox -e foo -- ", cwd="tox") def test_default_after_dashdash(self, completion): - assert completion == ".tox/ tox.ini".split() + assert "tox.ini" in completion From 5fd2701371a491176b25fa9683481d6d143675f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 22 Jun 2019 11:23:34 +0200 Subject: [PATCH 0228/1094] test: expect failures for bc without --help useful with _longopt --- test/t/test_bc.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/t/test_bc.py b/test/t/test_bc.py index effcbaeac1e..6b0e889bc58 100644 --- a/test/t/test_bc.py +++ b/test/t/test_bc.py @@ -2,6 +2,12 @@ class TestBc: - @pytest.mark.complete("bc --") + @pytest.mark.complete( + "bc --", + xfail=( + "! bc --help &>/dev/null || " + "! bc --help 2>&1 | command grep -qF -- --help" + ), + ) def test_1(self, completion): assert completion From b0fb7101aaad984e21ce520b39e6416db261a354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 22 Jun 2019 13:26:00 +0200 Subject: [PATCH 0229/1094] test: skip gssdp-discover --message-type when option not available --- test/t/test_gssdp_discover.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/t/test_gssdp_discover.py b/test/t/test_gssdp_discover.py index dca62f6a2ae..9164a3547fe 100644 --- a/test/t/test_gssdp_discover.py +++ b/test/t/test_gssdp_discover.py @@ -11,6 +11,12 @@ def test_no_args(self, completion): def test_options(self, completion): assert completion - @pytest.mark.complete("gssdp-discover --message-type=") + @pytest.mark.complete( + "gssdp-discover --message-type=", + skipif=( + "! gssdp-discover --help 2>&1 " + "| command grep -qF -- --message-type" + ), + ) def test_message_type(self, completion): assert completion From 5c0e98832a1ee4e2829d47e2fb22f495ac09b641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 22 Jun 2019 14:14:56 +0200 Subject: [PATCH 0230/1094] xvfb-run: new completion --- completions/Makefile.am | 1 + completions/xvfb-run | 36 ++++++++++++++++++++++++++++++++++++ test/t/Makefile.am | 1 + test/t/test_xvfb_run.py | 12 ++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 completions/xvfb-run create mode 100644 test/t/test_xvfb_run.py diff --git a/completions/Makefile.am b/completions/Makefile.am index b77f3bdf082..29dd95021f5 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -453,6 +453,7 @@ bashcomp_DATA = 2to3 \ xrandr \ xrdb \ xsltproc \ + xvfb-run \ xxd \ xz \ xzdec \ diff --git a/completions/xvfb-run b/completions/xvfb-run new file mode 100644 index 00000000000..162c66ed4af --- /dev/null +++ b/completions/xvfb-run @@ -0,0 +1,36 @@ +# bash completion for xvfb-run -*- shell-script -*- + +_xvfb_run() +{ + local cur prev words cword split + _init_completion -s || return + + local i + for (( i=1; i <= COMP_CWORD; i++ )); do + if [[ ${COMP_WORDS[i]} != -* ]]; then + _command_offset $i + return + fi + [[ ${COMP_WORDS[i]} == -!(-*)[npsef] ]] && ((i++)) + done + + case $prev in + --help|--server-num|--xauth-protocol|--server-args|-!(-*)[hnps]) + return + ;; + --error-file|--auth-file|-!(-*)[ef]) + _filedir + return + ;; + esac + + $split && return + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + fi +} && +complete -F _xvfb_run xvfb-run + +# ex: filetype=sh diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 4437804a9f9..0a2e74a35ea 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -662,6 +662,7 @@ EXTRA_DIST = \ test_xrandr.py \ test_xrdb.py \ test_xsltproc.py \ + test_xvfb_run.py \ test_xvnc4viewer.py \ test_xxd.py \ test_xz.py \ diff --git a/test/t/test_xvfb_run.py b/test/t/test_xvfb_run.py new file mode 100644 index 00000000000..bb324c457c4 --- /dev/null +++ b/test/t/test_xvfb_run.py @@ -0,0 +1,12 @@ +import pytest + + +@pytest.mark.bashcomp(cmd="xvfb-run") +class TestXvfbRun: + @pytest.mark.complete("xvfb-run ") + def test_no_args(self, completion): + assert any(x in completion for x in ("bash", "xvfb-run")) + + @pytest.mark.complete("xvfb-run -") + def test_options(self, completion): + assert completion From 07eada37598e19c282081102ad29d62a6e87e9f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 22 Jun 2019 14:32:04 +0200 Subject: [PATCH 0231/1094] test: avoid gnome-mplayer core dump on Ubuntu 14 XDG_DATA_DIRS set to a dir with no schemas results in "GLib-GIO-ERROR **: No GSettings schemas are installed on the system" and a core dump. We currently have it set to /var/empty to avoid files installed on the system being loaded and possibly affecting tests. --- test/t/test_gnome_mplayer.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/t/test_gnome_mplayer.py b/test/t/test_gnome_mplayer.py index 3045c310ebe..ec2157eb1de 100644 --- a/test/t/test_gnome_mplayer.py +++ b/test/t/test_gnome_mplayer.py @@ -1,12 +1,15 @@ import pytest -@pytest.mark.bashcomp(cmd="gnome-mplayer") +@pytest.mark.bashcomp(cmd="gnome-mplayer", ignore_env=r"^[+-]XDG_DATA_DIRS=") class TestGnomeMplayer: @pytest.mark.complete("gnome-mplayer ") def test_1(self, completion): assert completion - @pytest.mark.complete("gnome-mplayer -") + # XDG_DATA_DIRS set to a dir with no schemas results in + # "GLib-GIO-ERROR **: No GSettings schemas are installed on the system" + # and a core dump on --help on Ubuntu 14. + @pytest.mark.complete("gnome-mplayer -", pre_cmds=("unset XDG_DATA_DIRS",)) def test_2(self, completion): assert completion From d5fa7e31e2f88a438d224adde89e15c14e173ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 24 Jun 2019 07:34:44 -0400 Subject: [PATCH 0232/1094] test: remove unnecessary returns after pytest.skip pytest.skip raises. --- test/t/conftest.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/t/conftest.py b/test/t/conftest.py index 029c73c71ea..58ed202ad81 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -141,7 +141,6 @@ def bash(request) -> pexpect.spawn: else: bash.close() pytest.skip(skipif) - return xfail = marker.kwargs.get("xfail") if xfail: try: @@ -190,7 +189,6 @@ def is_testable(bash: pexpect.spawn, cmd: str) -> bool: return False if not load_completion_for(bash, cmd): pytest.skip("No completion for command %s" % cmd) - return False return True @@ -377,7 +375,6 @@ def assert_complete( pass else: pytest.skip(skipif) - return CompletionResult("", []) xfail = kwargs.get("xfail") if xfail: try: From 1f7fdc67d3e015156d4622e6904a728f3717dadb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 24 Jun 2019 07:45:47 -0400 Subject: [PATCH 0233/1094] test: fix acroread fixture dir --- test/t/test_acroread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/t/test_acroread.py b/test/t/test_acroread.py index 471b93c251a..22d60240503 100644 --- a/test/t/test_acroread.py +++ b/test/t/test_acroread.py @@ -2,6 +2,6 @@ class TestAcroread: - @pytest.mark.complete("acroread ", cwd="fixtures/acroread") + @pytest.mark.complete("acroread ", cwd="acroread") def test_1(self, completion): assert completion == "foo.d/ t.pdf".split() From 322ec19f06d4ec2ea32c861c023fb9644985150a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 26 Jun 2019 07:56:00 -0400 Subject: [PATCH 0234/1094] test: installpkg test fixes --- test/t/test_installpkg.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/t/test_installpkg.py b/test/t/test_installpkg.py index 4e5ab27c9c0..e665f52391f 100644 --- a/test/t/test_installpkg.py +++ b/test/t/test_installpkg.py @@ -21,18 +21,18 @@ def test_3(self, completion): dirs = sorted(x for x in os.listdir(".") if os.path.isdir("./%s" % x)) assert completion == ["%s/" % x for x in dirs] - @pytest.mark.complete("installpkg --root ") + @pytest.mark.complete("installpkg ", cwd="slackware/home") def test_4(self, completion): expected = sorted( [ "%s/" % x for x in os.listdir("slackware/home") - if os.path.isdir("./%s" % x) + if os.path.isdir("./slackware/home/%s" % x) ] + [ x for x in os.listdir("slackware/home") - if os.path.isfile("./%s" % x) + if os.path.isfile("./slackware/home/%s" % x) and fnmatch.fnmatch(x, "*.t[bglx]z") ] ) From 8b8783c48d58f0320fd72fa7805643a0f7615311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 26 Jun 2019 18:36:55 -0400 Subject: [PATCH 0235/1094] java: make jar/zip listing work with unzip It's faster than jar, and makes things work in the (rather unusual) scenario where zipinfo and jar aren't installed. --- completions/java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/completions/java b/completions/java index 3ca65869c39..1b3d29918f0 100644 --- a/completions/java +++ b/completions/java @@ -64,6 +64,11 @@ _java_classes() if type zipinfo &>/dev/null; then COMPREPLY+=( $(zipinfo -1 "$i" "$cur*" 2>/dev/null | \ command grep '^[^$]*\.class$') ) + elif type unzip &>/dev/null; then + # Last column, between entries consisting entirely of dashes + COMPREPLY+=( $(unzip -lq "$i" "$cur*" 2>/dev/null | \ + awk '$NF ~ /^-+$/ { flag=!flag; next }; + flag && $NF ~ /^[^$]*\.class/ { print $NF }') ) else COMPREPLY+=( $(jar tf "$i" "$cur" | \ command grep '^[^$]*\.class$') ) From 87ba114a2da100e4002240060a41b89fb9bbfdb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 26 Jun 2019 20:28:41 -0400 Subject: [PATCH 0236/1094] test: use sh +* as ccache command test case ls doesn't necessarily have long options. --- test/t/test_ccache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/t/test_ccache.py b/test/t/test_ccache.py index 573e3e44991..633edd58605 100644 --- a/test/t/test_ccache.py +++ b/test/t/test_ccache.py @@ -22,6 +22,6 @@ def test_4(self, completion): def test_5(self, completion): assert "--help" in completion - @pytest.mark.complete("ccache --zero-stats ls --hel") + @pytest.mark.complete("ccache --zero-stats sh +") def test_6(self, completion): - assert "--help" in completion + assert "+x" in completion From 970eab95140451c04a11a515d9ee860154fce9d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 29 Jun 2019 10:06:27 -0400 Subject: [PATCH 0237/1094] test: avoid some sed -r/-E runLint false positives --- test/runLint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/runLint b/test/runLint index 8699d7a0a99..a84c46d89c6 100755 --- a/test/runLint +++ b/test/runLint @@ -32,7 +32,7 @@ gitgrep $cmdstart'sed\b.*\\\|' \ #gitgrep $cmdstart'sed\b.*;' \ # 'sed with ;, use multiple -e options instead (POSIX?) (false positives?)' -gitgrep $cmdstart'sed\b.*-[^[:space:]]*[rE]' \ +gitgrep $cmdstart'sed\b.*[[:space:]]-[^[:space:]]*[rE]' \ 'sed with -r or -E, drop and use POSIX BRE instead' gitgrep $cmdstart'[ef]grep\b' \ From 151ac18040eb27533ebca4815c6286e2d758c0f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 29 Jun 2019 10:07:20 -0400 Subject: [PATCH 0238/1094] ipv6calc: parse help instead of hardcoding option list --- completions/ipv6calc | 9 ++------- test/t/test_ipv6calc.py | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/completions/ipv6calc b/completions/ipv6calc index f001999a16a..6a5771efe1e 100644 --- a/completions/ipv6calc +++ b/completions/ipv6calc @@ -28,13 +28,8 @@ _ipv6calc() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '--help --debug --quiet --in --out --action - --examples --showinfo --show_types --machine_readable --db-geoip - --db-geoip-default --db-ip2location-ipv4 --db-ip2location-ipv6 - --lowercase --uppercase --printprefix --printsuffix --maskprefix - --masksuffix --printstart --printend --printcompressed - --printuncompressed --printfulluncompressed --printmirrored' \ - -- "$cur") ) + COMPREPLY=( $(compgen -W '$("$1" -h 2>&1 | + command sed -e "s/[][]//g" | _parse_help -)' -- "$cur") ) fi } && diff --git a/test/t/test_ipv6calc.py b/test/t/test_ipv6calc.py index 435af149656..99adb9e30b0 100644 --- a/test/t/test_ipv6calc.py +++ b/test/t/test_ipv6calc.py @@ -4,7 +4,7 @@ class TestIpv6calc: @pytest.mark.complete("ipv6calc -") def test_1(self, completion): - assert completion + assert "--action" in completion @pytest.mark.complete("ipv6calc --in ") def test_2(self, completion): From a8d548950f6a79e14c131251091026730c2ddb49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 29 Jun 2019 10:50:35 -0400 Subject: [PATCH 0239/1094] lvm pv*, vg*: parse help instead of hardcoding option list --- completions/lvm | 20 +++++--------------- test/t/test_pvmove.py | 2 +- test/t/test_pvscan.py | 2 +- test/t/test_vgchange.py | 2 +- test/t/test_vgcreate.py | 2 +- test/t/test_vgsplit.py | 2 +- 6 files changed, 10 insertions(+), 20 deletions(-) diff --git a/completions/lvm b/completions/lvm index 63048aebef7..712838c8ec6 100644 --- a/completions/lvm +++ b/completions/lvm @@ -81,9 +81,7 @@ _pvscan() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '--debug --exported --novolumegroup --help - --ignorelockingfailure --partial --short --uuid --verbose - --version' -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) fi } && complete -F _pvscan pvscan @@ -201,9 +199,7 @@ _pvmove() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '--abort --autobackup --background --debug - --force --help --interval --test --verbose --version --name' \ - -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_physicalvolumes fi @@ -294,10 +290,7 @@ _vgchange() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '--autobackup --alloc --partial --debug - --help --ignorelockingfailure --test --uuid --verbose --version - --available --resizeable --logicalvolume --addtag --deltag' \ - -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_volumegroups fi @@ -325,9 +318,7 @@ _vgcreate() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '--autobackup --addtag --alloc --debug --help - --maxlogicalvolumes --metadatatype --maxphysicalvolumes - --physicalextentsize --test --verbose --version' -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else local args _lvm_count_args '@(-A|--autobackup|-M|--metadatatype|-s|--physicalextentsize)' @@ -569,8 +560,7 @@ _vgsplit() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '--autobackup --debug --help --list - --metadatatype --test --verbose --version' -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else local args _lvm_count_args '@(-A|--autobackup|-M|--metadatatype)' diff --git a/test/t/test_pvmove.py b/test/t/test_pvmove.py index e1b06dd6547..d4b0ad33214 100644 --- a/test/t/test_pvmove.py +++ b/test/t/test_pvmove.py @@ -2,6 +2,6 @@ class TestPvmove: - @pytest.mark.complete("pvmove --") + @pytest.mark.complete("pvmove --", xfail="! pvmove --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_pvscan.py b/test/t/test_pvscan.py index 1ae237fc5af..16361f37acb 100644 --- a/test/t/test_pvscan.py +++ b/test/t/test_pvscan.py @@ -2,6 +2,6 @@ class TestPvscan: - @pytest.mark.complete("pvscan --") + @pytest.mark.complete("pvscan --", xfail="! pvscan --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgchange.py b/test/t/test_vgchange.py index 0e268bad57c..ac2cb49027f 100644 --- a/test/t/test_vgchange.py +++ b/test/t/test_vgchange.py @@ -2,6 +2,6 @@ class TestVgchange: - @pytest.mark.complete("vgchange -") + @pytest.mark.complete("vgchange -", xfail="! vgchange --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgcreate.py b/test/t/test_vgcreate.py index 07518e584df..0042e6ef990 100644 --- a/test/t/test_vgcreate.py +++ b/test/t/test_vgcreate.py @@ -2,7 +2,7 @@ class TestVgcreate: - @pytest.mark.complete("vgcreate -") + @pytest.mark.complete("vgcreate -", xfail="! vgcreate --help &>/dev/null") def test_1(self, completion): assert completion diff --git a/test/t/test_vgsplit.py b/test/t/test_vgsplit.py index 7b5a68697f5..ddf2ff71e07 100644 --- a/test/t/test_vgsplit.py +++ b/test/t/test_vgsplit.py @@ -2,6 +2,6 @@ class TestVgsplit: - @pytest.mark.complete("vgsplit -") + @pytest.mark.complete("vgsplit -", xfail="! vgsplit --help &>/dev/null") def test_1(self, completion): assert completion From 669c3fe142f50d1f72c57c9639169691598622a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 29 Jun 2019 14:57:15 -0400 Subject: [PATCH 0240/1094] test: portinstall/upgrade test case and setup fixes --- test/t/test_portinstall.py | 5 +++-- test/t/test_portupgrade.py | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/t/test_portinstall.py b/test/t/test_portinstall.py index 62fddbfbe30..eb2118e5204 100644 --- a/test/t/test_portinstall.py +++ b/test/t/test_portinstall.py @@ -3,10 +3,11 @@ from conftest import assert_bash_exec +@pytest.mark.bashcomp(ignore_env=r"^[+-]PORTSDIR=") class TestPortinstall: @pytest.fixture(scope="class") def portsdir(self, request, bash): - assert_bash_exec(bash, "PORTSDIR=$TESTDIR/tmp") + assert_bash_exec(bash, "PORTSDIR=$PWD/../tmp") assert_bash_exec( bash, "command sed -e s,PORTSDIR,$PORTSDIR,g " @@ -17,7 +18,7 @@ def portsdir(self, request, bash): lambda: assert_bash_exec(bash, "rm $PORTSDIR/INDEX{,-5}") ) - @pytest.mark.complete("portinstall ", env=dict(PORTSDIR="$TESTDIR/tmp")) + @pytest.mark.complete("portinstall ", env=dict(PORTSDIR="$PWD/../tmp")) def test_1(self, completion, portsdir): assert ( completion diff --git a/test/t/test_portupgrade.py b/test/t/test_portupgrade.py index aaff5c10198..0b46bbf4907 100644 --- a/test/t/test_portupgrade.py +++ b/test/t/test_portupgrade.py @@ -1,9 +1,8 @@ import pytest -@pytest.mark.bashcomp(pre_cmds=("PKG_DBDIR=$PWD/dbtools/db",)) +@pytest.mark.bashcomp(pre_cmds=("PKG_DBDIR=$PWD/pkgtools/db",)) class TestPortupgrade: @pytest.mark.complete("portupgrade ") def test_1(self, completion): assert completion == "a b-c-d".split() - assert completion.endswith(" ") From d375b638160d9dea43528dc99054db0a0d5d4497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 29 Jun 2019 14:58:59 -0400 Subject: [PATCH 0241/1094] pkgutil: fix $i leak --- completions/pkgutil | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/pkgutil b/completions/pkgutil index bafb9aab9c2..febc2135741 100644 --- a/completions/pkgutil +++ b/completions/pkgutil @@ -21,7 +21,7 @@ _pkgutil() declare -a configuration_files=("/opt/csw/etc/pkgutil.conf" "/etc/opt/csw/pkgutil.conf") declare -a catalog_files=() - i=$cword + local i=$cword while [[ $((i--)) -gt 1 ]]; do if [[ "${words[$i]}" == -@(t|-temp) ]]; then local url="${words[$((i+1))]}" From 07e8dc6c89c81f72093ef1ff7dcd29b87016c2ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 29 Jun 2019 15:20:27 -0400 Subject: [PATCH 0242/1094] pkg-get: fix $i leak --- completions/pkg-get | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/pkg-get b/completions/pkg-get index ea300b8b2a2..2f2513389c2 100644 --- a/completions/pkg-get +++ b/completions/pkg-get @@ -36,7 +36,7 @@ _pkg_get() return 1 fi - i=${#COMP_WORDS[*]} + local i=${#COMP_WORDS[*]} while [[ $i -gt 0 ]]; do if [[ "${COMP_WORDS[--i]}" == -s ]]; then url="${COMP_WORDS[$((i+1))]}" From a95166674def153222d46346863a456f73803877 Mon Sep 17 00:00:00 2001 From: ezr Date: Sat, 29 Jun 2019 15:15:23 -0500 Subject: [PATCH 0243/1094] chromium-browser: Add support for .mhtml files Chromium can open MHTML documents (single-page html files). This adds support for opening files with the `.mhtm?(l)` file extension. Closes https://github.com/scop/bash-completion/pull/329 --- completions/chromium-browser | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/chromium-browser b/completions/chromium-browser index ad27c0f50cd..a26b04f22d3 100644 --- a/completions/chromium-browser +++ b/completions/chromium-browser @@ -42,7 +42,7 @@ _chromium_browser() return fi - _filedir "@(?([xs])htm?(l)|pdf)" + _filedir "@(?([mxs])htm?(l)|pdf)" } && complete -F _chromium_browser chromium-browser google-chrome \ google-chrome-stable chromium chrome From f6d461483ea7c6b3cc6710401cca6ba50c687ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 30 Jun 2019 16:24:45 -0400 Subject: [PATCH 0244/1094] _terms: combine and simplify somewhat --- bash_completion | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bash_completion b/bash_completion index bf7d02c7531..8c5d086ae4c 100644 --- a/bash_completion +++ b/bash_completion @@ -1425,11 +1425,10 @@ _dvd_devices() # TERM environment variable values _terms() { - COMPREPLY+=( $(compgen -W \ - "$(command sed -ne 's/^\([^[:space:]#|]\{2,\}\)|.*/\1/p' /etc/termcap \ - 2>/dev/null)" -- "$cur") ) - COMPREPLY+=( $(compgen -W "$({ toe -a 2>/dev/null || toe 2>/dev/null; } \ - | awk '{ print $1 }' | sort -u)" -- "$cur") ) + COMPREPLY+=( $(compgen -W "$({ \ + command sed -ne 's/^\([^[:space:]#|]\{2,\}\)|.*/\1/p' /etc/termcap; + { toe -a || toe; } | awk '{ print $1 }'; + } 2>/dev/null)" -- "$cur") ) } # a little help for FreeBSD ports users From 88ed3c712df1b72d730496e736faba493488e892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 30 Jun 2019 16:28:11 -0400 Subject: [PATCH 0245/1094] _terms: search directly from various terminfo dirs For example a minimal Alpine Linux setup doesn't have /etc/termcap or toe, but has these populated. --- bash_completion | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bash_completion b/bash_completion index 8c5d086ae4c..143cc70e596 100644 --- a/bash_completion +++ b/bash_completion @@ -1428,6 +1428,8 @@ _terms() COMPREPLY+=( $(compgen -W "$({ \ command sed -ne 's/^\([^[:space:]#|]\{2,\}\)|.*/\1/p' /etc/termcap; { toe -a || toe; } | awk '{ print $1 }'; + find /{etc,lib,usr/lib,usr/share}/terminfo/? -type f -maxdepth 1 \ + | awk -F/ '{ print $NF }'; } 2>/dev/null)" -- "$cur") ) } From 9838cbfaf9e508b1ec1ad05959d89f3cf9e5d719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 30 Jun 2019 16:50:56 -0400 Subject: [PATCH 0246/1094] test: mark sbcl-mt xfail due to whitespace split issues --- test/t/test_sbcl_mt.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/t/test_sbcl_mt.py b/test/t/test_sbcl_mt.py index 860acc2f49a..d8049f3f1c8 100644 --- a/test/t/test_sbcl_mt.py +++ b/test/t/test_sbcl_mt.py @@ -3,6 +3,7 @@ @pytest.mark.bashcomp(cmd="sbcl-mt") class TestSbclMt: + @pytest.mark.xfail # TODO: whitespace split issue @pytest.mark.complete("sbcl-mt shared/default/") def test_1(self, completion): assert completion == ["bar", "bar bar.d/", "foo", "foo foo.d/"] From f40a1ca85658c9d7cc8366ac6766098f78b69412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 4 Jul 2019 11:21:18 +0300 Subject: [PATCH 0247/1094] test: explodepkg and upgradepkg test fixes --- test/t/test_explodepkg.py | 17 +++++++++++------ test/t/test_upgradepkg.py | 4 ++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/test/t/test_explodepkg.py b/test/t/test_explodepkg.py index 29463dfdf1b..940fec80810 100644 --- a/test/t/test_explodepkg.py +++ b/test/t/test_explodepkg.py @@ -8,11 +8,16 @@ class TestExplodepkg: @pytest.mark.complete("explodepkg ", cwd="slackware/home") def test_1(self, completion): expected = sorted( - x - for x in os.listdir("slackware/home") - if os.path.isdir("./%s" % x) - or ( - os.path.isfile("./%s" % x) and fnmatch.fnmatch(x, "*.t[bglx]z") - ) + [ + "%s/" % x + for x in os.listdir("slackware/home") + if os.path.isdir("./slackware/home/%s" % x) + ] + + [ + x + for x in os.listdir("slackware/home") + if os.path.isfile("./slackware/home/%s" % x) + and fnmatch.fnmatch(x, "*.t[bglx]z") + ] ) assert completion == expected diff --git a/test/t/test_upgradepkg.py b/test/t/test_upgradepkg.py index ada84f1c442..4c72a158169 100644 --- a/test/t/test_upgradepkg.py +++ b/test/t/test_upgradepkg.py @@ -22,12 +22,12 @@ def test_4(self, completion): [ "%s/" % x for x in os.listdir("slackware/home") - if os.path.isdir("./%s" % x) + if os.path.isdir("./slackware/home/%s" % x) ] + [ x for x in os.listdir("slackware/home") - if os.path.isfile("./%s" % x) + if os.path.isfile("./slackware/home/%s" % x) and fnmatch.fnmatch(x, "*.t[bglx]z") ] ) From 674dd805ba3639c7b507fd997fdf6e97708d84be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 26 Jun 2019 18:52:38 -0400 Subject: [PATCH 0248/1094] test: always run tests which don't require tested command --- test/t/conftest.py | 13 +++++++++---- test/t/test_2to3.py | 2 +- test/t/test_7z.py | 2 +- test/t/test_a2x.py | 2 +- test/t/test_abook.py | 2 +- test/t/test_aclocal.py | 2 +- test/t/test_acpi.py | 2 +- test/t/test_adb.py | 2 +- test/t/test_alpine.py | 2 +- test/t/test_ant.py | 2 +- test/t/test_appdata_validate.py | 2 +- test/t/test_apt_cache.py | 2 +- test/t/test_arpspoof.py | 2 +- test/t/test_asciidoc.py | 2 +- test/t/test_automake.py | 2 +- test/t/test_autoscan.py | 2 +- test/t/test_autossh.py | 2 +- test/t/test_badblocks.py | 2 +- test/t/test_bash.py | 2 +- test/t/test_bc.py | 1 + test/t/test_bison.py | 2 +- test/t/test_cal.py | 2 +- test/t/test_ccache.py | 6 +++--- test/t/test_ccze.py | 4 ++-- test/t/test_cfagent.py | 2 +- test/t/test_chage.py | 2 +- test/t/test_checksec.py | 2 +- test/t/test_chronyc.py | 4 ++-- test/t/test_chrpath.py | 2 +- test/t/test_chsh.py | 2 +- test/t/test_civclient.py | 2 +- test/t/test_civserver.py | 2 +- test/t/test_cksfv.py | 2 +- test/t/test_convert.py | 2 +- test/t/test_cpan2dist.py | 2 +- test/t/test_cppcheck.py | 2 +- test/t/test_cryptsetup.py | 2 +- test/t/test_curl.py | 2 +- test/t/test_cvs.py | 2 +- test/t/test_cvsps.py | 2 +- test/t/test_deja_dup.py | 2 +- test/t/test_desktop_file_validate.py | 2 +- test/t/test_dhclient.py | 2 +- test/t/test_dict.py | 2 +- test/t/test_diff.py | 2 +- test/t/test_display.py | 2 +- test/t/test_dnsspoof.py | 2 +- test/t/test_dpkg.py | 2 +- test/t/test_dpkg_deb.py | 2 +- test/t/test_dselect.py | 2 +- test/t/test_dumpe2fs.py | 2 +- test/t/test_e2freefrag.py | 2 +- test/t/test_ecryptfs_migrate_home.py | 4 ++-- test/t/test_enscript.py | 2 +- test/t/test_env.py | 1 + test/t/test_eog.py | 2 +- test/t/test_ether_wake.py | 2 +- test/t/test_evince.py | 2 +- test/t/test_expand.py | 1 + test/t/test_faillog.py | 2 +- test/t/test_feh.py | 4 +++- test/t/test_file.py | 2 +- test/t/test_filefrag.py | 2 +- test/t/test_filesnarf.py | 2 +- test/t/test_fio.py | 2 +- test/t/test_firefox.py | 2 +- test/t/test_fmt.py | 4 +++- test/t/test_fold.py | 1 + test/t/test_freeciv.py | 2 +- test/t/test_freeciv_server.py | 2 +- test/t/test_fusermount.py | 2 +- test/t/test_genisoimage.py | 2 +- test/t/test_geoiplookup.py | 2 +- test/t/test_getent.py | 1 + test/t/test_gkrellm.py | 2 +- test/t/test_gm.py | 6 +++--- test/t/test_gnokii.py | 4 ++-- test/t/test_gnome_mplayer.py | 4 +++- test/t/test_gnome_screenshot.py | 2 +- test/t/test_gpasswd.py | 2 +- test/t/test_gperf.py | 2 +- test/t/test_gpg2.py | 2 +- test/t/test_gpgv.py | 2 +- test/t/test_gphoto2.py | 2 +- test/t/test_grep.py | 1 + test/t/test_groupadd.py | 2 +- test/t/test_groupdel.py | 2 +- test/t/test_groupmems.py | 2 +- test/t/test_groupmod.py | 2 +- test/t/test_grpck.py | 2 +- test/t/test_grub.py | 2 +- test/t/test_gssdp_discover.py | 2 +- test/t/test_gzip.py | 2 +- test/t/test_hcitool.py | 2 +- test/t/test_head.py | 1 + test/t/test_host.py | 2 +- test/t/test_hping2.py | 2 +- test/t/test_htop.py | 2 +- test/t/test_htpasswd.py | 2 +- test/t/test_hunspell.py | 2 +- test/t/test_identify.py | 2 +- test/t/test_idn.py | 2 +- test/t/test_ifstat.py | 6 ++++-- test/t/test_iftop.py | 4 ++-- test/t/test_influx.py | 4 ++-- test/t/test_info.py | 2 +- test/t/test_inotifywait.py | 4 ++-- test/t/test_inotifywatch.py | 4 ++-- test/t/test_interdiff.py | 2 +- test/t/test_iperf.py | 8 ++++---- test/t/test_iperf3.py | 6 +++--- test/t/test_ipmitool.py | 2 +- test/t/test_iptables.py | 2 +- test/t/test_ipv6calc.py | 4 ++-- test/t/test_isort.py | 2 +- test/t/test_java.py | 2 +- test/t/test_javaws.py | 2 +- test/t/test_jpegoptim.py | 2 +- test/t/test_jshint.py | 2 +- test/t/test_jsonschema.py | 2 +- test/t/test_k3b.py | 2 +- test/t/test_kcov.py | 2 +- test/t/test_killall.py | 2 +- test/t/test_koji.py | 4 ++-- test/t/test_l2ping.py | 2 +- test/t/test_lastlog.py | 2 +- test/t/test_ldapvi.py | 2 +- test/t/test_less.py | 1 + test/t/test_lftp.py | 2 +- test/t/test_links.py | 2 +- test/t/test_locale_gen.py | 5 +++-- test/t/test_lrzip.py | 2 +- test/t/test_ls.py | 4 +++- test/t/test_lspci.py | 4 ++-- test/t/test_lsscsi.py | 2 +- test/t/test_lua.py | 2 +- test/t/test_luac.py | 2 +- test/t/test_luseradd.py | 2 +- test/t/test_luserdel.py | 2 +- test/t/test_lvchange.py | 4 +++- test/t/test_lvcreate.py | 4 +++- test/t/test_lvdisplay.py | 4 +++- test/t/test_lvextend.py | 4 +++- test/t/test_lvmdiskscan.py | 4 +++- test/t/test_lvreduce.py | 4 +++- test/t/test_lvremove.py | 4 +++- test/t/test_lvrename.py | 4 +++- test/t/test_lvresize.py | 4 +++- test/t/test_lvs.py | 4 +++- test/t/test_lvscan.py | 4 +++- test/t/test_lz4.py | 2 +- test/t/test_lzip.py | 2 +- test/t/test_m4.py | 4 +++- test/t/test_macof.py | 2 +- test/t/test_mailsnarf.py | 2 +- test/t/test_make.py | 2 +- test/t/test_man.py | 25 +++++++++++++++++++------ test/t/test_mc.py | 2 +- test/t/test_mcrypt.py | 6 +++--- test/t/test_medusa.py | 2 +- test/t/test_mencoder.py | 2 +- test/t/test_mii_diag.py | 2 +- test/t/test_mii_tool.py | 2 +- test/t/test_minicom.py | 2 +- test/t/test_mock.py | 4 +++- test/t/test_monodevelop.py | 2 +- test/t/test_mplayer.py | 2 +- test/t/test_msgsnarf.py | 2 +- test/t/test_munin_node_configure.py | 1 + test/t/test_munin_run.py | 2 +- test/t/test_munindoc.py | 3 ++- test/t/test_mussh.py | 2 +- test/t/test_mutt.py | 2 +- test/t/test_mypy.py | 2 +- test/t/test_mysqladmin.py | 2 +- test/t/test_ncftp.py | 2 +- test/t/test_nethogs.py | 2 +- test/t/test_newlist.py | 2 +- test/t/test_newusers.py | 2 +- test/t/test_ngrep.py | 2 +- test/t/test_nsupdate.py | 2 +- test/t/test_ntpdate.py | 2 +- test/t/test_oggdec.py | 2 +- test/t/test_op.py | 4 ++-- test/t/test_opera.py | 2 +- test/t/test_optipng.py | 2 +- test/t/test_patch.py | 2 +- test/t/test_pdftotext.py | 2 +- test/t/test_perlcritic.py | 4 ++-- test/t/test_perltidy.py | 6 +++--- test/t/test_pgrep.py | 2 +- test/t/test_phing.py | 4 ++-- test/t/test_pidof.py | 4 +++- test/t/test_pine.py | 2 +- test/t/test_pinfo.py | 2 +- test/t/test_pkg_config.py | 2 +- test/t/test_pkgadd.py | 3 ++- test/t/test_pkgrm.py | 3 ++- test/t/test_pkill.py | 2 +- test/t/test_pngfix.py | 2 +- test/t/test_postcat.py | 2 +- test/t/test_postconf.py | 6 ++++-- test/t/test_postfix.py | 2 +- test/t/test_postmap.py | 2 +- test/t/test_prelink.py | 2 +- test/t/test_protoc.py | 2 +- test/t/test_psql.py | 4 +++- test/t/test_pv.py | 2 +- test/t/test_pvchange.py | 4 +++- test/t/test_pvcreate.py | 4 +++- test/t/test_pvdisplay.py | 4 +++- test/t/test_pvmove.py | 4 +++- test/t/test_pvremove.py | 4 +++- test/t/test_pvs.py | 4 +++- test/t/test_pvscan.py | 4 +++- test/t/test_pwck.py | 2 +- test/t/test_pwdx.py | 1 + test/t/test_pwgen.py | 2 +- test/t/test_pycodestyle.py | 2 +- test/t/test_pydoc.py | 4 ++-- test/t/test_pydocstyle.py | 2 +- test/t/test_pyflakes.py | 2 +- test/t/test_pylint.py | 2 +- test/t/test_pylint_3.py | 2 +- test/t/test_python.py | 4 ++-- test/t/test_python3.py | 4 ++-- test/t/test_qemu.py | 2 +- test/t/test_querybts.py | 2 +- test/t/test_quota.py | 2 +- test/t/test_quotacheck.py | 2 +- test/t/test_quotaon.py | 2 +- test/t/test_radvdump.py | 4 ++-- test/t/test_rdesktop.py | 2 +- test/t/test_rdict.py | 2 +- test/t/test_readelf.py | 2 +- test/t/test_repomanage.py | 2 +- test/t/test_reportbug.py | 2 +- test/t/test_reptyr.py | 2 +- test/t/test_ri.py | 4 ++-- test/t/test_rpm.py | 2 +- test/t/test_rpmbuild.py | 2 +- test/t/test_rtcwake.py | 4 ++-- test/t/test_sbopkg.py | 2 +- test/t/test_scrub.py | 2 +- test/t/test_sed.py | 1 + test/t/test_seq.py | 1 + test/t/test_setquota.py | 2 +- test/t/test_sftp.py | 2 +- test/t/test_sha1sum.py | 1 + test/t/test_shar.py | 2 +- test/t/test_shellcheck.py | 6 +++--- test/t/test_sitecopy.py | 2 +- test/t/test_slapt_get.py | 4 ++-- test/t/test_slapt_src.py | 6 +++--- test/t/test_smbcacls.py | 2 +- test/t/test_smbclient.py | 2 +- test/t/test_smbcquotas.py | 2 +- test/t/test_smbget.py | 2 +- test/t/test_smbpasswd.py | 2 +- test/t/test_smbtar.py | 2 +- test/t/test_smbtree.py | 2 +- test/t/test_snownews.py | 2 +- test/t/test_sort.py | 1 + test/t/test_split.py | 1 + test/t/test_sqlite3.py | 4 ++-- test/t/test_ss.py | 6 +++--- test/t/test_ssh.py | 2 +- test/t/test_ssh_add.py | 1 + test/t/test_ssh_copy_id.py | 2 +- test/t/test_ssh_keygen.py | 2 +- test/t/test_sshmitm.py | 2 +- test/t/test_sshow.py | 2 +- test/t/test_strace.py | 2 +- test/t/test_strings.py | 2 +- test/t/test_strip.py | 2 +- test/t/test_su.py | 2 +- test/t/test_sudo.py | 2 +- test/t/test_synclient.py | 6 ++++-- test/t/test_sysbench.py | 4 ++-- test/t/test_tac.py | 1 + test/t/test_tail.py | 1 + test/t/test_tcpdump.py | 2 +- test/t/test_tcpnice.py | 2 +- test/t/test_texindex.py | 2 +- test/t/test_touch.py | 1 + test/t/test_tr.py | 1 + test/t/test_tracepath.py | 2 +- test/t/test_tshark.py | 10 +++++----- test/t/test_tune2fs.py | 2 +- test/t/test_udevadm.py | 4 ++-- test/t/test_uname.py | 1 + test/t/test_unexpand.py | 1 + test/t/test_uniq.py | 1 + test/t/test_units.py | 4 +++- test/t/test_unshunt.py | 2 +- test/t/test_urlsnarf.py | 2 +- test/t/test_uscan.py | 2 +- test/t/test_useradd.py | 2 +- test/t/test_userdel.py | 2 +- test/t/test_usermod.py | 2 +- test/t/test_valgrind.py | 8 +++++--- test/t/test_vgcfgbackup.py | 4 +++- test/t/test_vgcfgrestore.py | 4 +++- test/t/test_vgchange.py | 4 +++- test/t/test_vgck.py | 4 +++- test/t/test_vgconvert.py | 2 +- test/t/test_vgcreate.py | 6 ++++-- test/t/test_vgdisplay.py | 2 +- test/t/test_vgexport.py | 4 +++- test/t/test_vgextend.py | 4 +++- test/t/test_vgimport.py | 4 +++- test/t/test_vgmerge.py | 4 +++- test/t/test_vgmknodes.py | 2 +- test/t/test_vgreduce.py | 4 +++- test/t/test_vgremove.py | 4 +++- test/t/test_vgrename.py | 4 +++- test/t/test_vgs.py | 4 +++- test/t/test_vgscan.py | 4 +++- test/t/test_vgsplit.py | 4 +++- test/t/test_vipw.py | 2 +- test/t/test_vmstat.py | 2 +- test/t/test_vpnc.py | 2 +- test/t/test_wc.py | 1 + test/t/test_webmitm.py | 2 +- test/t/test_who.py | 4 +++- test/t/test_wol.py | 2 +- test/t/test_wsimport.py | 1 + test/t/test_wtf.py | 3 ++- test/t/test_wvdial.py | 2 +- test/t/test_xdg_settings.py | 4 ++-- test/t/test_xfreerdp.py | 14 +++++++------- test/t/test_xgamma.py | 4 ++-- test/t/test_xmllint.py | 2 +- test/t/test_xmlwf.py | 2 +- test/t/test_xmms.py | 2 +- test/t/test_xrandr.py | 4 ++-- test/t/test_xrdb.py | 2 +- test/t/test_xsltproc.py | 2 +- test/t/test_xz.py | 2 +- test/t/test_xzdec.py | 2 +- test/t/test_ypcat.py | 2 +- test/t/test_ypmatch.py | 3 ++- test/t/test_yum.py | 2 +- test/t/test_zopfli.py | 2 +- test/t/test_zopflipng.py | 2 +- 345 files changed, 534 insertions(+), 391 deletions(-) diff --git a/test/t/conftest.py b/test/t/conftest.py index 58ed202ad81..eb2d62bb1cd 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -156,6 +156,8 @@ def bash(request) -> pexpect.spawn: if match: cmd = match.group(1) + setattr(request.cls, "cmd", cmd) + if (cmd_found and cmd is None) or is_testable(bash, cmd): before_env = get_env(bash) yield bash @@ -184,15 +186,14 @@ def is_testable(bash: pexpect.spawn, cmd: str) -> bool: if not cmd: pytest.fail("Could not resolve name of command to test") return False - if not is_bash_type(bash, cmd): - pytest.skip("Command %s not found" % cmd) - return False if not load_completion_for(bash, cmd): pytest.skip("No completion for command %s" % cmd) return True -def is_bash_type(bash: pexpect.spawn, cmd: str) -> bool: +def is_bash_type(bash: pexpect.spawn, cmd: Optional[str]) -> bool: + if not cmd: + return False typecmd = "type %s &>/dev/null && echo -n 0 || echo -n 1" % cmd bash.sendline(typecmd) bash.expect_exact(typecmd + "\r\n") @@ -453,6 +454,10 @@ def completion(request, bash: pexpect.spawn) -> CompletionResult: return CompletionResult("", []) for pre_cmd in marker.kwargs.get("pre_cmds", []): assert_bash_exec(bash, pre_cmd) + if marker.kwargs.get("require_cmd") and not is_bash_type( + bash, getattr(request.module, "cmd", None) + ): + pytest.skip("Command not found") return assert_complete(bash, marker.args[0], **marker.kwargs) diff --git a/test/t/test_2to3.py b/test/t/test_2to3.py index 3c8afea9de8..030fb261fb0 100644 --- a/test/t/test_2to3.py +++ b/test/t/test_2to3.py @@ -6,6 +6,6 @@ class Test2to3: def test_1(self, completion): assert completion - @pytest.mark.complete("2to3 -") + @pytest.mark.complete("2to3 -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_7z.py b/test/t/test_7z.py index 7d68c7b2be8..c6e73890249 100644 --- a/test/t/test_7z.py +++ b/test/t/test_7z.py @@ -20,7 +20,7 @@ def test_3(self, completion): def test_4(self, completion): assert completion == "a.7z" - @pytest.mark.complete("7z d a.7z ", cwd="7z") + @pytest.mark.complete("7z d a.7z ", cwd="7z", require_cmd=True) def test_5(self, completion): assert completion == "abc" diff --git a/test/t/test_a2x.py b/test/t/test_a2x.py index 7847ed86f26..4bfb4283c82 100644 --- a/test/t/test_a2x.py +++ b/test/t/test_a2x.py @@ -6,6 +6,6 @@ class TestA2x: def test_1(self, completion): assert completion - @pytest.mark.complete("a2x -") + @pytest.mark.complete("a2x -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_abook.py b/test/t/test_abook.py index 1df910cfd54..9542a4c9f42 100644 --- a/test/t/test_abook.py +++ b/test/t/test_abook.py @@ -2,6 +2,6 @@ class TestAbook: - @pytest.mark.complete("abook -") + @pytest.mark.complete("abook -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_aclocal.py b/test/t/test_aclocal.py index 52e19f6e4ac..ad28b42bb17 100644 --- a/test/t/test_aclocal.py +++ b/test/t/test_aclocal.py @@ -6,6 +6,6 @@ class TestAclocal: def test_1(self, completion): assert completion - @pytest.mark.complete("aclocal -") + @pytest.mark.complete("aclocal -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_acpi.py b/test/t/test_acpi.py index 8da4eaf45dd..bd06d93850f 100644 --- a/test/t/test_acpi.py +++ b/test/t/test_acpi.py @@ -2,6 +2,6 @@ class TestAcpi: - @pytest.mark.complete("acpi -") + @pytest.mark.complete("acpi -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_adb.py b/test/t/test_adb.py index 304ba754f30..74b0d37275c 100644 --- a/test/t/test_adb.py +++ b/test/t/test_adb.py @@ -6,6 +6,6 @@ class TestAdb: def test_1(self, completion): assert completion - @pytest.mark.complete("adb -") + @pytest.mark.complete("adb -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_alpine.py b/test/t/test_alpine.py index a8a83a0b1a8..dcc05d30726 100644 --- a/test/t/test_alpine.py +++ b/test/t/test_alpine.py @@ -2,6 +2,6 @@ class TestAlpine: - @pytest.mark.complete("alpine -") + @pytest.mark.complete("alpine -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_ant.py b/test/t/test_ant.py index e18b6eb45b0..b14beb944bb 100644 --- a/test/t/test_ant.py +++ b/test/t/test_ant.py @@ -3,7 +3,7 @@ @pytest.mark.bashcomp(ignore_env=r"^\+ANT_ARGS=") class TestAnt: - @pytest.mark.complete("ant -") + @pytest.mark.complete("ant -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_appdata_validate.py b/test/t/test_appdata_validate.py index eeb4ef1728c..8166cf8b180 100644 --- a/test/t/test_appdata_validate.py +++ b/test/t/test_appdata_validate.py @@ -7,6 +7,6 @@ class TestAppdataValidate: def test_1(self, completion): assert completion - @pytest.mark.complete("appdata-validate -") + @pytest.mark.complete("appdata-validate -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_apt_cache.py b/test/t/test_apt_cache.py index 0cb50ef647f..a1c29cdacb9 100644 --- a/test/t/test_apt_cache.py +++ b/test/t/test_apt_cache.py @@ -7,7 +7,7 @@ class TestAptCache: def test_1(self, completion): assert completion - @pytest.mark.complete("apt-cache showsrc [") + @pytest.mark.complete("apt-cache showsrc [", require_cmd=True) def test_2(self, completion): # Doesn't actually fail on grep errors, but takes a long time. assert not completion diff --git a/test/t/test_arpspoof.py b/test/t/test_arpspoof.py index 9fcf20b727a..c8955f8df3c 100644 --- a/test/t/test_arpspoof.py +++ b/test/t/test_arpspoof.py @@ -2,6 +2,6 @@ class TestArpspoof: - @pytest.mark.complete("arpspoof -") + @pytest.mark.complete("arpspoof -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_asciidoc.py b/test/t/test_asciidoc.py index 9f9096c923e..b748dcd1a66 100644 --- a/test/t/test_asciidoc.py +++ b/test/t/test_asciidoc.py @@ -6,6 +6,6 @@ class TestAsciidoc: def test_1(self, completion): assert completion - @pytest.mark.complete("asciidoc -") + @pytest.mark.complete("asciidoc -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_automake.py b/test/t/test_automake.py index a1feeb95acf..2174e0249f5 100644 --- a/test/t/test_automake.py +++ b/test/t/test_automake.py @@ -6,6 +6,6 @@ class TestAutomake: def test_1(self, completion): assert completion - @pytest.mark.complete("automake -") + @pytest.mark.complete("automake -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_autoscan.py b/test/t/test_autoscan.py index ae0014f7901..d3d45a15117 100644 --- a/test/t/test_autoscan.py +++ b/test/t/test_autoscan.py @@ -6,6 +6,6 @@ class TestAutoscan: def test_1(self, completion): assert completion - @pytest.mark.complete("autoscan -") + @pytest.mark.complete("autoscan -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_autossh.py b/test/t/test_autossh.py index e0c86c709a0..864071289c3 100644 --- a/test/t/test_autossh.py +++ b/test/t/test_autossh.py @@ -2,6 +2,6 @@ class TestAutossh: - @pytest.mark.complete("autossh -") + @pytest.mark.complete("autossh -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_badblocks.py b/test/t/test_badblocks.py index 28fd54af609..58130b32188 100644 --- a/test/t/test_badblocks.py +++ b/test/t/test_badblocks.py @@ -6,7 +6,7 @@ class TestBadblocks: def test_1(self, completion): assert completion - @pytest.mark.complete("badblocks -") + @pytest.mark.complete("badblocks -", require_cmd=True) def test_2(self, completion): assert completion assert all(x not in completion for x in "-w -X".split()) diff --git a/test/t/test_bash.py b/test/t/test_bash.py index d6e6959a49c..97a3b8d6f5b 100644 --- a/test/t/test_bash.py +++ b/test/t/test_bash.py @@ -2,6 +2,6 @@ class TestBash: - @pytest.mark.complete("bash --") + @pytest.mark.complete("bash --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_bc.py b/test/t/test_bc.py index 6b0e889bc58..0b9cc184fb0 100644 --- a/test/t/test_bc.py +++ b/test/t/test_bc.py @@ -4,6 +4,7 @@ class TestBc: @pytest.mark.complete( "bc --", + require_cmd=True, xfail=( "! bc --help &>/dev/null || " "! bc --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_bison.py b/test/t/test_bison.py index 47c4908c2fb..a4a481a7915 100644 --- a/test/t/test_bison.py +++ b/test/t/test_bison.py @@ -2,6 +2,6 @@ class TestBison: - @pytest.mark.complete("bison --") + @pytest.mark.complete("bison --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_cal.py b/test/t/test_cal.py index f77390fc7bb..83d17fffcfd 100644 --- a/test/t/test_cal.py +++ b/test/t/test_cal.py @@ -6,6 +6,6 @@ class TestCal: def test_1(self, completion): assert completion - @pytest.mark.complete("cal -") + @pytest.mark.complete("cal -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_ccache.py b/test/t/test_ccache.py index 633edd58605..64620ef4c11 100644 --- a/test/t/test_ccache.py +++ b/test/t/test_ccache.py @@ -2,11 +2,11 @@ class TestCcache: - @pytest.mark.complete("ccache -") + @pytest.mark.complete("ccache -", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("ccache --clea") + @pytest.mark.complete("ccache --clea", require_cmd=True) def test_2(self, completion): assert all(x in completion for x in "--cleanup --clear".split()) @@ -18,7 +18,7 @@ def test_3(self, completion): def test_4(self, completion): assert "stty" in completion - @pytest.mark.complete("ccache --hel") + @pytest.mark.complete("ccache --hel", require_cmd=True) def test_5(self, completion): assert "--help" in completion diff --git a/test/t/test_ccze.py b/test/t/test_ccze.py index c54a1fa141f..abf1234fbb5 100644 --- a/test/t/test_ccze.py +++ b/test/t/test_ccze.py @@ -2,7 +2,7 @@ class TestCcze: - @pytest.mark.complete("ccze ") + @pytest.mark.complete("ccze ", require_cmd=True) def test_1(self, completion): assert completion @@ -14,6 +14,6 @@ def test_2(self, completion): def test_3(self, completion): assert completion - @pytest.mark.complete("ccze --plugin=") + @pytest.mark.complete("ccze --plugin=", require_cmd=True) def test_4(self, completion): assert completion diff --git a/test/t/test_cfagent.py b/test/t/test_cfagent.py index f4b477bcfd5..990fc62e5e0 100644 --- a/test/t/test_cfagent.py +++ b/test/t/test_cfagent.py @@ -2,6 +2,6 @@ class TestCfagent: - @pytest.mark.complete("cfagent -") + @pytest.mark.complete("cfagent -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_chage.py b/test/t/test_chage.py index 383e798910e..3957ae39e20 100644 --- a/test/t/test_chage.py +++ b/test/t/test_chage.py @@ -6,6 +6,6 @@ class TestChage: def test_1(self, completion): assert completion - @pytest.mark.complete("chage -") + @pytest.mark.complete("chage -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_checksec.py b/test/t/test_checksec.py index 4fce13ff2c0..5a11037df8e 100644 --- a/test/t/test_checksec.py +++ b/test/t/test_checksec.py @@ -2,6 +2,6 @@ class TestChecksec: - @pytest.mark.complete("checksec -") + @pytest.mark.complete("checksec -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_chronyc.py b/test/t/test_chronyc.py index fdc91ac5e79..1fee246b655 100644 --- a/test/t/test_chronyc.py +++ b/test/t/test_chronyc.py @@ -2,10 +2,10 @@ class TestChronyc: - @pytest.mark.complete("chronyc ") + @pytest.mark.complete("chronyc ", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("chronyc -") + @pytest.mark.complete("chronyc -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_chrpath.py b/test/t/test_chrpath.py index 036a1a41607..8e94dcb6dc0 100644 --- a/test/t/test_chrpath.py +++ b/test/t/test_chrpath.py @@ -6,6 +6,6 @@ class TestChrpath: def test_1(self, completion): assert completion - @pytest.mark.complete("chrpath -") + @pytest.mark.complete("chrpath -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_chsh.py b/test/t/test_chsh.py index 15e7d83f29b..fe1c7f695f0 100644 --- a/test/t/test_chsh.py +++ b/test/t/test_chsh.py @@ -10,6 +10,6 @@ def test_1(self, completion): def test_2(self, completion): assert completion - @pytest.mark.complete("chsh -") + @pytest.mark.complete("chsh -", require_cmd=True) def test_3(self, completion): assert completion diff --git a/test/t/test_civclient.py b/test/t/test_civclient.py index cff70f4761c..bf0c8d8985a 100644 --- a/test/t/test_civclient.py +++ b/test/t/test_civclient.py @@ -2,6 +2,6 @@ class TestCivclient: - @pytest.mark.complete("civclient -") + @pytest.mark.complete("civclient -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_civserver.py b/test/t/test_civserver.py index b822ddefdc9..0b8e5d510c7 100644 --- a/test/t/test_civserver.py +++ b/test/t/test_civserver.py @@ -2,6 +2,6 @@ class TestCivserver: - @pytest.mark.complete("civserver -") + @pytest.mark.complete("civserver -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_cksfv.py b/test/t/test_cksfv.py index b4df87676bb..b3656597431 100644 --- a/test/t/test_cksfv.py +++ b/test/t/test_cksfv.py @@ -2,6 +2,6 @@ class TestCksfv: - @pytest.mark.complete("cksfv -") + @pytest.mark.complete("cksfv -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_convert.py b/test/t/test_convert.py index bf1615ee051..c903ea0d7f4 100644 --- a/test/t/test_convert.py +++ b/test/t/test_convert.py @@ -10,6 +10,6 @@ def test_1(self, completion): def test_2(self, completion): assert completion - @pytest.mark.complete("convert -") + @pytest.mark.complete("convert -", require_cmd=True) def test_3(self, completion): assert completion diff --git a/test/t/test_cpan2dist.py b/test/t/test_cpan2dist.py index 13feae9e770..f456c0ce64d 100644 --- a/test/t/test_cpan2dist.py +++ b/test/t/test_cpan2dist.py @@ -2,6 +2,6 @@ class TestCpan2dist: - @pytest.mark.complete("cpan2dist -") + @pytest.mark.complete("cpan2dist -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_cppcheck.py b/test/t/test_cppcheck.py index d5e3af9ba7f..da77078615e 100644 --- a/test/t/test_cppcheck.py +++ b/test/t/test_cppcheck.py @@ -6,7 +6,7 @@ class TestCppcheck: def test_1(self, completion): assert completion - @pytest.mark.complete("cppcheck -") + @pytest.mark.complete("cppcheck -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_cryptsetup.py b/test/t/test_cryptsetup.py index b2b368eb639..fdc981b8dcb 100644 --- a/test/t/test_cryptsetup.py +++ b/test/t/test_cryptsetup.py @@ -6,6 +6,6 @@ class TestCryptsetup: def test_1(self, completion): assert completion - @pytest.mark.complete("cryptsetup -") + @pytest.mark.complete("cryptsetup -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_curl.py b/test/t/test_curl.py index 324fba2a31a..974688fae52 100644 --- a/test/t/test_curl.py +++ b/test/t/test_curl.py @@ -2,7 +2,7 @@ class TestCurl: - @pytest.mark.complete("curl --h") + @pytest.mark.complete("curl --h", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_cvs.py b/test/t/test_cvs.py index 411ce6f7c71..ab7fead832e 100644 --- a/test/t/test_cvs.py +++ b/test/t/test_cvs.py @@ -15,6 +15,6 @@ def test_2(self, completion): def test_3(self, completion): assert completion == "foo/bar" - @pytest.mark.complete("cvs -") + @pytest.mark.complete("cvs -", require_cmd=True) def test_4(self, completion): assert completion diff --git a/test/t/test_cvsps.py b/test/t/test_cvsps.py index 0a4da9bae5d..4039893c853 100644 --- a/test/t/test_cvsps.py +++ b/test/t/test_cvsps.py @@ -3,7 +3,7 @@ @pytest.mark.bashcomp(pre_cmds=("HOME=$PWD/cvs",)) class TestCvsps: - @pytest.mark.complete("cvsps -") + @pytest.mark.complete("cvsps -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_deja_dup.py b/test/t/test_deja_dup.py index 1da29e9923a..56e59f9cf3f 100644 --- a/test/t/test_deja_dup.py +++ b/test/t/test_deja_dup.py @@ -3,7 +3,7 @@ @pytest.mark.bashcomp(cmd="deja-dup") class TestDejaDup: - @pytest.mark.complete("deja-dup -") + @pytest.mark.complete("deja-dup -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_desktop_file_validate.py b/test/t/test_desktop_file_validate.py index fd02604060c..ed4b55b8a4a 100644 --- a/test/t/test_desktop_file_validate.py +++ b/test/t/test_desktop_file_validate.py @@ -7,6 +7,6 @@ class TestDesktopFileValidate: def test_1(self, completion): assert completion - @pytest.mark.complete("desktop-file-validate -") + @pytest.mark.complete("desktop-file-validate -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_dhclient.py b/test/t/test_dhclient.py index fdfbd4732d5..c6a1af413cd 100644 --- a/test/t/test_dhclient.py +++ b/test/t/test_dhclient.py @@ -2,6 +2,6 @@ class TestDhclient: - @pytest.mark.complete("dhclient -") + @pytest.mark.complete("dhclient -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_dict.py b/test/t/test_dict.py index 65f6b129747..99c4a21045c 100644 --- a/test/t/test_dict.py +++ b/test/t/test_dict.py @@ -2,6 +2,6 @@ class TestDict: - @pytest.mark.complete("dict -") + @pytest.mark.complete("dict -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_diff.py b/test/t/test_diff.py index 25157bd9d90..eb81506b55f 100644 --- a/test/t/test_diff.py +++ b/test/t/test_diff.py @@ -2,6 +2,6 @@ class TestDiff: - @pytest.mark.complete("diff --") + @pytest.mark.complete("diff --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_display.py b/test/t/test_display.py index 9f5c1004af6..4f076b81c8b 100644 --- a/test/t/test_display.py +++ b/test/t/test_display.py @@ -6,6 +6,6 @@ class TestDisplay: def test_1(self, completion): assert completion - @pytest.mark.complete("display -") + @pytest.mark.complete("display -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_dnsspoof.py b/test/t/test_dnsspoof.py index fae6c430da6..b3380d14559 100644 --- a/test/t/test_dnsspoof.py +++ b/test/t/test_dnsspoof.py @@ -2,6 +2,6 @@ class TestDnsspoof: - @pytest.mark.complete("dnsspoof -") + @pytest.mark.complete("dnsspoof -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_dpkg.py b/test/t/test_dpkg.py index 84860cf87ff..eb1228b7f64 100644 --- a/test/t/test_dpkg.py +++ b/test/t/test_dpkg.py @@ -2,7 +2,7 @@ class TestDpkg: - @pytest.mark.complete("dpkg --c") + @pytest.mark.complete("dpkg --c", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_dpkg_deb.py b/test/t/test_dpkg_deb.py index 4bd7368bed2..c1ad8191167 100644 --- a/test/t/test_dpkg_deb.py +++ b/test/t/test_dpkg_deb.py @@ -3,6 +3,6 @@ @pytest.mark.bashcomp(cmd="dpkg-deb") class TestDpkgDeb: - @pytest.mark.complete("dpkg-deb --c") + @pytest.mark.complete("dpkg-deb --c", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_dselect.py b/test/t/test_dselect.py index 3145cc405f7..8e9d24efaa0 100644 --- a/test/t/test_dselect.py +++ b/test/t/test_dselect.py @@ -6,6 +6,6 @@ class TestDselect: def test_1(self, completion): assert completion - @pytest.mark.complete("dselect -") + @pytest.mark.complete("dselect -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_dumpe2fs.py b/test/t/test_dumpe2fs.py index d1587906f81..eacb1fe1637 100644 --- a/test/t/test_dumpe2fs.py +++ b/test/t/test_dumpe2fs.py @@ -6,6 +6,6 @@ class TestDumpe2fs: def test_1(self, completion): assert completion - @pytest.mark.complete("dumpe2fs -") + @pytest.mark.complete("dumpe2fs -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_e2freefrag.py b/test/t/test_e2freefrag.py index 324f93e5286..10eb41de952 100644 --- a/test/t/test_e2freefrag.py +++ b/test/t/test_e2freefrag.py @@ -6,6 +6,6 @@ class TestE2freefrag: def test_1(self, completion): assert completion - @pytest.mark.complete("e2freefrag -") + @pytest.mark.complete("e2freefrag -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_ecryptfs_migrate_home.py b/test/t/test_ecryptfs_migrate_home.py index 1f567c004f5..f2115d2755f 100644 --- a/test/t/test_ecryptfs_migrate_home.py +++ b/test/t/test_ecryptfs_migrate_home.py @@ -3,10 +3,10 @@ @pytest.mark.bashcomp(cmd="ecryptfs-migrate-home") class TestEcryptfsMigrateHome: - @pytest.mark.complete("ecryptfs-migrate-home ") + @pytest.mark.complete("ecryptfs-migrate-home ", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("ecryptfs-migrate-home -") + @pytest.mark.complete("ecryptfs-migrate-home -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_enscript.py b/test/t/test_enscript.py index 2e4ff51a4e6..97120e3eba9 100644 --- a/test/t/test_enscript.py +++ b/test/t/test_enscript.py @@ -2,6 +2,6 @@ class TestEnscript: - @pytest.mark.complete("enscript --") + @pytest.mark.complete("enscript --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_env.py b/test/t/test_env.py index 431cc36fff8..84228e8190d 100644 --- a/test/t/test_env.py +++ b/test/t/test_env.py @@ -4,6 +4,7 @@ class TestEnv: @pytest.mark.complete( "env --", + require_cmd=True, xfail=( "! env --help &>/dev/null || " "! env --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_eog.py b/test/t/test_eog.py index 670ce89361e..5ae21d9181c 100644 --- a/test/t/test_eog.py +++ b/test/t/test_eog.py @@ -6,6 +6,6 @@ class TestEog: def test_1(self, completion): assert completion - @pytest.mark.complete("eog -") + @pytest.mark.complete("eog -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_ether_wake.py b/test/t/test_ether_wake.py index 4134e42e53f..d33f427fb20 100644 --- a/test/t/test_ether_wake.py +++ b/test/t/test_ether_wake.py @@ -7,6 +7,6 @@ class TestEtherWake: def test_1(self, completion): assert completion - @pytest.mark.complete("ether-wake -") + @pytest.mark.complete("ether-wake -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_evince.py b/test/t/test_evince.py index ec65a4a711f..9e9245de428 100644 --- a/test/t/test_evince.py +++ b/test/t/test_evince.py @@ -17,6 +17,6 @@ def test_1(self, completion): ".tga .TGA .tif .TIF .tiff .TIFF .xpm .XPM .xwd .XWD".split() ) - @pytest.mark.complete("evince -") + @pytest.mark.complete("evince -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_expand.py b/test/t/test_expand.py index d93f66cd026..9e9884f7575 100644 --- a/test/t/test_expand.py +++ b/test/t/test_expand.py @@ -4,6 +4,7 @@ class TestExpand: @pytest.mark.complete( "expand --", + require_cmd=True, xfail=( "! expand --help &>/dev/null || " "! expand --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_faillog.py b/test/t/test_faillog.py index d9799d574a7..edf490b559b 100644 --- a/test/t/test_faillog.py +++ b/test/t/test_faillog.py @@ -2,6 +2,6 @@ class TestFaillog: - @pytest.mark.complete("faillog -") + @pytest.mark.complete("faillog -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_feh.py b/test/t/test_feh.py index c0aab08759c..51bd77b6270 100644 --- a/test/t/test_feh.py +++ b/test/t/test_feh.py @@ -7,7 +7,9 @@ def test_1(self, completion): assert completion @pytest.mark.complete( - "feh --lis", xfail="feh --help 2>&1 | command grep -qF 'man feh'" + "feh --lis", + xfail="feh --help 2>&1 | command grep -qF 'man feh'", + require_cmd=True, ) def test_2(self, completion): assert completion diff --git a/test/t/test_file.py b/test/t/test_file.py index cfd2c100327..0c19eb4da99 100644 --- a/test/t/test_file.py +++ b/test/t/test_file.py @@ -6,6 +6,6 @@ class TestFile: def test_1(self, completion): assert completion - @pytest.mark.complete("file -") + @pytest.mark.complete("file -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_filefrag.py b/test/t/test_filefrag.py index b83e5d631b9..342e89ce3c6 100644 --- a/test/t/test_filefrag.py +++ b/test/t/test_filefrag.py @@ -6,6 +6,6 @@ class TestFilefrag: def test_1(self, completion): assert completion - @pytest.mark.complete("filefrag -") + @pytest.mark.complete("filefrag -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_filesnarf.py b/test/t/test_filesnarf.py index cd399d4aed4..cee621ecd51 100644 --- a/test/t/test_filesnarf.py +++ b/test/t/test_filesnarf.py @@ -2,6 +2,6 @@ class TestFilesnarf: - @pytest.mark.complete("filesnarf -") + @pytest.mark.complete("filesnarf -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_fio.py b/test/t/test_fio.py index 8dd6f789fb1..0f6eba746c6 100644 --- a/test/t/test_fio.py +++ b/test/t/test_fio.py @@ -6,7 +6,7 @@ class TestFio: def test_1(self, completion): assert completion - @pytest.mark.complete("fio --") + @pytest.mark.complete("fio --", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_firefox.py b/test/t/test_firefox.py index cbba2c6c0f8..2e052553b48 100644 --- a/test/t/test_firefox.py +++ b/test/t/test_firefox.py @@ -6,7 +6,7 @@ class TestFirefox: def test_1(self, completion): assert completion - @pytest.mark.complete("firefox -") + @pytest.mark.complete("firefox -", require_cmd=True) def test_2(self, completion): assert completion assert not completion.endswith(" ") diff --git a/test/t/test_fmt.py b/test/t/test_fmt.py index 4de31e34bf9..12706da2f02 100644 --- a/test/t/test_fmt.py +++ b/test/t/test_fmt.py @@ -2,6 +2,8 @@ class TestFmt: - @pytest.mark.complete("fmt -", xfail="! fmt --help &>/dev/null") + @pytest.mark.complete( + "fmt -", require_cmd=True, xfail="! fmt --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_fold.py b/test/t/test_fold.py index fffaef9a571..b530cc2ebda 100644 --- a/test/t/test_fold.py +++ b/test/t/test_fold.py @@ -4,6 +4,7 @@ class TestFold: @pytest.mark.complete( "fold --", + require_cmd=True, xfail=( "! fold --help &>/dev/null || " "! fold --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_freeciv.py b/test/t/test_freeciv.py index 1027e43cc69..a195eb868a0 100644 --- a/test/t/test_freeciv.py +++ b/test/t/test_freeciv.py @@ -2,6 +2,6 @@ class TestFreeciv: - @pytest.mark.complete("freeciv -") + @pytest.mark.complete("freeciv -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_freeciv_server.py b/test/t/test_freeciv_server.py index 5546a5e951a..8543a2125a2 100644 --- a/test/t/test_freeciv_server.py +++ b/test/t/test_freeciv_server.py @@ -3,6 +3,6 @@ @pytest.mark.bashcomp(cmd="freeciv-server") class TestFreecivServer: - @pytest.mark.complete("freeciv-server -") + @pytest.mark.complete("freeciv-server -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_fusermount.py b/test/t/test_fusermount.py index 363096d18a5..dbb2bd99a2f 100644 --- a/test/t/test_fusermount.py +++ b/test/t/test_fusermount.py @@ -6,6 +6,6 @@ class TestFusermount: def test_1(self, completion): assert completion - @pytest.mark.complete("fusermount -") + @pytest.mark.complete("fusermount -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_genisoimage.py b/test/t/test_genisoimage.py index aa578766cfb..bfcef3bc148 100644 --- a/test/t/test_genisoimage.py +++ b/test/t/test_genisoimage.py @@ -6,6 +6,6 @@ class TestGenisoimage: def test_1(self, completion): assert completion - @pytest.mark.complete("genisoimage -") + @pytest.mark.complete("genisoimage -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_geoiplookup.py b/test/t/test_geoiplookup.py index d114d55f074..9a1422bc044 100644 --- a/test/t/test_geoiplookup.py +++ b/test/t/test_geoiplookup.py @@ -2,6 +2,6 @@ class TestGeoiplookup: - @pytest.mark.complete("geoiplookup -") + @pytest.mark.complete("geoiplookup -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_getent.py b/test/t/test_getent.py index a5b250c5eea..a1e9fcbb4a1 100644 --- a/test/t/test_getent.py +++ b/test/t/test_getent.py @@ -8,6 +8,7 @@ def test_1(self, completion): @pytest.mark.complete( "getent -", + require_cmd=True, xfail=( "! (getent --help 2>&1 || :) | " "command grep -q -- '[[:space:]]-'" diff --git a/test/t/test_gkrellm.py b/test/t/test_gkrellm.py index 8ab4b5a717e..fdc2e165372 100644 --- a/test/t/test_gkrellm.py +++ b/test/t/test_gkrellm.py @@ -5,6 +5,6 @@ @pytest.mark.xfail(not os.environ.get("DISPLAY"), reason="X display required") class TestGkrellm: - @pytest.mark.complete("gkrellm -") + @pytest.mark.complete("gkrellm -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_gm.py b/test/t/test_gm.py index 82d16702c56..9cdd73c4dd8 100644 --- a/test/t/test_gm.py +++ b/test/t/test_gm.py @@ -2,15 +2,15 @@ class TestGm: - @pytest.mark.complete("gm ") + @pytest.mark.complete("gm ", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("gm help ") + @pytest.mark.complete("gm help ", require_cmd=True) def test_2(self, completion): assert completion - @pytest.mark.complete("gm time ") + @pytest.mark.complete("gm time ", require_cmd=True) def test_3(self, completion): assert completion diff --git a/test/t/test_gnokii.py b/test/t/test_gnokii.py index 7f696bf4e7e..66af6e99639 100644 --- a/test/t/test_gnokii.py +++ b/test/t/test_gnokii.py @@ -2,10 +2,10 @@ class TestGnokii: - @pytest.mark.complete("gnokii ") + @pytest.mark.complete("gnokii ", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("gnokii -") + @pytest.mark.complete("gnokii -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_gnome_mplayer.py b/test/t/test_gnome_mplayer.py index ec2157eb1de..379c56ce6cc 100644 --- a/test/t/test_gnome_mplayer.py +++ b/test/t/test_gnome_mplayer.py @@ -10,6 +10,8 @@ def test_1(self, completion): # XDG_DATA_DIRS set to a dir with no schemas results in # "GLib-GIO-ERROR **: No GSettings schemas are installed on the system" # and a core dump on --help on Ubuntu 14. - @pytest.mark.complete("gnome-mplayer -", pre_cmds=("unset XDG_DATA_DIRS",)) + @pytest.mark.complete( + "gnome-mplayer -", require_cmd=True, pre_cmds=("unset XDG_DATA_DIRS",) + ) def test_2(self, completion): assert completion diff --git a/test/t/test_gnome_screenshot.py b/test/t/test_gnome_screenshot.py index 476f57f14e0..977e03fbe9b 100644 --- a/test/t/test_gnome_screenshot.py +++ b/test/t/test_gnome_screenshot.py @@ -3,6 +3,6 @@ @pytest.mark.bashcomp(cmd="gnome-screenshot") class TestGnomeScreenshot: - @pytest.mark.complete("gnome-screenshot --help") + @pytest.mark.complete("gnome-screenshot --help", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_gpasswd.py b/test/t/test_gpasswd.py index 141ae847af8..4f0221b974d 100644 --- a/test/t/test_gpasswd.py +++ b/test/t/test_gpasswd.py @@ -6,6 +6,6 @@ class TestGpasswd: def test_1(self, completion): assert completion - @pytest.mark.complete("gpasswd -") + @pytest.mark.complete("gpasswd -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_gperf.py b/test/t/test_gperf.py index f8267bf7396..54f75b187f7 100644 --- a/test/t/test_gperf.py +++ b/test/t/test_gperf.py @@ -2,6 +2,6 @@ class TestGperf: - @pytest.mark.complete("gperf --") + @pytest.mark.complete("gperf --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_gpg2.py b/test/t/test_gpg2.py index 6a7ff33300d..27a39fafce3 100644 --- a/test/t/test_gpg2.py +++ b/test/t/test_gpg2.py @@ -2,6 +2,6 @@ class TestGpg2: - @pytest.mark.complete("gpg2 --h") + @pytest.mark.complete("gpg2 --h", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_gpgv.py b/test/t/test_gpgv.py index 05feb71f3d8..d600c74fa59 100644 --- a/test/t/test_gpgv.py +++ b/test/t/test_gpgv.py @@ -6,7 +6,7 @@ class TestGpgv: def test_1(self, completion): assert completion - @pytest.mark.complete("gpgv -") + @pytest.mark.complete("gpgv -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_gphoto2.py b/test/t/test_gphoto2.py index 830e6f6fff1..bb987f7ee7c 100644 --- a/test/t/test_gphoto2.py +++ b/test/t/test_gphoto2.py @@ -2,6 +2,6 @@ class TestGphoto2: - @pytest.mark.complete("gphoto2 --") + @pytest.mark.complete("gphoto2 --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_grep.py b/test/t/test_grep.py index 42da802ea18..49b327768b1 100644 --- a/test/t/test_grep.py +++ b/test/t/test_grep.py @@ -4,6 +4,7 @@ class TestGrep: @pytest.mark.complete( "grep --", + require_cmd=True, xfail=( "! grep --help &>/dev/null || " "! grep --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_groupadd.py b/test/t/test_groupadd.py index efea4677e3e..f882d1ed881 100644 --- a/test/t/test_groupadd.py +++ b/test/t/test_groupadd.py @@ -6,6 +6,6 @@ class TestGroupadd: def test_1(self, completion): assert not completion - @pytest.mark.complete("groupadd -") + @pytest.mark.complete("groupadd -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_groupdel.py b/test/t/test_groupdel.py index 9decc622edf..6e558395436 100644 --- a/test/t/test_groupdel.py +++ b/test/t/test_groupdel.py @@ -6,6 +6,6 @@ class TestGroupdel: def test_1(self, completion): assert completion - @pytest.mark.complete("groupdel -") + @pytest.mark.complete("groupdel -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_groupmems.py b/test/t/test_groupmems.py index 2faff63310a..c7b99208e77 100644 --- a/test/t/test_groupmems.py +++ b/test/t/test_groupmems.py @@ -2,6 +2,6 @@ class TestGroupmems: - @pytest.mark.complete("groupmems -") + @pytest.mark.complete("groupmems -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_groupmod.py b/test/t/test_groupmod.py index 08b1d2e2ccb..7097118fd50 100644 --- a/test/t/test_groupmod.py +++ b/test/t/test_groupmod.py @@ -6,6 +6,6 @@ class TestGroupmod: def test_1(self, completion): assert completion - @pytest.mark.complete("groupmod -") + @pytest.mark.complete("groupmod -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_grpck.py b/test/t/test_grpck.py index 0d6a5cefa36..dcd148505e4 100644 --- a/test/t/test_grpck.py +++ b/test/t/test_grpck.py @@ -6,6 +6,6 @@ class TestGrpck: def test_1(self, completion): assert completion - @pytest.mark.complete("grpck -") + @pytest.mark.complete("grpck -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_grub.py b/test/t/test_grub.py index 8ecd02091aa..4a6929ff5f9 100644 --- a/test/t/test_grub.py +++ b/test/t/test_grub.py @@ -2,6 +2,6 @@ class TestGrub: - @pytest.mark.complete("grub --") + @pytest.mark.complete("grub --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_gssdp_discover.py b/test/t/test_gssdp_discover.py index 9164a3547fe..b5451496b5b 100644 --- a/test/t/test_gssdp_discover.py +++ b/test/t/test_gssdp_discover.py @@ -7,7 +7,7 @@ class TestGssdpDiscover: def test_no_args(self, completion): assert not completion - @pytest.mark.complete("gssdp-discover --") + @pytest.mark.complete("gssdp-discover --", require_cmd=True) def test_options(self, completion): assert completion diff --git a/test/t/test_gzip.py b/test/t/test_gzip.py index da97fecb874..2173cad9bd6 100644 --- a/test/t/test_gzip.py +++ b/test/t/test_gzip.py @@ -10,6 +10,6 @@ def test_1(self, completion): def test_2(self, completion): assert completion - @pytest.mark.complete("gzip -") + @pytest.mark.complete("gzip -", require_cmd=True) def test_3(self, completion): assert completion diff --git a/test/t/test_hcitool.py b/test/t/test_hcitool.py index 5395d8d22a1..0885385570c 100644 --- a/test/t/test_hcitool.py +++ b/test/t/test_hcitool.py @@ -6,6 +6,6 @@ class TestHcitool: def test_1(self, completion): assert completion - @pytest.mark.complete("hcitool -") + @pytest.mark.complete("hcitool -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_head.py b/test/t/test_head.py index cf9e990e445..a0148839ed9 100644 --- a/test/t/test_head.py +++ b/test/t/test_head.py @@ -4,6 +4,7 @@ class TestHead: @pytest.mark.complete( "head --", + require_cmd=True, xfail=( "! head --help &>/dev/null || " "! head --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_host.py b/test/t/test_host.py index 555a36f583c..2ef179083cf 100644 --- a/test/t/test_host.py +++ b/test/t/test_host.py @@ -2,6 +2,6 @@ class TestHost: - @pytest.mark.complete("host -") + @pytest.mark.complete("host -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_hping2.py b/test/t/test_hping2.py index c5112378312..19665ba3278 100644 --- a/test/t/test_hping2.py +++ b/test/t/test_hping2.py @@ -6,6 +6,6 @@ class TestHping2: def test_1(self, completion): assert completion - @pytest.mark.complete("hping2 -") + @pytest.mark.complete("hping2 -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_htop.py b/test/t/test_htop.py index 62022bbd2d3..e837c5ad277 100644 --- a/test/t/test_htop.py +++ b/test/t/test_htop.py @@ -2,6 +2,6 @@ class TestHtop: - @pytest.mark.complete("htop -") + @pytest.mark.complete("htop -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_htpasswd.py b/test/t/test_htpasswd.py index aaf8944715e..92989fa2582 100644 --- a/test/t/test_htpasswd.py +++ b/test/t/test_htpasswd.py @@ -18,6 +18,6 @@ def test_3(self, completion): def test_4(self, completion): assert completion == "foo quux".split() - @pytest.mark.complete("htpasswd -") + @pytest.mark.complete("htpasswd -", require_cmd=True) def test_5(self, completion): assert completion diff --git a/test/t/test_hunspell.py b/test/t/test_hunspell.py index 94ea10205af..0f27185c1ae 100644 --- a/test/t/test_hunspell.py +++ b/test/t/test_hunspell.py @@ -6,6 +6,6 @@ class TestHunspell: def test_1(self, completion): assert completion - @pytest.mark.complete("hunspell -") + @pytest.mark.complete("hunspell -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_identify.py b/test/t/test_identify.py index 12fba008280..34ae2854486 100644 --- a/test/t/test_identify.py +++ b/test/t/test_identify.py @@ -2,6 +2,6 @@ class TestIdentify: - @pytest.mark.complete("identify -") + @pytest.mark.complete("identify -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_idn.py b/test/t/test_idn.py index 1fd1ce02de7..78172c0aeb4 100644 --- a/test/t/test_idn.py +++ b/test/t/test_idn.py @@ -2,6 +2,6 @@ class TestIdn: - @pytest.mark.complete("idn -") + @pytest.mark.complete("idn -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_ifstat.py b/test/t/test_ifstat.py index 7f88a642120..89b5a0ece59 100644 --- a/test/t/test_ifstat.py +++ b/test/t/test_ifstat.py @@ -2,7 +2,7 @@ class TestIfstat: - @pytest.mark.complete("ifstat -") + @pytest.mark.complete("ifstat -", require_cmd=True) def test_1(self, completion): assert completion @@ -13,7 +13,9 @@ def test_2(self, completion): assert completion @pytest.mark.complete( - "ifstat -d ", xfail="ifstat -v | command grep -qF iproute2" + "ifstat -d ", + require_cmd=True, + xfail="ifstat -v | command grep -qF iproute2", ) def test_3(self, completion): assert completion diff --git a/test/t/test_iftop.py b/test/t/test_iftop.py index 3d66f4af187..44973105e4f 100644 --- a/test/t/test_iftop.py +++ b/test/t/test_iftop.py @@ -2,10 +2,10 @@ class TestIftop: - @pytest.mark.complete("iftop ") + @pytest.mark.complete("iftop ", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("iftop -") + @pytest.mark.complete("iftop -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_influx.py b/test/t/test_influx.py index bec55e55745..53a15bfff43 100644 --- a/test/t/test_influx.py +++ b/test/t/test_influx.py @@ -6,10 +6,10 @@ class TestInflux: def test_nothing(self, completion): assert not completion - @pytest.mark.complete("influx -") + @pytest.mark.complete("influx -", require_cmd=True) def test_options(self, completion): assert completion - @pytest.mark.complete("influx -format ") + @pytest.mark.complete("influx -format ", require_cmd=True) def test_format(self, completion): assert completion diff --git a/test/t/test_info.py b/test/t/test_info.py index b52b682e580..e12d900fd7f 100644 --- a/test/t/test_info.py +++ b/test/t/test_info.py @@ -7,6 +7,6 @@ class TestInfo: def test_1(self, completion): assert completion - @pytest.mark.complete("info -") + @pytest.mark.complete("info -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_inotifywait.py b/test/t/test_inotifywait.py index fe647ad64ae..19fa4d54da9 100644 --- a/test/t/test_inotifywait.py +++ b/test/t/test_inotifywait.py @@ -6,10 +6,10 @@ class TestInotifywait: def test_1(self, completion): assert completion - @pytest.mark.complete("inotifywait --") + @pytest.mark.complete("inotifywait --", require_cmd=True) def test_2(self, completion): assert completion - @pytest.mark.complete("inotifywait -e ") + @pytest.mark.complete("inotifywait -e ", require_cmd=True) def test_3(self, completion): assert completion diff --git a/test/t/test_inotifywatch.py b/test/t/test_inotifywatch.py index e0e686e84b4..281fec4914e 100644 --- a/test/t/test_inotifywatch.py +++ b/test/t/test_inotifywatch.py @@ -6,10 +6,10 @@ class TestInotifywatch: def test_1(self, completion): assert completion - @pytest.mark.complete("inotifywatch --") + @pytest.mark.complete("inotifywatch --", require_cmd=True) def test_2(self, completion): assert completion - @pytest.mark.complete("inotifywatch -e ") + @pytest.mark.complete("inotifywatch -e ", require_cmd=True) def test_3(self, completion): assert len(completion) > 1 diff --git a/test/t/test_interdiff.py b/test/t/test_interdiff.py index 69da5cbe487..83be115e99c 100644 --- a/test/t/test_interdiff.py +++ b/test/t/test_interdiff.py @@ -6,6 +6,6 @@ class TestInterdiff: def test_1(self, completion): assert completion - @pytest.mark.complete("interdiff -") + @pytest.mark.complete("interdiff -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_iperf.py b/test/t/test_iperf.py index da91b648d9e..c38e9546ec6 100644 --- a/test/t/test_iperf.py +++ b/test/t/test_iperf.py @@ -2,7 +2,7 @@ class TestIperf: - @pytest.mark.complete("iperf ") + @pytest.mark.complete("iperf ", require_cmd=True) def test_1(self, completion): assert completion @@ -10,15 +10,15 @@ def test_1(self, completion): def test_2(self, completion): assert completion - @pytest.mark.complete("iperf --client foo --") + @pytest.mark.complete("iperf --client foo --", require_cmd=True) def test_3(self, completion): assert completion assert "--daemon" not in completion - @pytest.mark.complete("iperf --server --") + @pytest.mark.complete("iperf --server --", require_cmd=True) def test_4(self, completion): assert "--daemon" in completion - @pytest.mark.complete("iperf -") + @pytest.mark.complete("iperf -", require_cmd=True) def test_5(self, completion): assert completion diff --git a/test/t/test_iperf3.py b/test/t/test_iperf3.py index cd93a9963e3..15f3a03bc1b 100644 --- a/test/t/test_iperf3.py +++ b/test/t/test_iperf3.py @@ -2,7 +2,7 @@ class TestIperf3: - @pytest.mark.complete("iperf3 ") + @pytest.mark.complete("iperf3 ", require_cmd=True) def test_1(self, completion): assert completion @@ -10,11 +10,11 @@ def test_1(self, completion): def test_2(self, completion): assert completion - @pytest.mark.complete("iperf3 --client foo --") + @pytest.mark.complete("iperf3 --client foo --", require_cmd=True) def test_3(self, completion): assert completion assert "--daemon" not in completion - @pytest.mark.complete("iperf3 --server --") + @pytest.mark.complete("iperf3 --server --", require_cmd=True) def test_4(self, completion): assert "--daemon" in completion diff --git a/test/t/test_ipmitool.py b/test/t/test_ipmitool.py index b90d10d3d25..f779f91064d 100644 --- a/test/t/test_ipmitool.py +++ b/test/t/test_ipmitool.py @@ -6,6 +6,6 @@ class TestIpmitool: def test_1(self, completion): assert completion - @pytest.mark.complete("ipmitool -") + @pytest.mark.complete("ipmitool -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_iptables.py b/test/t/test_iptables.py index 7a30bb82881..a5c82e5a227 100644 --- a/test/t/test_iptables.py +++ b/test/t/test_iptables.py @@ -2,6 +2,6 @@ class TestIptables: - @pytest.mark.complete("iptables -") + @pytest.mark.complete("iptables -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_ipv6calc.py b/test/t/test_ipv6calc.py index 99adb9e30b0..872d8a37152 100644 --- a/test/t/test_ipv6calc.py +++ b/test/t/test_ipv6calc.py @@ -2,10 +2,10 @@ class TestIpv6calc: - @pytest.mark.complete("ipv6calc -") + @pytest.mark.complete("ipv6calc -", require_cmd=True) def test_1(self, completion): assert "--action" in completion - @pytest.mark.complete("ipv6calc --in ") + @pytest.mark.complete("ipv6calc --in ", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_isort.py b/test/t/test_isort.py index 4fae3244bb0..9f7a6524fda 100644 --- a/test/t/test_isort.py +++ b/test/t/test_isort.py @@ -6,6 +6,6 @@ class TestIsort: def test_1(self, completion): assert completion - @pytest.mark.complete("isort -") + @pytest.mark.complete("isort -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_java.py b/test/t/test_java.py index 81f07c68d40..d18f43dc6aa 100644 --- a/test/t/test_java.py +++ b/test/t/test_java.py @@ -5,7 +5,7 @@ pre_cmds=("CLASSPATH=$PWD/java/a:$PWD/java/bashcomp.jar",) ) class TestJava: - @pytest.mark.complete("java -") + @pytest.mark.complete("java -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_javaws.py b/test/t/test_javaws.py index 3fd564fd7c6..596c735203c 100644 --- a/test/t/test_javaws.py +++ b/test/t/test_javaws.py @@ -6,6 +6,6 @@ class TestJavaws: def test_1(self, completion): assert completion - @pytest.mark.complete("javaws -") + @pytest.mark.complete("javaws -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_jpegoptim.py b/test/t/test_jpegoptim.py index 78a2fc7e87e..fb525910209 100644 --- a/test/t/test_jpegoptim.py +++ b/test/t/test_jpegoptim.py @@ -6,6 +6,6 @@ class TestJpegoptim: def test_1(self, completion): assert completion - @pytest.mark.complete("jpegoptim -") + @pytest.mark.complete("jpegoptim -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_jshint.py b/test/t/test_jshint.py index 1d4ae55ba49..58049d14267 100644 --- a/test/t/test_jshint.py +++ b/test/t/test_jshint.py @@ -6,6 +6,6 @@ class TestJshint: def test_1(self, completion): assert completion - @pytest.mark.complete("jshint -") + @pytest.mark.complete("jshint -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_jsonschema.py b/test/t/test_jsonschema.py index 0905fd7f918..9e3929e60a5 100644 --- a/test/t/test_jsonschema.py +++ b/test/t/test_jsonschema.py @@ -6,6 +6,6 @@ class TestJsonschema: def test_1(self, completion): assert completion - @pytest.mark.complete("jsonschema -") + @pytest.mark.complete("jsonschema -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_k3b.py b/test/t/test_k3b.py index 9219972d73a..61b6a4d5a28 100644 --- a/test/t/test_k3b.py +++ b/test/t/test_k3b.py @@ -6,6 +6,6 @@ class TestK3b: def test_1(self, completion): assert completion - @pytest.mark.complete("k3b -") + @pytest.mark.complete("k3b -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_kcov.py b/test/t/test_kcov.py index ce985a78459..3c7d3dfaed7 100644 --- a/test/t/test_kcov.py +++ b/test/t/test_kcov.py @@ -6,7 +6,7 @@ class TestKcov: def test_1(self, completion): assert completion - @pytest.mark.complete("kcov --exclude-patter") + @pytest.mark.complete("kcov --exclude-patter", require_cmd=True) def test_2(self, completion): assert completion == "--exclude-pattern=" assert completion.endswith("=") diff --git a/test/t/test_killall.py b/test/t/test_killall.py index b2c0dc74af0..4b67d961758 100644 --- a/test/t/test_killall.py +++ b/test/t/test_killall.py @@ -16,6 +16,6 @@ def test_2(self, completion): def test_3(self, completion): assert "command=" not in completion - @pytest.mark.complete("killall -") + @pytest.mark.complete("killall -", require_cmd=True) def test_4(self, completion): assert completion diff --git a/test/t/test_koji.py b/test/t/test_koji.py index 68a8477bbe8..73d3e4c2975 100644 --- a/test/t/test_koji.py +++ b/test/t/test_koji.py @@ -2,10 +2,10 @@ class TestKoji: - @pytest.mark.complete("koji ") + @pytest.mark.complete("koji ", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("koji -") + @pytest.mark.complete("koji -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_l2ping.py b/test/t/test_l2ping.py index 7979d734ac2..c50651b72c6 100644 --- a/test/t/test_l2ping.py +++ b/test/t/test_l2ping.py @@ -2,6 +2,6 @@ class TestL2ping: - @pytest.mark.complete("l2ping -") + @pytest.mark.complete("l2ping -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_lastlog.py b/test/t/test_lastlog.py index 043af96272e..31a855fb6ab 100644 --- a/test/t/test_lastlog.py +++ b/test/t/test_lastlog.py @@ -2,6 +2,6 @@ class TestLastlog: - @pytest.mark.complete("lastlog -") + @pytest.mark.complete("lastlog -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_ldapvi.py b/test/t/test_ldapvi.py index a81ae1809c6..5e65fc46c9c 100644 --- a/test/t/test_ldapvi.py +++ b/test/t/test_ldapvi.py @@ -2,6 +2,6 @@ class TestLdapvi: - @pytest.mark.complete("ldapvi -") + @pytest.mark.complete("ldapvi -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_less.py b/test/t/test_less.py index 7d89a759dd1..c7230c3022b 100644 --- a/test/t/test_less.py +++ b/test/t/test_less.py @@ -4,6 +4,7 @@ class TestLess: @pytest.mark.complete( "less --", + require_cmd=True, xfail=( "! less --help &>/dev/null || " "! less --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_lftp.py b/test/t/test_lftp.py index ea2ea65cb0e..765e51e1c16 100644 --- a/test/t/test_lftp.py +++ b/test/t/test_lftp.py @@ -13,6 +13,6 @@ def test_1(self, bash, completion): assert all(x in completion for x in hosts) assert "lftptest" in completion # defined in lftp/.lftp/bookmarks - @pytest.mark.complete("lftp -") + @pytest.mark.complete("lftp -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_links.py b/test/t/test_links.py index f21b872830e..0806813d6c2 100644 --- a/test/t/test_links.py +++ b/test/t/test_links.py @@ -6,6 +6,6 @@ class TestLinks: def test_1(self, completion): assert completion - @pytest.mark.complete("links -") + @pytest.mark.complete("links -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_locale_gen.py b/test/t/test_locale_gen.py index 41ac376f624..6ad3ea1a462 100644 --- a/test/t/test_locale_gen.py +++ b/test/t/test_locale_gen.py @@ -3,10 +3,11 @@ @pytest.mark.bashcomp(cmd="locale-gen") class TestLocaleGen: - @pytest.mark.complete("locale-gen ") + # require_cmd is not strictly true here, but... + @pytest.mark.complete("locale-gen ", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("locale-gen --") + @pytest.mark.complete("locale-gen --", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_lrzip.py b/test/t/test_lrzip.py index a98f6cbb747..d61ee9d140a 100644 --- a/test/t/test_lrzip.py +++ b/test/t/test_lrzip.py @@ -10,6 +10,6 @@ def test_1(self, completion): def test_2(self, completion): assert completion - @pytest.mark.complete("lrzip -") + @pytest.mark.complete("lrzip -", require_cmd=True) def test_3(self, completion): assert completion diff --git a/test/t/test_ls.py b/test/t/test_ls.py index d7132ce3710..7e2d1f35111 100644 --- a/test/t/test_ls.py +++ b/test/t/test_ls.py @@ -8,7 +8,9 @@ class TestLs: - @pytest.mark.complete("ls --", xfail="! ls --help &>/dev/null") + @pytest.mark.complete( + "ls --", require_cmd=True, xfail="! ls --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lspci.py b/test/t/test_lspci.py index 44663426e1b..ac18da3f319 100644 --- a/test/t/test_lspci.py +++ b/test/t/test_lspci.py @@ -2,10 +2,10 @@ class TestLspci: - @pytest.mark.complete("lspci -") + @pytest.mark.complete("lspci -", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("lspci -A ") + @pytest.mark.complete("lspci -A ", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_lsscsi.py b/test/t/test_lsscsi.py index a297b3757e1..fe01ac15601 100644 --- a/test/t/test_lsscsi.py +++ b/test/t/test_lsscsi.py @@ -6,6 +6,6 @@ class TestLsscsi: def test_1(self, completion): assert not completion - @pytest.mark.complete("lsscsi -") + @pytest.mark.complete("lsscsi -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_lua.py b/test/t/test_lua.py index 70b977f4329..54c243213c2 100644 --- a/test/t/test_lua.py +++ b/test/t/test_lua.py @@ -6,6 +6,6 @@ class TestLua: def test_1(self, completion): assert completion - @pytest.mark.complete("lua -") + @pytest.mark.complete("lua -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_luac.py b/test/t/test_luac.py index afeb62a285c..28dc0e85c8c 100644 --- a/test/t/test_luac.py +++ b/test/t/test_luac.py @@ -6,6 +6,6 @@ class TestLuac: def test_1(self, completion): assert completion - @pytest.mark.complete("luac -") + @pytest.mark.complete("luac -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_luseradd.py b/test/t/test_luseradd.py index 35c89e54a7f..4f1bec9cbaa 100644 --- a/test/t/test_luseradd.py +++ b/test/t/test_luseradd.py @@ -2,6 +2,6 @@ class TestLuseradd: - @pytest.mark.complete("luseradd -") + @pytest.mark.complete("luseradd -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_luserdel.py b/test/t/test_luserdel.py index c450f3350c5..ad88557c7ef 100644 --- a/test/t/test_luserdel.py +++ b/test/t/test_luserdel.py @@ -6,6 +6,6 @@ class TestLuserdel: def test_1(self, completion): assert completion - @pytest.mark.complete("luserdel -") + @pytest.mark.complete("luserdel -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_lvchange.py b/test/t/test_lvchange.py index aac59e8b186..3e4feda51fc 100644 --- a/test/t/test_lvchange.py +++ b/test/t/test_lvchange.py @@ -2,6 +2,8 @@ class TestLvchange: - @pytest.mark.complete("lvchange --", xfail="! lvchange --help &>/dev/null") + @pytest.mark.complete( + "lvchange --", require_cmd=True, xfail="! lvchange --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvcreate.py b/test/t/test_lvcreate.py index a1835b42ac1..636f6250ae9 100644 --- a/test/t/test_lvcreate.py +++ b/test/t/test_lvcreate.py @@ -2,6 +2,8 @@ class TestLvcreate: - @pytest.mark.complete("lvcreate --", xfail="! lvcreate --help &>/dev/null") + @pytest.mark.complete( + "lvcreate --", require_cmd=True, xfail="! lvcreate --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvdisplay.py b/test/t/test_lvdisplay.py index 4979a1ffa53..52106621c4b 100644 --- a/test/t/test_lvdisplay.py +++ b/test/t/test_lvdisplay.py @@ -3,7 +3,9 @@ class TestLvdisplay: @pytest.mark.complete( - "lvdisplay --", xfail="! lvdisplay --help &>/dev/null" + "lvdisplay --", + require_cmd=True, + xfail="! lvdisplay --help &>/dev/null", ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvextend.py b/test/t/test_lvextend.py index 300ee805350..4daa88873c3 100644 --- a/test/t/test_lvextend.py +++ b/test/t/test_lvextend.py @@ -2,6 +2,8 @@ class TestLvextend: - @pytest.mark.complete("lvextend --", xfail="! lvextend --help &>/dev/null") + @pytest.mark.complete( + "lvextend --", require_cmd=True, xfail="! lvextend --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvmdiskscan.py b/test/t/test_lvmdiskscan.py index 81aadba93ae..1b334b8913f 100644 --- a/test/t/test_lvmdiskscan.py +++ b/test/t/test_lvmdiskscan.py @@ -3,7 +3,9 @@ class TestLvmdiskscan: @pytest.mark.complete( - "lvmdiskscan --", xfail="! lvmdiskscan --help &>/dev/null" + "lvmdiskscan --", + require_cmd=True, + xfail="! lvmdiskscan --help &>/dev/null", ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvreduce.py b/test/t/test_lvreduce.py index 3fe8da15128..3b614cb9ff0 100644 --- a/test/t/test_lvreduce.py +++ b/test/t/test_lvreduce.py @@ -2,6 +2,8 @@ class TestLvreduce: - @pytest.mark.complete("lvreduce --", xfail="! lvreduce --help &>/dev/null") + @pytest.mark.complete( + "lvreduce --", require_cmd=True, xfail="! lvreduce --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvremove.py b/test/t/test_lvremove.py index 3c6d72c42ce..17486aa03bc 100644 --- a/test/t/test_lvremove.py +++ b/test/t/test_lvremove.py @@ -2,6 +2,8 @@ class TestLvremove: - @pytest.mark.complete("lvremove --", xfail="! lvremove --help &>/dev/null") + @pytest.mark.complete( + "lvremove --", require_cmd=True, xfail="! lvremove --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvrename.py b/test/t/test_lvrename.py index 897f314788e..802b72e7316 100644 --- a/test/t/test_lvrename.py +++ b/test/t/test_lvrename.py @@ -2,6 +2,8 @@ class TestLvrename: - @pytest.mark.complete("lvrename --", xfail="! lvrename --help &>/dev/null") + @pytest.mark.complete( + "lvrename --", require_cmd=True, xfail="! lvrename --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvresize.py b/test/t/test_lvresize.py index 5cc5fc152e2..bb71feb19c0 100644 --- a/test/t/test_lvresize.py +++ b/test/t/test_lvresize.py @@ -2,6 +2,8 @@ class TestLvresize: - @pytest.mark.complete("lvresize --", xfail="! lvresize --help &>/dev/null") + @pytest.mark.complete( + "lvresize --", require_cmd=True, xfail="! lvresize --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvs.py b/test/t/test_lvs.py index f72be7e8b3a..eadc8df59d2 100644 --- a/test/t/test_lvs.py +++ b/test/t/test_lvs.py @@ -2,6 +2,8 @@ class TestLvs: - @pytest.mark.complete("lvs --", xfail="! lvs --help &>/dev/null") + @pytest.mark.complete( + "lvs --", require_cmd=True, xfail="! lvs --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lvscan.py b/test/t/test_lvscan.py index c840babedfc..a2867b06369 100644 --- a/test/t/test_lvscan.py +++ b/test/t/test_lvscan.py @@ -2,6 +2,8 @@ class TestLvscan: - @pytest.mark.complete("lvscan --", xfail="! lvscan --help &>/dev/null") + @pytest.mark.complete( + "lvscan --", require_cmd=True, xfail="! lvscan --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_lz4.py b/test/t/test_lz4.py index d3aeed383f6..0e1208c968e 100644 --- a/test/t/test_lz4.py +++ b/test/t/test_lz4.py @@ -10,6 +10,6 @@ def test_1(self, completion): def test_2(self, completion): assert completion - @pytest.mark.complete("lz4 -") + @pytest.mark.complete("lz4 -", require_cmd=True) def test_3(self, completion): assert completion diff --git a/test/t/test_lzip.py b/test/t/test_lzip.py index bb106bc7c8f..b0313be4dce 100644 --- a/test/t/test_lzip.py +++ b/test/t/test_lzip.py @@ -6,6 +6,6 @@ class TestLzip: def test_1(self, completion): assert completion - @pytest.mark.complete("lzip -") + @pytest.mark.complete("lzip -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_m4.py b/test/t/test_m4.py index 0c32cdb694f..7ecd7745dc4 100644 --- a/test/t/test_m4.py +++ b/test/t/test_m4.py @@ -2,6 +2,8 @@ class TestM4: - @pytest.mark.complete("m4 --", xfail="! m4 --help &>/dev/null") + @pytest.mark.complete( + "m4 --", require_cmd=True, xfail="! m4 --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_macof.py b/test/t/test_macof.py index 8030c379585..17f0eaeaacf 100644 --- a/test/t/test_macof.py +++ b/test/t/test_macof.py @@ -2,6 +2,6 @@ class TestMacof: - @pytest.mark.complete("macof -") + @pytest.mark.complete("macof -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_mailsnarf.py b/test/t/test_mailsnarf.py index 4e264a6ed66..0dc3e04e21d 100644 --- a/test/t/test_mailsnarf.py +++ b/test/t/test_mailsnarf.py @@ -2,6 +2,6 @@ class TestMailsnarf: - @pytest.mark.complete("mailsnarf -") + @pytest.mark.complete("mailsnarf -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_make.py b/test/t/test_make.py index 47bb9e1884c..e6e043cd2dd 100644 --- a/test/t/test_make.py +++ b/test/t/test_make.py @@ -49,6 +49,6 @@ def test_8(self, bash, completion): assert completion == "all clean extra_makefile install sample".split() os.remove("%s/make/%s" % (bash.cwd, "extra_makefile")) - @pytest.mark.complete("make -") + @pytest.mark.complete("make -", require_cmd=True) def test_9(self, completion): assert completion diff --git a/test/t/test_man.py b/test/t/test_man.py index 19146549ead..ad36d96eca5 100644 --- a/test/t/test_man.py +++ b/test/t/test_man.py @@ -5,7 +5,9 @@ from conftest import assert_bash_exec, in_container -@pytest.mark.bashcomp(ignore_env=r"^[+-]MANPATH=") +@pytest.mark.bashcomp( + ignore_env=r"^[+-]((BASHOPTS|MANPATH)=|shopt -. failglob)" +) class TestMan: manpath = "$PWD/man" @@ -29,7 +31,9 @@ def colonpath(self, request, bash): ) @pytest.mark.complete( - "man bash-completion-testcas", env=dict(MANPATH=manpath) + "man bash-completion-testcas", + env=dict(MANPATH=manpath), + require_cmd=True, ) def test_1(self, completion): assert completion == "bash-completion-testcase" @@ -64,6 +68,7 @@ def test_4(self, completion): @pytest.mark.complete( "man %s" % assumed_present, + require_cmd=True, cwd="shared/empty_dir", env=dict(MANPATH="%s:" % manpath), ) @@ -72,13 +77,16 @@ def test_5(self, completion): assert completion @pytest.mark.complete( - "man bash-completion-testcas", env=dict(MANPATH="%s:" % manpath) + "man bash-completion-testcas", + require_cmd=True, + env=dict(MANPATH="%s:" % manpath), ) def test_6(self, completion): assert completion == "bash-completion-testcase" @pytest.mark.complete( "man %s" % assumed_present, + require_cmd=True, cwd="shared/empty_dir", env=dict(MANPATH=":%s" % manpath), ) @@ -87,13 +95,16 @@ def test_7(self, completion): assert completion @pytest.mark.complete( - "man bash-completion-testcas", env=dict(MANPATH=":%s" % manpath) + "man bash-completion-testcas", + require_cmd=True, + env=dict(MANPATH=":%s" % manpath), ) def test_8(self, completion): assert completion == "bash-completion-testcase" @pytest.mark.complete( "man %s" % assumed_present, + require_cmd=True, cwd="shared/empty_dir", pre_cmds=("shopt -s failglob",), ) @@ -102,11 +113,13 @@ def test_9(self, bash, completion): assert_bash_exec(bash, "shopt -u failglob") @pytest.mark.complete( - "man Bash::C", env=dict(MANPATH="%s:../tmp/man" % manpath) + "man Bash::C", + require_cmd=True, + env=dict(MANPATH="%s:../tmp/man" % manpath), ) def test_10(self, bash, colonpath, completion): assert completion == "Bash::Completion" - @pytest.mark.complete("man -") + @pytest.mark.complete("man -", require_cmd=True) def test_11(self, completion): assert completion diff --git a/test/t/test_mc.py b/test/t/test_mc.py index 9632d6a9d6f..31f88b786e4 100644 --- a/test/t/test_mc.py +++ b/test/t/test_mc.py @@ -2,6 +2,6 @@ class TestMc: - @pytest.mark.complete("mc -") + @pytest.mark.complete("mc -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_mcrypt.py b/test/t/test_mcrypt.py index 0baa1f05a84..d11f44677d9 100644 --- a/test/t/test_mcrypt.py +++ b/test/t/test_mcrypt.py @@ -6,14 +6,14 @@ class TestMcrypt: def test_1(self, completion): assert completion - @pytest.mark.complete("mcrypt -a ") + @pytest.mark.complete("mcrypt -a ", require_cmd=True) def test_2(self, completion): assert completion - @pytest.mark.complete("mcrypt -m ") + @pytest.mark.complete("mcrypt -m ", require_cmd=True) def test_3(self, completion): assert completion - @pytest.mark.complete("mcrypt -") + @pytest.mark.complete("mcrypt -", require_cmd=True) def test_4(self, completion): assert completion diff --git a/test/t/test_medusa.py b/test/t/test_medusa.py index bffa1c460f7..87fb91b72dc 100644 --- a/test/t/test_medusa.py +++ b/test/t/test_medusa.py @@ -2,6 +2,6 @@ class TestMedusa: - @pytest.mark.complete("medusa -") + @pytest.mark.complete("medusa -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_mencoder.py b/test/t/test_mencoder.py index ba946c7eae1..a17fb96058c 100644 --- a/test/t/test_mencoder.py +++ b/test/t/test_mencoder.py @@ -7,6 +7,6 @@ class TestMencoder: def test_1(self, completion): assert completion - @pytest.mark.complete("mencoder -v") + @pytest.mark.complete("mencoder -v", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_mii_diag.py b/test/t/test_mii_diag.py index ee185cfa342..6ed96aa9d36 100644 --- a/test/t/test_mii_diag.py +++ b/test/t/test_mii_diag.py @@ -7,6 +7,6 @@ class TestMiiDiag: def test_1(self, completion): assert completion - @pytest.mark.complete("mii-diag -") + @pytest.mark.complete("mii-diag -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_mii_tool.py b/test/t/test_mii_tool.py index 90c7eabad99..f028787e9f6 100644 --- a/test/t/test_mii_tool.py +++ b/test/t/test_mii_tool.py @@ -7,6 +7,6 @@ class TestMiiTool: def test_1(self, completion): assert completion - @pytest.mark.complete("mii-tool -") + @pytest.mark.complete("mii-tool -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_minicom.py b/test/t/test_minicom.py index c004faddc40..6fac457015a 100644 --- a/test/t/test_minicom.py +++ b/test/t/test_minicom.py @@ -2,6 +2,6 @@ class TestMinicom: - @pytest.mark.complete("minicom -") + @pytest.mark.complete("minicom -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_mock.py b/test/t/test_mock.py index e262d4a637f..5f9eb3e04a1 100644 --- a/test/t/test_mock.py +++ b/test/t/test_mock.py @@ -6,6 +6,8 @@ class TestMock: def test_1(self, completion): assert completion - @pytest.mark.complete("mock -", xfail="! mock --help &>/dev/null") + @pytest.mark.complete( + "mock -", require_cmd=True, xfail="! mock --help &>/dev/null" + ) def test_2(self, completion): assert completion diff --git a/test/t/test_monodevelop.py b/test/t/test_monodevelop.py index 315bcbac7c3..59435a167dc 100644 --- a/test/t/test_monodevelop.py +++ b/test/t/test_monodevelop.py @@ -6,6 +6,6 @@ class TestMonodevelop: def test_1(self, completion): assert completion - @pytest.mark.complete("monodevelop -") + @pytest.mark.complete("monodevelop -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_mplayer.py b/test/t/test_mplayer.py index 88d7b9f1ea0..a06991b2a28 100644 --- a/test/t/test_mplayer.py +++ b/test/t/test_mplayer.py @@ -7,6 +7,6 @@ class TestMplayer: def test_1(self, completion): assert completion - @pytest.mark.complete("mplayer -h") + @pytest.mark.complete("mplayer -h", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_msgsnarf.py b/test/t/test_msgsnarf.py index 5ef0fcb7225..748445652ad 100644 --- a/test/t/test_msgsnarf.py +++ b/test/t/test_msgsnarf.py @@ -2,6 +2,6 @@ class TestMsgsnarf: - @pytest.mark.complete("msgsnarf -") + @pytest.mark.complete("msgsnarf -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_munin_node_configure.py b/test/t/test_munin_node_configure.py index b74c5b81b25..e7570d84fe6 100644 --- a/test/t/test_munin_node_configure.py +++ b/test/t/test_munin_node_configure.py @@ -9,6 +9,7 @@ def test_1(self, completion): @pytest.mark.complete( "munin-node-configure -", + require_cmd=True, xfail=( "! (munin-node-configure --help 2>&1 || :) " "| command grep -q -- '[[:space:]]-'" diff --git a/test/t/test_munin_run.py b/test/t/test_munin_run.py index 1bcb4d85341..a0314495aee 100644 --- a/test/t/test_munin_run.py +++ b/test/t/test_munin_run.py @@ -3,6 +3,6 @@ @pytest.mark.bashcomp(cmd="munin-run") class TestMuninRun: - @pytest.mark.complete("munin-run -") + @pytest.mark.complete("munin-run -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_munindoc.py b/test/t/test_munindoc.py index 6b226e43ef9..eea13caa880 100644 --- a/test/t/test_munindoc.py +++ b/test/t/test_munindoc.py @@ -4,6 +4,7 @@ class TestMunindoc: # Assume at least munin* available - @pytest.mark.complete("munindoc m") + # require_cmd is not strictly correct here, but... + @pytest.mark.complete("munindoc m", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_mussh.py b/test/t/test_mussh.py index 87dd52a18d8..357c2b5bab9 100644 --- a/test/t/test_mussh.py +++ b/test/t/test_mussh.py @@ -2,6 +2,6 @@ class TestMussh: - @pytest.mark.complete("mussh -") + @pytest.mark.complete("mussh -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_mutt.py b/test/t/test_mutt.py index b490c88b669..0c4074f8490 100644 --- a/test/t/test_mutt.py +++ b/test/t/test_mutt.py @@ -9,7 +9,7 @@ class TestMutt: def test_1(self, completion): assert completion - @pytest.mark.complete("mutt -F muttrc -f =", cwd="mutt") + @pytest.mark.complete("mutt -F muttrc -f =", require_cmd=True, cwd="mutt") def test_2(self, completion): assert completion == "bar/ foo/ muttrc".split() diff --git a/test/t/test_mypy.py b/test/t/test_mypy.py index cecea92dd52..63fc916c4cd 100644 --- a/test/t/test_mypy.py +++ b/test/t/test_mypy.py @@ -6,7 +6,7 @@ class TestMypy: def test_1(self, completion): assert completion - @pytest.mark.complete("mypy --") + @pytest.mark.complete("mypy --", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_mysqladmin.py b/test/t/test_mysqladmin.py index 74db63b03b4..85046fe5b64 100644 --- a/test/t/test_mysqladmin.py +++ b/test/t/test_mysqladmin.py @@ -2,6 +2,6 @@ class TestMysqladmin: - @pytest.mark.complete("mysqladmin -") + @pytest.mark.complete("mysqladmin -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_ncftp.py b/test/t/test_ncftp.py index 470f6a764ea..b37f48f8fc2 100644 --- a/test/t/test_ncftp.py +++ b/test/t/test_ncftp.py @@ -6,6 +6,6 @@ class TestNcftp: def test_1(self, completion): assert completion - @pytest.mark.complete("ncftp -") + @pytest.mark.complete("ncftp -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_nethogs.py b/test/t/test_nethogs.py index 2c35a143141..c57185fa974 100644 --- a/test/t/test_nethogs.py +++ b/test/t/test_nethogs.py @@ -6,6 +6,6 @@ class TestNethogs: def test_1(self, completion): assert completion - @pytest.mark.complete("nethogs -") + @pytest.mark.complete("nethogs -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_newlist.py b/test/t/test_newlist.py index d51dab26e84..1d6b439a8b1 100644 --- a/test/t/test_newlist.py +++ b/test/t/test_newlist.py @@ -2,6 +2,6 @@ class TestNewlist: - @pytest.mark.complete("newlist -") + @pytest.mark.complete("newlist -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_newusers.py b/test/t/test_newusers.py index 66d18f502b6..51d746a03cf 100644 --- a/test/t/test_newusers.py +++ b/test/t/test_newusers.py @@ -6,6 +6,6 @@ class TestNewusers: def test_1(self, completion): assert completion - @pytest.mark.complete("newusers -") + @pytest.mark.complete("newusers -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_ngrep.py b/test/t/test_ngrep.py index 0d29abd7c0c..53fa60d0a00 100644 --- a/test/t/test_ngrep.py +++ b/test/t/test_ngrep.py @@ -2,7 +2,7 @@ class TestNgrep: - @pytest.mark.complete("ngrep -") + @pytest.mark.complete("ngrep -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_nsupdate.py b/test/t/test_nsupdate.py index 5bae97075cb..b8a133cb3dc 100644 --- a/test/t/test_nsupdate.py +++ b/test/t/test_nsupdate.py @@ -6,6 +6,6 @@ class TestNsupdate: def test_1(self, completion): assert completion - @pytest.mark.complete("nsupdate -") + @pytest.mark.complete("nsupdate -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_ntpdate.py b/test/t/test_ntpdate.py index dc1d5b48ec2..c8d65cfd3c6 100644 --- a/test/t/test_ntpdate.py +++ b/test/t/test_ntpdate.py @@ -2,6 +2,6 @@ class TestNtpdate: - @pytest.mark.complete("ntpdate -") + @pytest.mark.complete("ntpdate -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_oggdec.py b/test/t/test_oggdec.py index 8cabe5cd47e..395bb866e33 100644 --- a/test/t/test_oggdec.py +++ b/test/t/test_oggdec.py @@ -6,6 +6,6 @@ class TestOggdec: def test_1(self, completion): assert completion - @pytest.mark.complete("oggdec --") + @pytest.mark.complete("oggdec --", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_op.py b/test/t/test_op.py index e09c98c8f60..662cde5f763 100644 --- a/test/t/test_op.py +++ b/test/t/test_op.py @@ -2,10 +2,10 @@ class TestOp: - @pytest.mark.complete("op ") + @pytest.mark.complete("op ", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("op --") + @pytest.mark.complete("op --", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_opera.py b/test/t/test_opera.py index 94b7d6dd755..f0c657e770a 100644 --- a/test/t/test_opera.py +++ b/test/t/test_opera.py @@ -6,6 +6,6 @@ class TestOpera: def test_1(self, completion): assert completion - @pytest.mark.complete("opera -") + @pytest.mark.complete("opera -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_optipng.py b/test/t/test_optipng.py index e4650ba988d..615d71fb5b1 100644 --- a/test/t/test_optipng.py +++ b/test/t/test_optipng.py @@ -6,6 +6,6 @@ class TestOptipng: def test_1(self, completion): assert completion - @pytest.mark.complete("optipng -") + @pytest.mark.complete("optipng -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_patch.py b/test/t/test_patch.py index 59f6a44caa7..c68a4b65eeb 100644 --- a/test/t/test_patch.py +++ b/test/t/test_patch.py @@ -6,6 +6,6 @@ class TestPatch: def test_1(self, completion): assert completion - @pytest.mark.complete("patch -") + @pytest.mark.complete("patch -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_pdftotext.py b/test/t/test_pdftotext.py index 9ce4be5797e..90d001f6460 100644 --- a/test/t/test_pdftotext.py +++ b/test/t/test_pdftotext.py @@ -6,6 +6,6 @@ class TestPdftotext: def test_1(self, completion): assert completion - @pytest.mark.complete("pdftotext -") + @pytest.mark.complete("pdftotext -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_perlcritic.py b/test/t/test_perlcritic.py index cc4ef25fd7a..51ba2012e78 100644 --- a/test/t/test_perlcritic.py +++ b/test/t/test_perlcritic.py @@ -6,10 +6,10 @@ class TestPerlcritic: def test_1(self, completion): assert completion - @pytest.mark.complete("perlcritic --") + @pytest.mark.complete("perlcritic --", require_cmd=True) def test_2(self, completion): assert completion - @pytest.mark.complete("perlcritic --theme ") + @pytest.mark.complete("perlcritic --theme ", require_cmd=True) def test_3(self, completion): assert completion diff --git a/test/t/test_perltidy.py b/test/t/test_perltidy.py index 3bafd6e4ddb..578923af59c 100644 --- a/test/t/test_perltidy.py +++ b/test/t/test_perltidy.py @@ -6,14 +6,14 @@ class TestPerltidy: def test_1(self, completion): assert completion - @pytest.mark.complete("perltidy -h") + @pytest.mark.complete("perltidy -h", require_cmd=True) def test_2(self, completion): assert completion - @pytest.mark.complete("perltidy -ole=") + @pytest.mark.complete("perltidy -ole=", require_cmd=True) def test_3(self, completion): assert completion - @pytest.mark.complete("perltidy -doesntexist=") + @pytest.mark.complete("perltidy -doesntexist=", require_cmd=True) def test_4(self, completion): assert not completion diff --git a/test/t/test_pgrep.py b/test/t/test_pgrep.py index 92dffb26735..9c233311914 100644 --- a/test/t/test_pgrep.py +++ b/test/t/test_pgrep.py @@ -8,6 +8,6 @@ class TestPgrep: def test_1(self, completion): assert completion - @pytest.mark.complete("pgrep -") + @pytest.mark.complete("pgrep -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_phing.py b/test/t/test_phing.py index 2e8c10694d6..973a957da25 100644 --- a/test/t/test_phing.py +++ b/test/t/test_phing.py @@ -2,10 +2,10 @@ class TestPhing: - @pytest.mark.complete("phing -") + @pytest.mark.complete("phing -", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("phing -l ") + @pytest.mark.complete("phing -l ", require_cmd=True) def test_2(self, completion): assert not completion diff --git a/test/t/test_pidof.py b/test/t/test_pidof.py index 45dfd56f27d..c33a4d39478 100644 --- a/test/t/test_pidof.py +++ b/test/t/test_pidof.py @@ -8,6 +8,8 @@ class TestPidof: def test_1(self, completion): assert completion - @pytest.mark.complete("pidof -", xfail="! pidof --help &>/dev/null") + @pytest.mark.complete( + "pidof -", require_cmd=True, xfail="! pidof --help &>/dev/null" + ) def test_2(self, completion): assert completion diff --git a/test/t/test_pine.py b/test/t/test_pine.py index 2c5549e05ba..0c95973f67e 100644 --- a/test/t/test_pine.py +++ b/test/t/test_pine.py @@ -2,6 +2,6 @@ class TestPine: - @pytest.mark.complete("pine -") + @pytest.mark.complete("pine -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_pinfo.py b/test/t/test_pinfo.py index b502273f765..a22128e38bd 100644 --- a/test/t/test_pinfo.py +++ b/test/t/test_pinfo.py @@ -3,7 +3,7 @@ @pytest.mark.bashcomp(pre_cmds=("INFOPATH+=:$PWD/info:",)) class TestPinfo: - @pytest.mark.complete("pinfo -") + @pytest.mark.complete("pinfo -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_pkg_config.py b/test/t/test_pkg_config.py index a0703e09eb2..81e02cade56 100644 --- a/test/t/test_pkg_config.py +++ b/test/t/test_pkg_config.py @@ -7,6 +7,6 @@ class TestPkgConfig: def test_1(self, completion): assert completion - @pytest.mark.complete("pkg-config -") + @pytest.mark.complete("pkg-config -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_pkgadd.py b/test/t/test_pkgadd.py index ca6baf27d3e..69d08dcd6de 100644 --- a/test/t/test_pkgadd.py +++ b/test/t/test_pkgadd.py @@ -2,6 +2,7 @@ class TestPkgadd: - @pytest.mark.complete("pkgadd ") + # require_cmd is not strictly true here, but... + @pytest.mark.complete("pkgadd ", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_pkgrm.py b/test/t/test_pkgrm.py index 9cb73571abd..2af81ef9dc1 100644 --- a/test/t/test_pkgrm.py +++ b/test/t/test_pkgrm.py @@ -2,6 +2,7 @@ class TestPkgrm: - @pytest.mark.complete("pkgrm ") + # require_cmd is not strictly true here, but... + @pytest.mark.complete("pkgrm ", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_pkill.py b/test/t/test_pkill.py index a0d0e0bc71e..a779958be5f 100644 --- a/test/t/test_pkill.py +++ b/test/t/test_pkill.py @@ -6,6 +6,6 @@ class TestPkill: def test_1(self, completion): assert completion - @pytest.mark.complete("pkill -") + @pytest.mark.complete("pkill -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_pngfix.py b/test/t/test_pngfix.py index e27f3293770..9b35a398b21 100644 --- a/test/t/test_pngfix.py +++ b/test/t/test_pngfix.py @@ -6,6 +6,6 @@ class TestPngfix: def test_1(self, completion): assert completion - @pytest.mark.complete("pngfix -") + @pytest.mark.complete("pngfix -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_postcat.py b/test/t/test_postcat.py index f716b8a4c7c..73922e2770d 100644 --- a/test/t/test_postcat.py +++ b/test/t/test_postcat.py @@ -6,6 +6,6 @@ class TestPostcat: def test_1(self, completion): assert completion - @pytest.mark.complete("postcat -") + @pytest.mark.complete("postcat -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_postconf.py b/test/t/test_postconf.py index 172285f1114..e0349566d78 100644 --- a/test/t/test_postconf.py +++ b/test/t/test_postconf.py @@ -2,7 +2,7 @@ class TestPostconf: - @pytest.mark.complete("postconf -") + @pytest.mark.complete("postconf -", require_cmd=True) def test_1(self, completion): assert len(completion) > 1 @@ -13,6 +13,8 @@ def test_1(self, completion): # for ::1 # ...and output can be cut off somewhere near lmtp_tls_secur*. # ...or be completely missing, so all we can do is to skip. - @pytest.mark.complete("postconf al", xfail="! postconf &>/dev/null") + @pytest.mark.complete( + "postconf al", require_cmd=True, xfail="! postconf &>/dev/null" + ) def test_2(self, completion): assert completion diff --git a/test/t/test_postfix.py b/test/t/test_postfix.py index d5d5385ab79..67a898d1217 100644 --- a/test/t/test_postfix.py +++ b/test/t/test_postfix.py @@ -7,6 +7,6 @@ def test_1(self, completion): assert completion @pytest.mark.xfail # see TODO in completion - @pytest.mark.complete("postfix -") + @pytest.mark.complete("postfix -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_postmap.py b/test/t/test_postmap.py index aab837d585e..ee3eee7ab77 100644 --- a/test/t/test_postmap.py +++ b/test/t/test_postmap.py @@ -6,6 +6,6 @@ class TestPostmap: def test_1(self, completion): assert completion - @pytest.mark.complete("postmap -") + @pytest.mark.complete("postmap -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_prelink.py b/test/t/test_prelink.py index ef8baecedcb..e75b9699f7e 100644 --- a/test/t/test_prelink.py +++ b/test/t/test_prelink.py @@ -6,6 +6,6 @@ class TestPrelink: def test_1(self, completion): assert completion - @pytest.mark.complete("prelink -") + @pytest.mark.complete("prelink -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_protoc.py b/test/t/test_protoc.py index 2f298c8970c..e890c56a29e 100644 --- a/test/t/test_protoc.py +++ b/test/t/test_protoc.py @@ -6,6 +6,6 @@ class TestProtoc: def test_1(self, completion): assert completion - @pytest.mark.complete("protoc -") + @pytest.mark.complete("protoc -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_psql.py b/test/t/test_psql.py index 8f447236fb8..ffd6c0583d5 100644 --- a/test/t/test_psql.py +++ b/test/t/test_psql.py @@ -4,6 +4,8 @@ class TestPsql: # --help can fail due to missing package dependencies, e.g. on Ubuntu 14 - @pytest.mark.complete("psql -", xfail="! psql --help &>/dev/null") + @pytest.mark.complete( + "psql -", require_cmd=True, xfail="! psql --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_pv.py b/test/t/test_pv.py index ffca68df564..ad04c47b097 100644 --- a/test/t/test_pv.py +++ b/test/t/test_pv.py @@ -6,7 +6,7 @@ class TestPv: def test_1(self, completion): assert completion - @pytest.mark.complete("pv -") + @pytest.mark.complete("pv -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_pvchange.py b/test/t/test_pvchange.py index f9f7dfff840..4b0a94cb07b 100644 --- a/test/t/test_pvchange.py +++ b/test/t/test_pvchange.py @@ -2,6 +2,8 @@ class TestPvchange: - @pytest.mark.complete("pvchange --", xfail="! pvchange --help &>/dev/null") + @pytest.mark.complete( + "pvchange --", require_cmd=True, xfail="! pvchange --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_pvcreate.py b/test/t/test_pvcreate.py index b3f39d34790..2847c47e8d2 100644 --- a/test/t/test_pvcreate.py +++ b/test/t/test_pvcreate.py @@ -2,6 +2,8 @@ class TestPvcreate: - @pytest.mark.complete("pvcreate --", xfail="! pvcreate --help &>/dev/null") + @pytest.mark.complete( + "pvcreate --", require_cmd=True, xfail="! pvcreate --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_pvdisplay.py b/test/t/test_pvdisplay.py index fccd92126ca..9d1ea83c90f 100644 --- a/test/t/test_pvdisplay.py +++ b/test/t/test_pvdisplay.py @@ -3,7 +3,9 @@ class TestPvdisplay: @pytest.mark.complete( - "pvdisplay --", xfail="! pvdisplay --help &>/dev/null" + "pvdisplay --", + require_cmd=True, + xfail="! pvdisplay --help &>/dev/null", ) def test_1(self, completion): assert completion diff --git a/test/t/test_pvmove.py b/test/t/test_pvmove.py index d4b0ad33214..e0e2ee899f5 100644 --- a/test/t/test_pvmove.py +++ b/test/t/test_pvmove.py @@ -2,6 +2,8 @@ class TestPvmove: - @pytest.mark.complete("pvmove --", xfail="! pvmove --help &>/dev/null") + @pytest.mark.complete( + "pvmove --", require_cmd=True, xfail="! pvmove --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_pvremove.py b/test/t/test_pvremove.py index bf3274f3652..c9c031ab3f6 100644 --- a/test/t/test_pvremove.py +++ b/test/t/test_pvremove.py @@ -2,6 +2,8 @@ class TestPvremove: - @pytest.mark.complete("pvremove --", xfail="! pvremove --help &>/dev/null") + @pytest.mark.complete( + "pvremove --", require_cmd=True, xfail="! pvremove --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_pvs.py b/test/t/test_pvs.py index 0df61fbc10f..ac173a72703 100644 --- a/test/t/test_pvs.py +++ b/test/t/test_pvs.py @@ -2,6 +2,8 @@ class TestPvs: - @pytest.mark.complete("pvs --", xfail="! pvs --help &>/dev/null") + @pytest.mark.complete( + "pvs --", require_cmd=True, xfail="! pvs --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_pvscan.py b/test/t/test_pvscan.py index 16361f37acb..e2789565466 100644 --- a/test/t/test_pvscan.py +++ b/test/t/test_pvscan.py @@ -2,6 +2,8 @@ class TestPvscan: - @pytest.mark.complete("pvscan --", xfail="! pvscan --help &>/dev/null") + @pytest.mark.complete( + "pvscan --", require_cmd=True, xfail="! pvscan --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_pwck.py b/test/t/test_pwck.py index a19d5c28910..1e36f87e1f2 100644 --- a/test/t/test_pwck.py +++ b/test/t/test_pwck.py @@ -6,6 +6,6 @@ class TestPwck: def test_1(self, completion): assert completion - @pytest.mark.complete("pwck -") + @pytest.mark.complete("pwck -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_pwdx.py b/test/t/test_pwdx.py index 0cc42d728ee..552c82c9577 100644 --- a/test/t/test_pwdx.py +++ b/test/t/test_pwdx.py @@ -8,6 +8,7 @@ def test_1(self, completion): @pytest.mark.complete( "pwdx -", + require_cmd=True, xfail=( "! (pwdx --help 2>&1 || :) | " "command grep -vF 'invalid process id: --help' | " diff --git a/test/t/test_pwgen.py b/test/t/test_pwgen.py index 54c194cfb8b..20ecd73b900 100644 --- a/test/t/test_pwgen.py +++ b/test/t/test_pwgen.py @@ -2,6 +2,6 @@ class TestPwgen: - @pytest.mark.complete("pwgen -") + @pytest.mark.complete("pwgen -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_pycodestyle.py b/test/t/test_pycodestyle.py index 03c58eec161..4b4f3a43ec4 100644 --- a/test/t/test_pycodestyle.py +++ b/test/t/test_pycodestyle.py @@ -6,7 +6,7 @@ class TestPycodestyle: def test_1(self, completion): assert completion - @pytest.mark.complete("pycodestyle -") + @pytest.mark.complete("pycodestyle -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_pydoc.py b/test/t/test_pydoc.py index 5e6274b5646..7cf7eb53934 100644 --- a/test/t/test_pydoc.py +++ b/test/t/test_pydoc.py @@ -2,10 +2,10 @@ class TestPydoc: - @pytest.mark.complete("pydoc r") + @pytest.mark.complete("pydoc r", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("pydoc -") + @pytest.mark.complete("pydoc -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_pydocstyle.py b/test/t/test_pydocstyle.py index 4deb45fe168..caa87902917 100644 --- a/test/t/test_pydocstyle.py +++ b/test/t/test_pydocstyle.py @@ -6,6 +6,6 @@ class TestPydocstyle: def test_1(self, completion): assert completion - @pytest.mark.complete("pydocstyle -") + @pytest.mark.complete("pydocstyle -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_pyflakes.py b/test/t/test_pyflakes.py index d87fca46008..96703217dd3 100644 --- a/test/t/test_pyflakes.py +++ b/test/t/test_pyflakes.py @@ -6,6 +6,6 @@ class TestPyflakes: def test_1(self, completion): assert completion - @pytest.mark.complete("pyflakes -") + @pytest.mark.complete("pyflakes -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_pylint.py b/test/t/test_pylint.py index e08507aa597..4b79953219f 100644 --- a/test/t/test_pylint.py +++ b/test/t/test_pylint.py @@ -2,7 +2,7 @@ class TestPylint: - @pytest.mark.complete("pylint --v") + @pytest.mark.complete("pylint --v", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_pylint_3.py b/test/t/test_pylint_3.py index 305db7d36e0..ee498c3288b 100644 --- a/test/t/test_pylint_3.py +++ b/test/t/test_pylint_3.py @@ -3,7 +3,7 @@ @pytest.mark.bashcomp(cmd="pylint-3") class TestPylint3: - @pytest.mark.complete("pylint-3 --v") + @pytest.mark.complete("pylint-3 --v", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_python.py b/test/t/test_python.py index 4990f957b49..578027210be 100644 --- a/test/t/test_python.py +++ b/test/t/test_python.py @@ -6,7 +6,7 @@ class TestPython: def test_1(self, completion): assert completion - @pytest.mark.complete("python -") + @pytest.mark.complete("python -", require_cmd=True) def test_2(self, completion): assert len(completion) > 1 @@ -30,6 +30,6 @@ def test_6(self, completion): def test_7(self, completion): assert not completion - @pytest.mark.complete("python -m sy") + @pytest.mark.complete("python -m sy", require_cmd=True) def test_8(self, completion): assert completion diff --git a/test/t/test_python3.py b/test/t/test_python3.py index 3f2b5f9e235..b968a34eca5 100644 --- a/test/t/test_python3.py +++ b/test/t/test_python3.py @@ -6,7 +6,7 @@ class TestPython3: def test_1(self, completion): assert completion - @pytest.mark.complete("python3 -") + @pytest.mark.complete("python3 -", require_cmd=True) def test_2(self, completion): assert len(completion) > 1 @@ -30,6 +30,6 @@ def test_6(self, completion): def test_7(self, completion): assert not completion - @pytest.mark.complete("python3 -m sy") + @pytest.mark.complete("python3 -m sy", require_cmd=True) def test_8(self, completion): assert completion diff --git a/test/t/test_qemu.py b/test/t/test_qemu.py index b2bacbd305e..129c0b4f19c 100644 --- a/test/t/test_qemu.py +++ b/test/t/test_qemu.py @@ -6,6 +6,6 @@ class TestQemu: def test_1(self, completion): assert completion - @pytest.mark.complete("qemu -") + @pytest.mark.complete("qemu -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_querybts.py b/test/t/test_querybts.py index dd3af4f9184..9c81d134a99 100644 --- a/test/t/test_querybts.py +++ b/test/t/test_querybts.py @@ -2,6 +2,6 @@ class TestQuerybts: - @pytest.mark.complete("querybts --") + @pytest.mark.complete("querybts --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_quota.py b/test/t/test_quota.py index 9ecdfa100c9..c74453559a3 100644 --- a/test/t/test_quota.py +++ b/test/t/test_quota.py @@ -6,6 +6,6 @@ class TestQuota: def test_1(self, completion): assert completion - @pytest.mark.complete("quota -") + @pytest.mark.complete("quota -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_quotacheck.py b/test/t/test_quotacheck.py index 0311befb442..81406040fe6 100644 --- a/test/t/test_quotacheck.py +++ b/test/t/test_quotacheck.py @@ -2,6 +2,6 @@ class TestQuotacheck: - @pytest.mark.complete("quotacheck -") + @pytest.mark.complete("quotacheck -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_quotaon.py b/test/t/test_quotaon.py index 46bf55460ee..c4386c6af59 100644 --- a/test/t/test_quotaon.py +++ b/test/t/test_quotaon.py @@ -2,6 +2,6 @@ class TestQuotaon: - @pytest.mark.complete("quotaon -") + @pytest.mark.complete("quotaon -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_radvdump.py b/test/t/test_radvdump.py index 265961010fc..a8a16d909a1 100644 --- a/test/t/test_radvdump.py +++ b/test/t/test_radvdump.py @@ -2,10 +2,10 @@ class TestRadvdump: - @pytest.mark.complete("radvdump ") + @pytest.mark.complete("radvdump ", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("radvdump -") + @pytest.mark.complete("radvdump -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_rdesktop.py b/test/t/test_rdesktop.py index b82b471ed21..f20ca51883b 100644 --- a/test/t/test_rdesktop.py +++ b/test/t/test_rdesktop.py @@ -2,6 +2,6 @@ class TestRdesktop: - @pytest.mark.complete("rdesktop -") + @pytest.mark.complete("rdesktop -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_rdict.py b/test/t/test_rdict.py index 86d7c087d97..da6fb1bb0e5 100644 --- a/test/t/test_rdict.py +++ b/test/t/test_rdict.py @@ -2,6 +2,6 @@ class TestRdict: - @pytest.mark.complete("rdict --") + @pytest.mark.complete("rdict --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_readelf.py b/test/t/test_readelf.py index 5c5dff371b5..07ce347f897 100644 --- a/test/t/test_readelf.py +++ b/test/t/test_readelf.py @@ -2,6 +2,6 @@ class TestReadelf: - @pytest.mark.complete("readelf --") + @pytest.mark.complete("readelf --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_repomanage.py b/test/t/test_repomanage.py index 9d5a1994268..bdaba1561ba 100644 --- a/test/t/test_repomanage.py +++ b/test/t/test_repomanage.py @@ -6,6 +6,6 @@ class TestRepomanage: def test_1(self, completion): assert completion - @pytest.mark.complete("repomanage -") + @pytest.mark.complete("repomanage -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_reportbug.py b/test/t/test_reportbug.py index 612a96b8149..2c57b56ded1 100644 --- a/test/t/test_reportbug.py +++ b/test/t/test_reportbug.py @@ -2,6 +2,6 @@ class TestReportbug: - @pytest.mark.complete("reportbug --m") + @pytest.mark.complete("reportbug --m", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_reptyr.py b/test/t/test_reptyr.py index 62a9b1c5f0b..7c27cb55119 100644 --- a/test/t/test_reptyr.py +++ b/test/t/test_reptyr.py @@ -6,6 +6,6 @@ class TestReptyr: def test_1(self, completion): assert completion - @pytest.mark.complete("reptyr -") + @pytest.mark.complete("reptyr -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_ri.py b/test/t/test_ri.py index e54f18bb961..9430b667f5c 100644 --- a/test/t/test_ri.py +++ b/test/t/test_ri.py @@ -3,7 +3,7 @@ @pytest.mark.bashcomp(pre_cmds=("export RI='-d ri'",)) class TestRi: - @pytest.mark.complete("ri -") + @pytest.mark.complete("ri -", require_cmd=True) def test_1(self, completion): assert completion @@ -11,6 +11,6 @@ def test_1(self, completion): def test_2(self, completion): assert completion == "BashCompletion/ cache.ri".split() - @pytest.mark.complete("ri BashCompletio") + @pytest.mark.complete("ri BashCompletio", require_cmd=True) def test_3(self, completion): assert completion == "BashCompletion" diff --git a/test/t/test_rpm.py b/test/t/test_rpm.py index 069691a03fc..e6f7198929f 100644 --- a/test/t/test_rpm.py +++ b/test/t/test_rpm.py @@ -10,6 +10,6 @@ def test_1(self, completion): def test_2(self, completion): assert completion - @pytest.mark.complete("rpm -") + @pytest.mark.complete("rpm -", require_cmd=True) def test_3(self, completion): assert completion diff --git a/test/t/test_rpmbuild.py b/test/t/test_rpmbuild.py index 13f164ba452..06c8087d6c6 100644 --- a/test/t/test_rpmbuild.py +++ b/test/t/test_rpmbuild.py @@ -2,6 +2,6 @@ class TestRpmbuild: - @pytest.mark.complete("rpmbuild -") + @pytest.mark.complete("rpmbuild -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_rtcwake.py b/test/t/test_rtcwake.py index 2868c66ef95..19d1dfe3fed 100644 --- a/test/t/test_rtcwake.py +++ b/test/t/test_rtcwake.py @@ -2,10 +2,10 @@ class TestRtcwake: - @pytest.mark.complete("rtcwake ") + @pytest.mark.complete("rtcwake ", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("rtcwake -") + @pytest.mark.complete("rtcwake -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_sbopkg.py b/test/t/test_sbopkg.py index cb1f73602e5..44f15219a4b 100644 --- a/test/t/test_sbopkg.py +++ b/test/t/test_sbopkg.py @@ -2,6 +2,6 @@ class TestSbopkg: - @pytest.mark.complete("sbopkg -") + @pytest.mark.complete("sbopkg -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_scrub.py b/test/t/test_scrub.py index cedcc061ed9..5853ad2b58b 100644 --- a/test/t/test_scrub.py +++ b/test/t/test_scrub.py @@ -6,7 +6,7 @@ class TestScrub: def test_1(self, completion): assert completion - @pytest.mark.complete("scrub -") + @pytest.mark.complete("scrub -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_sed.py b/test/t/test_sed.py index cb120f69c11..e2b4554081d 100644 --- a/test/t/test_sed.py +++ b/test/t/test_sed.py @@ -4,6 +4,7 @@ class TestSed: @pytest.mark.complete( "sed --", + require_cmd=True, xfail=( "! sed --help &>/dev/null || " "! sed --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_seq.py b/test/t/test_seq.py index 617c910d107..5a6d6a6d22c 100644 --- a/test/t/test_seq.py +++ b/test/t/test_seq.py @@ -4,6 +4,7 @@ class TestSeq: @pytest.mark.complete( "seq --", + require_cmd=True, xfail=( "! seq --help &>/dev/null || " "! seq --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_setquota.py b/test/t/test_setquota.py index 62ccaa4b013..76fd7b9bdc1 100644 --- a/test/t/test_setquota.py +++ b/test/t/test_setquota.py @@ -6,6 +6,6 @@ class TestSetquota: def test_1(self, completion): assert completion - @pytest.mark.complete("setquota -") + @pytest.mark.complete("setquota -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_sftp.py b/test/t/test_sftp.py index 47e3e22ed57..0c039399f80 100644 --- a/test/t/test_sftp.py +++ b/test/t/test_sftp.py @@ -6,6 +6,6 @@ class TestSftp: def test_1(self, completion): assert completion == "-Fspaced conf" - @pytest.mark.complete("sftp -") + @pytest.mark.complete("sftp -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_sha1sum.py b/test/t/test_sha1sum.py index 404fc386fb2..d4fd2782538 100644 --- a/test/t/test_sha1sum.py +++ b/test/t/test_sha1sum.py @@ -4,6 +4,7 @@ class TestSha1sum: @pytest.mark.complete( "sha1sum --", + require_cmd=True, xfail=( "! sha1sum --help &>/dev/null || " "! sha1sum --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_shar.py b/test/t/test_shar.py index f73c4b8704f..5c23004e32e 100644 --- a/test/t/test_shar.py +++ b/test/t/test_shar.py @@ -2,6 +2,6 @@ class TestShar: - @pytest.mark.complete("shar --") + @pytest.mark.complete("shar --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_shellcheck.py b/test/t/test_shellcheck.py index 54bc46369f5..703128f108b 100644 --- a/test/t/test_shellcheck.py +++ b/test/t/test_shellcheck.py @@ -6,14 +6,14 @@ class TestShellcheck: def test_1(self, completion): assert completion - @pytest.mark.complete("shellcheck -") + @pytest.mark.complete("shellcheck -", require_cmd=True) def test_2(self, completion): assert completion - @pytest.mark.complete("shellcheck --format=") + @pytest.mark.complete("shellcheck --format=", require_cmd=True) def test_3(self, completion): assert completion - @pytest.mark.complete("shellcheck -s ") + @pytest.mark.complete("shellcheck -s ", require_cmd=True) def test_4(self, completion): assert "bash" in completion diff --git a/test/t/test_sitecopy.py b/test/t/test_sitecopy.py index de66a5dc824..afdeeaa83c4 100644 --- a/test/t/test_sitecopy.py +++ b/test/t/test_sitecopy.py @@ -2,6 +2,6 @@ class TestSitecopy: - @pytest.mark.complete("sitecopy --") + @pytest.mark.complete("sitecopy --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_slapt_get.py b/test/t/test_slapt_get.py index 1254d5b4cfb..626dde9e199 100644 --- a/test/t/test_slapt_get.py +++ b/test/t/test_slapt_get.py @@ -3,11 +3,11 @@ @pytest.mark.bashcomp(cmd="slapt-get") class TestSlaptGet: - @pytest.mark.complete("slapt-get -") + @pytest.mark.complete("slapt-get -", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("slapt-get --up") + @pytest.mark.complete("slapt-get --up", require_cmd=True) def test_2(self, completion): assert completion == "--update --upgrade".split() diff --git a/test/t/test_slapt_src.py b/test/t/test_slapt_src.py index df5f4da0503..dd443b041fb 100644 --- a/test/t/test_slapt_src.py +++ b/test/t/test_slapt_src.py @@ -3,14 +3,14 @@ @pytest.mark.bashcomp(cmd="slapt-src") class TestSlaptSrc: - @pytest.mark.complete("slapt-src -") + @pytest.mark.complete("slapt-src -", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("slapt-src --bu") + @pytest.mark.complete("slapt-src --bu", require_cmd=True) def test_2(self, completion): assert completion == "--build" - @pytest.mark.complete("slapt-src --ins") + @pytest.mark.complete("slapt-src --ins", require_cmd=True) def test_3(self, completion): assert completion == "--install" diff --git a/test/t/test_smbcacls.py b/test/t/test_smbcacls.py index 1ff16e2bbaf..0fe84e30048 100644 --- a/test/t/test_smbcacls.py +++ b/test/t/test_smbcacls.py @@ -2,6 +2,6 @@ class TestSmbcacls: - @pytest.mark.complete("smbcacls -") + @pytest.mark.complete("smbcacls -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_smbclient.py b/test/t/test_smbclient.py index ed2da4b015d..250ab876c98 100644 --- a/test/t/test_smbclient.py +++ b/test/t/test_smbclient.py @@ -2,6 +2,6 @@ class TestSmbclient: - @pytest.mark.complete("smbclient -") + @pytest.mark.complete("smbclient -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_smbcquotas.py b/test/t/test_smbcquotas.py index b7e01d29eb5..16157ed741c 100644 --- a/test/t/test_smbcquotas.py +++ b/test/t/test_smbcquotas.py @@ -2,6 +2,6 @@ class TestSmbcquotas: - @pytest.mark.complete("smbcquotas -") + @pytest.mark.complete("smbcquotas -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_smbget.py b/test/t/test_smbget.py index a360bd3c92d..a6df717aa2b 100644 --- a/test/t/test_smbget.py +++ b/test/t/test_smbget.py @@ -2,6 +2,6 @@ class TestSmbget: - @pytest.mark.complete("smbget -") + @pytest.mark.complete("smbget -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_smbpasswd.py b/test/t/test_smbpasswd.py index 4d0e76bae26..9fae8f269d9 100644 --- a/test/t/test_smbpasswd.py +++ b/test/t/test_smbpasswd.py @@ -2,6 +2,6 @@ class TestSmbpasswd: - @pytest.mark.complete("smbpasswd -") + @pytest.mark.complete("smbpasswd -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_smbtar.py b/test/t/test_smbtar.py index 44b424bcfdd..2a0e01e992e 100644 --- a/test/t/test_smbtar.py +++ b/test/t/test_smbtar.py @@ -2,6 +2,6 @@ class TestSmbtar: - @pytest.mark.complete("smbtar -") + @pytest.mark.complete("smbtar -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_smbtree.py b/test/t/test_smbtree.py index 0eba4b546f8..2cb6767e8dd 100644 --- a/test/t/test_smbtree.py +++ b/test/t/test_smbtree.py @@ -2,6 +2,6 @@ class TestSmbtree: - @pytest.mark.complete("smbtree -") + @pytest.mark.complete("smbtree -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_snownews.py b/test/t/test_snownews.py index 24ed2dfef3d..a05df98d4ab 100644 --- a/test/t/test_snownews.py +++ b/test/t/test_snownews.py @@ -2,6 +2,6 @@ class TestSnownews: - @pytest.mark.complete("snownews --") + @pytest.mark.complete("snownews --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_sort.py b/test/t/test_sort.py index 556a20bcaae..58481784a36 100644 --- a/test/t/test_sort.py +++ b/test/t/test_sort.py @@ -4,6 +4,7 @@ class TestSort: @pytest.mark.complete( "sort --", + require_cmd=True, xfail=( "! sort --help &>/dev/null || " "! sort --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_split.py b/test/t/test_split.py index bffa2e9caea..8642040ed18 100644 --- a/test/t/test_split.py +++ b/test/t/test_split.py @@ -4,6 +4,7 @@ class TestSplit: @pytest.mark.complete( "split --", + require_cmd=True, xfail=( "! split --help &>/dev/null || " "! split --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_sqlite3.py b/test/t/test_sqlite3.py index 466281a902f..69a13162a1c 100644 --- a/test/t/test_sqlite3.py +++ b/test/t/test_sqlite3.py @@ -6,10 +6,10 @@ class TestSqlite3: def test_1(self, completion): assert completion - @pytest.mark.complete("sqlite3 -") + @pytest.mark.complete("sqlite3 -", require_cmd=True) def test_2(self, completion): assert completion - @pytest.mark.complete("sqlite3 -scratch foo ") + @pytest.mark.complete("sqlite3 -scratch foo ", require_cmd=True) def test_3(self, completion): assert not completion diff --git a/test/t/test_ss.py b/test/t/test_ss.py index 3e515dde723..716c0fd77f4 100644 --- a/test/t/test_ss.py +++ b/test/t/test_ss.py @@ -2,14 +2,14 @@ class TestSs: - @pytest.mark.complete("ss -") + @pytest.mark.complete("ss -", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("ss -A ") + @pytest.mark.complete("ss -A ", require_cmd=True) def test_2(self, completion): assert completion - @pytest.mark.complete("ss -A foo,") + @pytest.mark.complete("ss -A foo,", require_cmd=True) def test_3(self, completion): assert completion diff --git a/test/t/test_ssh.py b/test/t/test_ssh.py index 282a248a49c..204b7c7cc49 100644 --- a/test/t/test_ssh.py +++ b/test/t/test_ssh.py @@ -29,6 +29,6 @@ def test_4(self, completion): def test_5(self, completion): assert "UserKnownHostsFile=" in completion - @pytest.mark.complete("ssh -") + @pytest.mark.complete("ssh -", require_cmd=True) def test_6(self, completion): assert completion diff --git a/test/t/test_ssh_add.py b/test/t/test_ssh_add.py index bf95bfd12df..7e493724b70 100644 --- a/test/t/test_ssh_add.py +++ b/test/t/test_ssh_add.py @@ -9,6 +9,7 @@ def test_1(self, completion): @pytest.mark.complete( "ssh-add -", + require_cmd=True, xfail="ssh-add --help 2>&1 | " "command grep -qiF 'Could not open a connection'", ) diff --git a/test/t/test_ssh_copy_id.py b/test/t/test_ssh_copy_id.py index cb607715d89..e38e9014556 100644 --- a/test/t/test_ssh_copy_id.py +++ b/test/t/test_ssh_copy_id.py @@ -11,6 +11,6 @@ ignore_env=r"^[+-]_scp_path_esc=", ) class TestSshCopyId: - @pytest.mark.complete("ssh-copy-id -") + @pytest.mark.complete("ssh-copy-id -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_ssh_keygen.py b/test/t/test_ssh_keygen.py index 628672d4517..2d53f5f8dc0 100644 --- a/test/t/test_ssh_keygen.py +++ b/test/t/test_ssh_keygen.py @@ -3,6 +3,6 @@ @pytest.mark.bashcomp(cmd="ssh-keygen") class TestSshKeygen: - @pytest.mark.complete("ssh-keygen -") + @pytest.mark.complete("ssh-keygen -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_sshmitm.py b/test/t/test_sshmitm.py index 9964c5b5644..671fcf52e0f 100644 --- a/test/t/test_sshmitm.py +++ b/test/t/test_sshmitm.py @@ -2,6 +2,6 @@ class TestSshmitm: - @pytest.mark.complete("sshmitm -") + @pytest.mark.complete("sshmitm -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_sshow.py b/test/t/test_sshow.py index b6811e0cbd7..563bc6b4058 100644 --- a/test/t/test_sshow.py +++ b/test/t/test_sshow.py @@ -2,6 +2,6 @@ class TestSshow: - @pytest.mark.complete("sshow -") + @pytest.mark.complete("sshow -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_strace.py b/test/t/test_strace.py index b9dbfacabce..e0d6aedf79f 100644 --- a/test/t/test_strace.py +++ b/test/t/test_strace.py @@ -2,6 +2,6 @@ class TestStrace: - @pytest.mark.complete("strace -") + @pytest.mark.complete("strace -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_strings.py b/test/t/test_strings.py index 36ce48aec2a..6b5d01247a2 100644 --- a/test/t/test_strings.py +++ b/test/t/test_strings.py @@ -6,6 +6,6 @@ class TestStrings: def test_1(self, completion): assert completion - @pytest.mark.complete("strings -") + @pytest.mark.complete("strings -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_strip.py b/test/t/test_strip.py index c756fe03149..105012fdec0 100644 --- a/test/t/test_strip.py +++ b/test/t/test_strip.py @@ -2,6 +2,6 @@ class TestStrip: - @pytest.mark.complete("strip --") + @pytest.mark.complete("strip --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_su.py b/test/t/test_su.py index 340c10d70ea..9aa064dd840 100644 --- a/test/t/test_su.py +++ b/test/t/test_su.py @@ -6,6 +6,6 @@ class TestSu: def test_1(self, completion): assert completion - @pytest.mark.complete("su -") + @pytest.mark.complete("su -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_sudo.py b/test/t/test_sudo.py index 761c56048ed..ced6662e56c 100644 --- a/test/t/test_sudo.py +++ b/test/t/test_sudo.py @@ -4,7 +4,7 @@ class TestSudo: - @pytest.mark.complete("sudo -") + @pytest.mark.complete("sudo -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_synclient.py b/test/t/test_synclient.py index 28780a5c868..8a31a654b6f 100644 --- a/test/t/test_synclient.py +++ b/test/t/test_synclient.py @@ -5,10 +5,12 @@ class TestSynclient: # synclient -l may error out with e.g. # "Couldn't find synaptics properties. No synaptics driver loaded?" - @pytest.mark.complete("synclient ", xfail="! synclient -l &>/dev/null") + @pytest.mark.complete( + "synclient ", require_cmd=True, xfail="! synclient -l &>/dev/null" + ) def test_1(self, completion): assert completion - @pytest.mark.complete("synclient -") + @pytest.mark.complete("synclient -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_sysbench.py b/test/t/test_sysbench.py index f50f1807a69..4992d8a6d17 100644 --- a/test/t/test_sysbench.py +++ b/test/t/test_sysbench.py @@ -2,10 +2,10 @@ class TestSysbench: - @pytest.mark.complete("sysbench ") + @pytest.mark.complete("sysbench ", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("sysbench -") + @pytest.mark.complete("sysbench -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_tac.py b/test/t/test_tac.py index 43100978ac0..2627e3b70cb 100644 --- a/test/t/test_tac.py +++ b/test/t/test_tac.py @@ -4,6 +4,7 @@ class TestTac: @pytest.mark.complete( "tac --", + require_cmd=True, xfail=( "! tac --help &>/dev/null || " "! tac --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_tail.py b/test/t/test_tail.py index bc75624284d..4b8b8a831dd 100644 --- a/test/t/test_tail.py +++ b/test/t/test_tail.py @@ -4,6 +4,7 @@ class TestTail: @pytest.mark.complete( "tail --", + require_cmd=True, xfail=( "! tail --help &>/dev/null || " "! tail --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_tcpdump.py b/test/t/test_tcpdump.py index ec26187fdf6..a5573640898 100644 --- a/test/t/test_tcpdump.py +++ b/test/t/test_tcpdump.py @@ -2,6 +2,6 @@ class TestTcpdump: - @pytest.mark.complete("tcpdump -") + @pytest.mark.complete("tcpdump -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_tcpnice.py b/test/t/test_tcpnice.py index c7d208d1e1d..fbe9592212a 100644 --- a/test/t/test_tcpnice.py +++ b/test/t/test_tcpnice.py @@ -2,6 +2,6 @@ class TestTcpnice: - @pytest.mark.complete("tcpnice -") + @pytest.mark.complete("tcpnice -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_texindex.py b/test/t/test_texindex.py index 4a2387ff688..c3f6a0b1ba4 100644 --- a/test/t/test_texindex.py +++ b/test/t/test_texindex.py @@ -2,6 +2,6 @@ class TestTexindex: - @pytest.mark.complete("texindex --") + @pytest.mark.complete("texindex --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_touch.py b/test/t/test_touch.py index 83c889cdcbf..bf6de8e4b0e 100644 --- a/test/t/test_touch.py +++ b/test/t/test_touch.py @@ -4,6 +4,7 @@ class TestTouch: @pytest.mark.complete( "touch --", + require_cmd=True, xfail=( "! touch --help &>/dev/null || " "! touch --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_tr.py b/test/t/test_tr.py index adbff48cad5..da907eb3e1b 100644 --- a/test/t/test_tr.py +++ b/test/t/test_tr.py @@ -4,6 +4,7 @@ class TestTr: @pytest.mark.complete( "tr --", + require_cmd=True, xfail=( "! tr --help &>/dev/null || " "! tr --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_tracepath.py b/test/t/test_tracepath.py index a6ef7a4185d..e4cac656312 100644 --- a/test/t/test_tracepath.py +++ b/test/t/test_tracepath.py @@ -6,6 +6,6 @@ class TestTracepath: def test_1(self, completion): assert completion - @pytest.mark.complete("tracepath -") + @pytest.mark.complete("tracepath -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_tshark.py b/test/t/test_tshark.py index 6505e6a8aa4..8ed881eee24 100644 --- a/test/t/test_tshark.py +++ b/test/t/test_tshark.py @@ -3,25 +3,25 @@ @pytest.mark.bashcomp(ignore_env=r"^\+_tshark_pr(ef|otocol)s=") class TestTshark: - @pytest.mark.complete("tshark -") + @pytest.mark.complete("tshark -", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("tshark -G ") + @pytest.mark.complete("tshark -G ", require_cmd=True) def test_2(self, completion): assert completion - @pytest.mark.complete("tshark -O foo,htt") + @pytest.mark.complete("tshark -O foo,htt", require_cmd=True) def test_3(self, completion): # When there's only one completion, it's be the one with "foo," prefix; # when multiple (e.g. http and http2), it's the completion alone. assert completion == "foo,http" or "http" in completion - @pytest.mark.complete("tshark -o tcp") + @pytest.mark.complete("tshark -o tcp", require_cmd=True) def test_4(self, completion): assert "tcp.desegment_tcp_streams:" in completion - @pytest.mark.complete("tshark -otcp") + @pytest.mark.complete("tshark -otcp", require_cmd=True) def test_5(self, completion): assert "-otcp.desegment_tcp_streams:" in completion diff --git a/test/t/test_tune2fs.py b/test/t/test_tune2fs.py index b738870edb7..5cc0e41effb 100644 --- a/test/t/test_tune2fs.py +++ b/test/t/test_tune2fs.py @@ -6,6 +6,6 @@ class TestTune2fs: def test_1(self, completion): assert completion - @pytest.mark.complete("tune2fs -") + @pytest.mark.complete("tune2fs -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_udevadm.py b/test/t/test_udevadm.py index d06e58e43ab..6191c770954 100644 --- a/test/t/test_udevadm.py +++ b/test/t/test_udevadm.py @@ -2,10 +2,10 @@ class TestUdevadm: - @pytest.mark.complete("udevadm ") + @pytest.mark.complete("udevadm ", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("udevadm -") + @pytest.mark.complete("udevadm -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_uname.py b/test/t/test_uname.py index 8c7a797b12d..133377f0cc0 100644 --- a/test/t/test_uname.py +++ b/test/t/test_uname.py @@ -4,6 +4,7 @@ class TestUname: @pytest.mark.complete( "uname --", + require_cmd=True, xfail=( "! uname --help &>/dev/null || " "! uname --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_unexpand.py b/test/t/test_unexpand.py index 701f8d54b09..b9b34f3ec2d 100644 --- a/test/t/test_unexpand.py +++ b/test/t/test_unexpand.py @@ -4,6 +4,7 @@ class TestUnexpand: @pytest.mark.complete( "unexpand --", + require_cmd=True, xfail=( "! unexpand --help &>/dev/null || " "! unexpand --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_uniq.py b/test/t/test_uniq.py index 22286da7eaf..8d99d09b14b 100644 --- a/test/t/test_uniq.py +++ b/test/t/test_uniq.py @@ -4,6 +4,7 @@ class TestUniq: @pytest.mark.complete( "uniq --", + require_cmd=True, xfail=( "! uniq --help &>/dev/null || " "! uniq --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_units.py b/test/t/test_units.py index fbdd6595e7b..824e2ce4784 100644 --- a/test/t/test_units.py +++ b/test/t/test_units.py @@ -2,6 +2,8 @@ class TestUnits: - @pytest.mark.complete("units --", xfail="! units --help &>/dev/null") + @pytest.mark.complete( + "units --", require_cmd=True, xfail="! units --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_unshunt.py b/test/t/test_unshunt.py index 966312edaa3..a354239ebd0 100644 --- a/test/t/test_unshunt.py +++ b/test/t/test_unshunt.py @@ -2,6 +2,6 @@ class TestUnshunt: - @pytest.mark.complete("unshunt --") + @pytest.mark.complete("unshunt --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_urlsnarf.py b/test/t/test_urlsnarf.py index a9482113639..8551c60c8b1 100644 --- a/test/t/test_urlsnarf.py +++ b/test/t/test_urlsnarf.py @@ -2,6 +2,6 @@ class TestUrlsnarf: - @pytest.mark.complete("urlsnarf -") + @pytest.mark.complete("urlsnarf -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_uscan.py b/test/t/test_uscan.py index 5f4c684a05a..142c3250ca9 100644 --- a/test/t/test_uscan.py +++ b/test/t/test_uscan.py @@ -2,6 +2,6 @@ class TestUscan: - @pytest.mark.complete("uscan -") + @pytest.mark.complete("uscan -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_useradd.py b/test/t/test_useradd.py index 557d4a916b4..5cbf6ce456e 100644 --- a/test/t/test_useradd.py +++ b/test/t/test_useradd.py @@ -6,6 +6,6 @@ class TestUseradd: def test_1(self, completion): assert not completion - @pytest.mark.complete("useradd -") + @pytest.mark.complete("useradd -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_userdel.py b/test/t/test_userdel.py index 74003eb18e0..718c66298ed 100644 --- a/test/t/test_userdel.py +++ b/test/t/test_userdel.py @@ -2,7 +2,7 @@ class TestUserdel: - @pytest.mark.complete("userdel -") + @pytest.mark.complete("userdel -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_usermod.py b/test/t/test_usermod.py index 1eb169c7534..ef3dd5aa818 100644 --- a/test/t/test_usermod.py +++ b/test/t/test_usermod.py @@ -6,6 +6,6 @@ class TestUsermod: def test_1(self, completion): assert completion - @pytest.mark.complete("usermod -") + @pytest.mark.complete("usermod -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_valgrind.py b/test/t/test_valgrind.py index 2b03d6f9b99..c7c979ddf51 100644 --- a/test/t/test_valgrind.py +++ b/test/t/test_valgrind.py @@ -10,15 +10,17 @@ class TestValgrind: def test_1(self, completion): assert completion - @pytest.mark.complete("valgrind -") + @pytest.mark.complete("valgrind -", require_cmd=True) def test_2(self, completion): assert completion - @pytest.mark.complete("valgrind --tool=memche") + @pytest.mark.complete("valgrind --tool=memche", require_cmd=True) def test_3(self, completion): assert "--tool=memcheck" in completion - @pytest.mark.complete("valgrind --tool=helgrind --history-l") + @pytest.mark.complete( + "valgrind --tool=helgrind --history-l", require_cmd=True + ) def test_4(self, completion): assert "--history-level=" in completion assert not completion.endswith(" ") diff --git a/test/t/test_vgcfgbackup.py b/test/t/test_vgcfgbackup.py index 7d6705a3a5f..2e6c6f1d23e 100644 --- a/test/t/test_vgcfgbackup.py +++ b/test/t/test_vgcfgbackup.py @@ -3,7 +3,9 @@ class TestVgcfgbackup: @pytest.mark.complete( - "vgcfgbackup -", xfail="! vgcfgbackup --help &>/dev/null" + "vgcfgbackup -", + require_cmd=True, + xfail="! vgcfgbackup --help &>/dev/null", ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgcfgrestore.py b/test/t/test_vgcfgrestore.py index c7686ecfa55..acb1a38fd8b 100644 --- a/test/t/test_vgcfgrestore.py +++ b/test/t/test_vgcfgrestore.py @@ -3,7 +3,9 @@ class TestVgcfgrestore: @pytest.mark.complete( - "vgcfgrestore -", xfail="! vgcfgrestore --help &>/dev/null" + "vgcfgrestore -", + require_cmd=True, + xfail="! vgcfgrestore --help &>/dev/null", ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgchange.py b/test/t/test_vgchange.py index ac2cb49027f..ed14f2a7e6f 100644 --- a/test/t/test_vgchange.py +++ b/test/t/test_vgchange.py @@ -2,6 +2,8 @@ class TestVgchange: - @pytest.mark.complete("vgchange -", xfail="! vgchange --help &>/dev/null") + @pytest.mark.complete( + "vgchange -", require_cmd=True, xfail="! vgchange --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgck.py b/test/t/test_vgck.py index f231673569f..52ddf8868f2 100644 --- a/test/t/test_vgck.py +++ b/test/t/test_vgck.py @@ -2,6 +2,8 @@ class TestVgck: - @pytest.mark.complete("vgck -", xfail="! vgck --help &>/dev/null") + @pytest.mark.complete( + "vgck -", require_cmd=True, xfail="! vgck --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgconvert.py b/test/t/test_vgconvert.py index 7a39d70bae3..029fe486fd2 100644 --- a/test/t/test_vgconvert.py +++ b/test/t/test_vgconvert.py @@ -3,7 +3,7 @@ class TestVgconvert: @pytest.mark.complete( - "vgconvert -", xfail="! vgconvert --help &>/dev/null" + "vgconvert -", require_cmd=True, xfail="! vgconvert --help &>/dev/null" ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgcreate.py b/test/t/test_vgcreate.py index 0042e6ef990..40c1773413a 100644 --- a/test/t/test_vgcreate.py +++ b/test/t/test_vgcreate.py @@ -2,10 +2,12 @@ class TestVgcreate: - @pytest.mark.complete("vgcreate -", xfail="! vgcreate --help &>/dev/null") + @pytest.mark.complete( + "vgcreate -", require_cmd=True, xfail="! vgcreate --help &>/dev/null" + ) def test_1(self, completion): assert completion - @pytest.mark.complete("vgcreate __does_not_exist__") + @pytest.mark.complete("vgcreate __does_not_exist__", require_cmd=True) def test_2(self, completion): assert not completion diff --git a/test/t/test_vgdisplay.py b/test/t/test_vgdisplay.py index f1b01fec110..60667292fe3 100644 --- a/test/t/test_vgdisplay.py +++ b/test/t/test_vgdisplay.py @@ -3,7 +3,7 @@ class TestVgdisplay: @pytest.mark.complete( - "vgdisplay -", xfail="! vgdisplay --help &>/dev/null" + "vgdisplay -", require_cmd=True, xfail="! vgdisplay --help &>/dev/null" ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgexport.py b/test/t/test_vgexport.py index 97d4ee4a175..96ecc3cdc3f 100644 --- a/test/t/test_vgexport.py +++ b/test/t/test_vgexport.py @@ -2,6 +2,8 @@ class TestVgexport: - @pytest.mark.complete("vgexport -", xfail="! vgexport --help &>/dev/null") + @pytest.mark.complete( + "vgexport -", require_cmd=True, xfail="! vgexport --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgextend.py b/test/t/test_vgextend.py index b0cde6f1703..8c41ab606da 100644 --- a/test/t/test_vgextend.py +++ b/test/t/test_vgextend.py @@ -2,6 +2,8 @@ class TestVgextend: - @pytest.mark.complete("vgextend -", xfail="! vgextend --help &>/dev/null") + @pytest.mark.complete( + "vgextend -", require_cmd=True, xfail="! vgextend --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgimport.py b/test/t/test_vgimport.py index 151684f5f15..24017d2b79f 100644 --- a/test/t/test_vgimport.py +++ b/test/t/test_vgimport.py @@ -2,6 +2,8 @@ class TestVgimport: - @pytest.mark.complete("vgimport -", xfail="! vgimport --help &>/dev/null") + @pytest.mark.complete( + "vgimport -", require_cmd=True, xfail="! vgimport --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgmerge.py b/test/t/test_vgmerge.py index 94fa69cde35..7d8893212f8 100644 --- a/test/t/test_vgmerge.py +++ b/test/t/test_vgmerge.py @@ -2,6 +2,8 @@ class TestVgmerge: - @pytest.mark.complete("vgmerge -", xfail="! vgmerge --help &>/dev/null") + @pytest.mark.complete( + "vgmerge -", require_cmd=True, xfail="! vgmerge --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgmknodes.py b/test/t/test_vgmknodes.py index ae308894f19..7e046f052a4 100644 --- a/test/t/test_vgmknodes.py +++ b/test/t/test_vgmknodes.py @@ -3,7 +3,7 @@ class TestVgmknodes: @pytest.mark.complete( - "vgmknodes -", xfail="! vgmknodes --help &>/dev/null" + "vgmknodes -", require_cmd=True, xfail="! vgmknodes --help &>/dev/null" ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgreduce.py b/test/t/test_vgreduce.py index 4aab62c3964..26174b95b60 100644 --- a/test/t/test_vgreduce.py +++ b/test/t/test_vgreduce.py @@ -2,6 +2,8 @@ class TestVgreduce: - @pytest.mark.complete("vgreduce -", xfail="! vgreduce --help &>/dev/null") + @pytest.mark.complete( + "vgreduce -", require_cmd=True, xfail="! vgreduce --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgremove.py b/test/t/test_vgremove.py index 2801ef6a9db..637d5c3f96a 100644 --- a/test/t/test_vgremove.py +++ b/test/t/test_vgremove.py @@ -2,6 +2,8 @@ class TestVgremove: - @pytest.mark.complete("vgremove -", xfail="! vgremove --help &>/dev/null") + @pytest.mark.complete( + "vgremove -", require_cmd=True, xfail="! vgremove --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgrename.py b/test/t/test_vgrename.py index 9010c49fc72..87a6a7272a0 100644 --- a/test/t/test_vgrename.py +++ b/test/t/test_vgrename.py @@ -2,6 +2,8 @@ class TestVgrename: - @pytest.mark.complete("vgrename -", xfail="! vgrename --help &>/dev/null") + @pytest.mark.complete( + "vgrename -", require_cmd=True, xfail="! vgrename --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgs.py b/test/t/test_vgs.py index 8c470d331d6..e0d8a0338f1 100644 --- a/test/t/test_vgs.py +++ b/test/t/test_vgs.py @@ -2,6 +2,8 @@ class TestVgs: - @pytest.mark.complete("vgs -", xfail="! vgs --help &>/dev/null") + @pytest.mark.complete( + "vgs -", require_cmd=True, xfail="! vgs --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgscan.py b/test/t/test_vgscan.py index f4060e9a763..95a4026ca84 100644 --- a/test/t/test_vgscan.py +++ b/test/t/test_vgscan.py @@ -2,6 +2,8 @@ class TestVgscan: - @pytest.mark.complete("vgscan -", xfail="! vgscan --help &>/dev/null") + @pytest.mark.complete( + "vgscan -", require_cmd=True, xfail="! vgscan --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_vgsplit.py b/test/t/test_vgsplit.py index ddf2ff71e07..1c3dfa8598e 100644 --- a/test/t/test_vgsplit.py +++ b/test/t/test_vgsplit.py @@ -2,6 +2,8 @@ class TestVgsplit: - @pytest.mark.complete("vgsplit -", xfail="! vgsplit --help &>/dev/null") + @pytest.mark.complete( + "vgsplit -", require_cmd=True, xfail="! vgsplit --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_vipw.py b/test/t/test_vipw.py index 160cb11ba22..07b454bff4f 100644 --- a/test/t/test_vipw.py +++ b/test/t/test_vipw.py @@ -2,6 +2,6 @@ class TestVipw: - @pytest.mark.complete("vipw -") + @pytest.mark.complete("vipw -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_vmstat.py b/test/t/test_vmstat.py index 47b55f6f5bb..b7145ff3d88 100644 --- a/test/t/test_vmstat.py +++ b/test/t/test_vmstat.py @@ -2,6 +2,6 @@ class TestVmstat: - @pytest.mark.complete("vmstat -") + @pytest.mark.complete("vmstat -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_vpnc.py b/test/t/test_vpnc.py index 29a120a4d0f..dac5b15bc90 100644 --- a/test/t/test_vpnc.py +++ b/test/t/test_vpnc.py @@ -8,6 +8,6 @@ pre_cmds=("PATH=/usr/sbin:$PATH",) ) class TestVpnc: - @pytest.mark.complete("vpnc -") + @pytest.mark.complete("vpnc -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_wc.py b/test/t/test_wc.py index 904c2494c8c..b87bcb22555 100644 --- a/test/t/test_wc.py +++ b/test/t/test_wc.py @@ -4,6 +4,7 @@ class TestWc: @pytest.mark.complete( "wc --", + require_cmd=True, xfail=( "! wc --help &>/dev/null || " "! wc --help 2>&1 | command grep -qF -- --help" diff --git a/test/t/test_webmitm.py b/test/t/test_webmitm.py index e9f85940cca..d631dcf0214 100644 --- a/test/t/test_webmitm.py +++ b/test/t/test_webmitm.py @@ -2,6 +2,6 @@ class TestWebmitm: - @pytest.mark.complete("webmitm -") + @pytest.mark.complete("webmitm -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_who.py b/test/t/test_who.py index 1a2ad69334b..9131ac765f2 100644 --- a/test/t/test_who.py +++ b/test/t/test_who.py @@ -2,6 +2,8 @@ class TestWho: - @pytest.mark.complete("who --", xfail="! who --help &>/dev/null") + @pytest.mark.complete( + "who --", require_cmd=True, xfail="! who --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_wol.py b/test/t/test_wol.py index af966075a6d..b7a622ee877 100644 --- a/test/t/test_wol.py +++ b/test/t/test_wol.py @@ -14,6 +14,6 @@ def test_1(self, completion): def test_2(self, completion): assert completion == "00:00:00:00:00:00" - @pytest.mark.complete("wol -") + @pytest.mark.complete("wol -", require_cmd=True) def test_3(self, completion): assert completion diff --git a/test/t/test_wsimport.py b/test/t/test_wsimport.py index 7dbfd13b1e8..8c27f4bd71d 100644 --- a/test/t/test_wsimport.py +++ b/test/t/test_wsimport.py @@ -8,6 +8,7 @@ def test_1(self, completion): @pytest.mark.complete( "wsimport -", + require_cmd=True, xfail=( "! (wsimport -help 2>&1 || :) | " "command grep -q -- '[[:space:]]-'" diff --git a/test/t/test_wtf.py b/test/t/test_wtf.py index 6b2c9745ab2..45dfcfd2a4c 100644 --- a/test/t/test_wtf.py +++ b/test/t/test_wtf.py @@ -2,6 +2,7 @@ class TestWtf: - @pytest.mark.complete("wtf A") + # TODO: actually requires an acronym db, not the cmd + @pytest.mark.complete("wtf A", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_wvdial.py b/test/t/test_wvdial.py index 19043f6162e..bbc520deb7b 100644 --- a/test/t/test_wvdial.py +++ b/test/t/test_wvdial.py @@ -2,6 +2,6 @@ class TestWvdial: - @pytest.mark.complete("wvdial -") + @pytest.mark.complete("wvdial -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_xdg_settings.py b/test/t/test_xdg_settings.py index a50df5794ac..1a194592154 100644 --- a/test/t/test_xdg_settings.py +++ b/test/t/test_xdg_settings.py @@ -7,10 +7,10 @@ class TestXdgSettings: def test_1(self, completion): assert completion - @pytest.mark.complete("xdg-settings --") + @pytest.mark.complete("xdg-settings --", require_cmd=True) def test_2(self, completion): assert completion - @pytest.mark.complete("xdg-settings get ") + @pytest.mark.complete("xdg-settings get ", require_cmd=True) def test_3(self, completion): assert completion diff --git a/test/t/test_xfreerdp.py b/test/t/test_xfreerdp.py index fdad1926e1e..a8435d6cc4e 100644 --- a/test/t/test_xfreerdp.py +++ b/test/t/test_xfreerdp.py @@ -17,30 +17,30 @@ def dash_syntax(self, bash): if "/help" in self._help(bash): pytest.skip("Not dash syntax") - @pytest.mark.complete("xfreerdp /") + @pytest.mark.complete("xfreerdp /", require_cmd=True) def test_1(self, bash, completion, slash_syntax): assert completion - @pytest.mark.complete("xfreerdp -") + @pytest.mark.complete("xfreerdp -", require_cmd=True) def test_2(self, completion): assert completion - @pytest.mark.complete("xfreerdp +") + @pytest.mark.complete("xfreerdp +", require_cmd=True) def test_3(self, bash, completion, slash_syntax): assert completion - @pytest.mark.complete("xfreerdp /kbd:") + @pytest.mark.complete("xfreerdp /kbd:", require_cmd=True) def test_4(self, bash, completion, slash_syntax): assert completion - @pytest.mark.complete("xfreerdp /help ") + @pytest.mark.complete("xfreerdp /help ", require_cmd=True) def test_5(self, completion): assert not completion - @pytest.mark.complete("xfreerdp -k ") + @pytest.mark.complete("xfreerdp -k ", require_cmd=True) def test_6(self, bash, completion, dash_syntax): assert completion - @pytest.mark.complete("xfreerdp --help ") + @pytest.mark.complete("xfreerdp --help ", require_cmd=True) def test_7(self, completion): assert not completion diff --git a/test/t/test_xgamma.py b/test/t/test_xgamma.py index 56c9440d655..beb684f82b0 100644 --- a/test/t/test_xgamma.py +++ b/test/t/test_xgamma.py @@ -2,11 +2,11 @@ class TestXgamma: - @pytest.mark.complete("xgamma -") + @pytest.mark.complete("xgamma -", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("xgamma -gam") + @pytest.mark.complete("xgamma -gam", require_cmd=True) def test_2(self, completion): assert completion == "-gamma" assert completion.endswith(" ") diff --git a/test/t/test_xmllint.py b/test/t/test_xmllint.py index 0c0ebbcde27..21c52c7c7e3 100644 --- a/test/t/test_xmllint.py +++ b/test/t/test_xmllint.py @@ -6,6 +6,6 @@ class TestXmllint: def test_1(self, completion): assert completion - @pytest.mark.complete("xmllint -") + @pytest.mark.complete("xmllint -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_xmlwf.py b/test/t/test_xmlwf.py index 9a98d41e15a..901f78af957 100644 --- a/test/t/test_xmlwf.py +++ b/test/t/test_xmlwf.py @@ -6,6 +6,6 @@ class TestXmlwf: def test_1(self, completion): assert completion - @pytest.mark.complete("xmlwf -") + @pytest.mark.complete("xmlwf -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_xmms.py b/test/t/test_xmms.py index 1c96e2b5ed9..a880b166edb 100644 --- a/test/t/test_xmms.py +++ b/test/t/test_xmms.py @@ -2,7 +2,7 @@ class TestXmms: - @pytest.mark.complete("xmms --") + @pytest.mark.complete("xmms --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_xrandr.py b/test/t/test_xrandr.py index 6bde5a0aab5..e76692240a0 100644 --- a/test/t/test_xrandr.py +++ b/test/t/test_xrandr.py @@ -2,7 +2,7 @@ class TestXrandr: - @pytest.mark.complete("xrandr ") + @pytest.mark.complete("xrandr ", require_cmd=True) def test_1(self, completion): assert completion @@ -10,6 +10,6 @@ def test_1(self, completion): def test_2(self, completion): assert not completion - @pytest.mark.complete("xrandr -") + @pytest.mark.complete("xrandr -", require_cmd=True) def test_3(self, completion): assert completion diff --git a/test/t/test_xrdb.py b/test/t/test_xrdb.py index 8ecb1f9a008..3ffce2c55b6 100644 --- a/test/t/test_xrdb.py +++ b/test/t/test_xrdb.py @@ -6,6 +6,6 @@ class TestXrdb: def test_1(self, completion): assert completion - @pytest.mark.complete("xrdb -") + @pytest.mark.complete("xrdb -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_xsltproc.py b/test/t/test_xsltproc.py index 268987770f4..259f9eb9c34 100644 --- a/test/t/test_xsltproc.py +++ b/test/t/test_xsltproc.py @@ -6,6 +6,6 @@ class TestXsltproc: def test_1(self, completion): assert completion - @pytest.mark.complete("xsltproc -") + @pytest.mark.complete("xsltproc -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_xz.py b/test/t/test_xz.py index dee8ca95545..f226d02b58e 100644 --- a/test/t/test_xz.py +++ b/test/t/test_xz.py @@ -21,6 +21,6 @@ def test_3(self, completion): def test_4(self, completion): assert completion - @pytest.mark.complete("xz -") + @pytest.mark.complete("xz -", require_cmd=True) def test_5(self, completion): assert completion diff --git a/test/t/test_xzdec.py b/test/t/test_xzdec.py index 131481dd1f2..a1e9a3ba6e3 100644 --- a/test/t/test_xzdec.py +++ b/test/t/test_xzdec.py @@ -6,6 +6,6 @@ class TestXzdec: def test_1(self, completion): assert completion - @pytest.mark.complete("xzdec -") + @pytest.mark.complete("xzdec -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_ypcat.py b/test/t/test_ypcat.py index f743c5ad0ad..0fc4b458b7d 100644 --- a/test/t/test_ypcat.py +++ b/test/t/test_ypcat.py @@ -2,6 +2,6 @@ class TestYpcat: - @pytest.mark.complete("ypcat ") + @pytest.mark.complete("ypcat ", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_ypmatch.py b/test/t/test_ypmatch.py index db56320abcb..18331aa7ec5 100644 --- a/test/t/test_ypmatch.py +++ b/test/t/test_ypmatch.py @@ -2,6 +2,7 @@ class TestYpmatch: - @pytest.mark.complete("ypmatch foo ") + # Actually requires ypcat + @pytest.mark.complete("ypmatch foo ", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_yum.py b/test/t/test_yum.py index 5d4a052b4d9..5dd1ebacf31 100644 --- a/test/t/test_yum.py +++ b/test/t/test_yum.py @@ -2,6 +2,6 @@ class TestYum: - @pytest.mark.complete("yum -") + @pytest.mark.complete("yum -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_zopfli.py b/test/t/test_zopfli.py index 3e856c7b308..e5a71b3c972 100644 --- a/test/t/test_zopfli.py +++ b/test/t/test_zopfli.py @@ -10,6 +10,6 @@ def test_1(self, completion): def test_2(self, completion): assert completion - @pytest.mark.complete("zopfli -") + @pytest.mark.complete("zopfli -", require_cmd=True) def test_3(self, completion): assert completion diff --git a/test/t/test_zopflipng.py b/test/t/test_zopflipng.py index 7d89ea2d752..3ff120ffdd2 100644 --- a/test/t/test_zopflipng.py +++ b/test/t/test_zopflipng.py @@ -6,6 +6,6 @@ class TestZopflipng: def test_1(self, completion): assert completion - @pytest.mark.complete("zopflipng -") + @pytest.mark.complete("zopflipng -", require_cmd=True) def test_2(self, completion): assert completion From faacf36e3432fd740293788910ee6304e0b5a031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 4 Jul 2019 12:37:43 +0300 Subject: [PATCH 0249/1094] test: add bunch of basic option parsing test cases --- test/t/Makefile.am | 2 ++ test/t/test_a2ps.py | 4 ++++ test/t/test_awk.py | 4 ++++ test/t/test_base64.py | 4 ++++ test/t/test_cat.py | 4 ++++ test/t/test_chroot.py | 4 ++++ test/t/test_colordiff.py | 11 +++++++++++ test/t/test_cp.py | 4 ++++ test/t/test_csplit.py | 4 ++++ test/t/test_cut.py | 4 ++++ test/t/test_date.py | 4 ++++ test/t/test_df.py | 4 ++++ test/t/test_dir.py | 4 ++++ test/t/test_du.py | 4 ++++ test/t/test_irb.py | 4 ++++ test/t/test_ld.py | 4 ++++ test/t/test_ldd.py | 4 ++++ test/t/test_ln.py | 4 ++++ test/t/test_md5sum.py | 4 ++++ test/t/test_mkdir.py | 4 ++++ test/t/test_mkfifo.py | 4 ++++ test/t/test_mknod.py | 4 ++++ test/t/test_mv.py | 4 ++++ test/t/test_netstat.py | 4 ++++ test/t/test_nl.py | 4 ++++ test/t/test_nm.py | 4 ++++ test/t/test_objcopy.py | 4 ++++ test/t/test_od.py | 4 ++++ test/t/test_paste.py | 4 ++++ test/t/test_pr.py | 4 ++++ test/t/test_ptx.py | 4 ++++ test/t/test_rm.py | 4 ++++ test/t/test_rmdir.py | 4 ++++ test/t/test_sum.py | 11 +++++++++++ test/t/test_tee.py | 4 ++++ test/t/test_vdir.py | 4 ++++ 36 files changed, 156 insertions(+) create mode 100644 test/t/test_colordiff.py create mode 100644 test/t/test_sum.py diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 0a2e74a35ea..2b345f468b7 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -87,6 +87,7 @@ EXTRA_DIST = \ test_clisp.py \ test_clone_member.py \ test_co.py \ + test_colordiff.py \ test_compare.py \ test_compgen.py \ test_complete.py \ @@ -564,6 +565,7 @@ EXTRA_DIST = \ test_strip.py \ test_su.py \ test_sudo.py \ + test_sum.py \ test_svcadm.py \ test_svk.py \ test_svn.py \ diff --git a/test/t/test_a2ps.py b/test/t/test_a2ps.py index 9d885461e7b..38365f03205 100644 --- a/test/t/test_a2ps.py +++ b/test/t/test_a2ps.py @@ -5,3 +5,7 @@ class TestA2ps: @pytest.mark.complete("a2ps ") def test_1(self, completion): assert completion + + @pytest.mark.complete("a2ps -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_awk.py b/test/t/test_awk.py index ad2034d1f37..f2f6daca193 100644 --- a/test/t/test_awk.py +++ b/test/t/test_awk.py @@ -5,3 +5,7 @@ class TestAwk: @pytest.mark.complete("awk ") def test_1(self, completion): assert completion + + @pytest.mark.complete("awk -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_base64.py b/test/t/test_base64.py index efc35ebbfb0..ffb9a788f1d 100644 --- a/test/t/test_base64.py +++ b/test/t/test_base64.py @@ -5,3 +5,7 @@ class TestBase64: @pytest.mark.complete("base64 ") def test_1(self, completion): assert completion + + @pytest.mark.complete("base64 -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_cat.py b/test/t/test_cat.py index 94245e8fcd5..3ed2f442358 100644 --- a/test/t/test_cat.py +++ b/test/t/test_cat.py @@ -5,3 +5,7 @@ class TestCat: @pytest.mark.complete("cat ") def test_1(self, completion): assert completion + + @pytest.mark.complete("cat -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_chroot.py b/test/t/test_chroot.py index 99ca56b0f82..77384006a08 100644 --- a/test/t/test_chroot.py +++ b/test/t/test_chroot.py @@ -10,3 +10,7 @@ def test_1(self, completion): def test_2(self, completion): """Should complete dirs only, also when invoked using full path.""" assert completion == ["bar bar.d/", "foo.d/"] + + @pytest.mark.complete("chroot -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_colordiff.py b/test/t/test_colordiff.py new file mode 100644 index 00000000000..f0e0a291d7d --- /dev/null +++ b/test/t/test_colordiff.py @@ -0,0 +1,11 @@ +import pytest + + +class TestColordiff: + @pytest.mark.complete("colordiff ") + def test_basic(self, completion): + assert completion + + @pytest.mark.complete("colordiff -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_cp.py b/test/t/test_cp.py index a25998fcee0..dd315225764 100644 --- a/test/t/test_cp.py +++ b/test/t/test_cp.py @@ -5,3 +5,7 @@ class TestCp: @pytest.mark.complete("cp ") def test_1(self, completion): assert completion + + @pytest.mark.complete("cp -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_csplit.py b/test/t/test_csplit.py index 54eab34c291..609c7e55cd6 100644 --- a/test/t/test_csplit.py +++ b/test/t/test_csplit.py @@ -5,3 +5,7 @@ class TestCsplit: @pytest.mark.complete("csplit ") def test_1(self, completion): assert completion + + @pytest.mark.complete("csplit -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_cut.py b/test/t/test_cut.py index 31fa636a04a..7f74aa651b2 100644 --- a/test/t/test_cut.py +++ b/test/t/test_cut.py @@ -5,3 +5,7 @@ class TestCut: @pytest.mark.complete("cut ") def test_1(self, completion): assert completion + + @pytest.mark.complete("cut -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_date.py b/test/t/test_date.py index 8df574e987c..57d61b816c8 100644 --- a/test/t/test_date.py +++ b/test/t/test_date.py @@ -5,3 +5,7 @@ class TestDate: @pytest.mark.complete("date ") def test_1(self, completion): assert completion + + @pytest.mark.complete("date -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_df.py b/test/t/test_df.py index 247311cc46f..d54c131d0b0 100644 --- a/test/t/test_df.py +++ b/test/t/test_df.py @@ -5,3 +5,7 @@ class TestDf: @pytest.mark.complete("df ") def test_1(self, completion): assert completion + + @pytest.mark.complete("df -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_dir.py b/test/t/test_dir.py index 3026d502734..f8568fb5c3c 100644 --- a/test/t/test_dir.py +++ b/test/t/test_dir.py @@ -5,3 +5,7 @@ class TestDir: @pytest.mark.complete("dir ") def test_1(self, completion): assert completion + + @pytest.mark.complete("dir -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_du.py b/test/t/test_du.py index c014b069694..29dfbf81834 100644 --- a/test/t/test_du.py +++ b/test/t/test_du.py @@ -5,3 +5,7 @@ class TestDu: @pytest.mark.complete("du ") def test_1(self, completion): assert completion + + @pytest.mark.complete("du -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_irb.py b/test/t/test_irb.py index 31c46e20282..03a83c664bc 100644 --- a/test/t/test_irb.py +++ b/test/t/test_irb.py @@ -5,3 +5,7 @@ class TestIrb: @pytest.mark.complete("irb ") def test_1(self, completion): assert completion + + @pytest.mark.complete("irb -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_ld.py b/test/t/test_ld.py index a82f091b306..f6a16bb2a14 100644 --- a/test/t/test_ld.py +++ b/test/t/test_ld.py @@ -5,3 +5,7 @@ class TestLd: @pytest.mark.complete("ld ") def test_1(self, completion): assert completion + + @pytest.mark.complete("ld -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_ldd.py b/test/t/test_ldd.py index 8c463b60e62..70e295a550f 100644 --- a/test/t/test_ldd.py +++ b/test/t/test_ldd.py @@ -5,3 +5,7 @@ class TestLdd: @pytest.mark.complete("ldd ") def test_1(self, completion): assert completion + + @pytest.mark.complete("ldd -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_ln.py b/test/t/test_ln.py index de053345d9d..2df5706f4f9 100644 --- a/test/t/test_ln.py +++ b/test/t/test_ln.py @@ -5,3 +5,7 @@ class TestLn: @pytest.mark.complete("ln ") def test_1(self, completion): assert completion + + @pytest.mark.complete("ln -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_md5sum.py b/test/t/test_md5sum.py index fa364ea140e..4009f58e35c 100644 --- a/test/t/test_md5sum.py +++ b/test/t/test_md5sum.py @@ -5,3 +5,7 @@ class TestMd5sum: @pytest.mark.complete("md5sum ") def test_1(self, completion): assert completion + + @pytest.mark.complete("md5sum -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_mkdir.py b/test/t/test_mkdir.py index a5eb1a549ff..397e4970b07 100644 --- a/test/t/test_mkdir.py +++ b/test/t/test_mkdir.py @@ -16,3 +16,7 @@ def test_2(self, completion): def test_3(self, completion): assert completion.output == "foo" assert completion == [completion.output] + + @pytest.mark.complete("mkdir -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_mkfifo.py b/test/t/test_mkfifo.py index b9e0013c3cf..718e0bb668a 100644 --- a/test/t/test_mkfifo.py +++ b/test/t/test_mkfifo.py @@ -5,3 +5,7 @@ class TestMkfifo: @pytest.mark.complete("mkfifo ") def test_1(self, completion): assert completion + + @pytest.mark.complete("mkfifo -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_mknod.py b/test/t/test_mknod.py index 46cb2284d41..f0b516cd2bf 100644 --- a/test/t/test_mknod.py +++ b/test/t/test_mknod.py @@ -5,3 +5,7 @@ class TestMknod: @pytest.mark.complete("mknod ") def test_1(self, completion): assert completion + + @pytest.mark.complete("mknod -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_mv.py b/test/t/test_mv.py index a9fc969daa8..ce00add7111 100644 --- a/test/t/test_mv.py +++ b/test/t/test_mv.py @@ -5,3 +5,7 @@ class TestMv: @pytest.mark.complete("mv ") def test_1(self, completion): assert completion + + @pytest.mark.complete("mv -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_netstat.py b/test/t/test_netstat.py index 6bcbd4d2ac4..58db5760403 100644 --- a/test/t/test_netstat.py +++ b/test/t/test_netstat.py @@ -5,3 +5,7 @@ class TestNetstat: @pytest.mark.complete("netstat ") def test_1(self, completion): assert completion + + @pytest.mark.complete("netstat -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_nl.py b/test/t/test_nl.py index c3e35b42017..50ff24596f8 100644 --- a/test/t/test_nl.py +++ b/test/t/test_nl.py @@ -5,3 +5,7 @@ class TestNl: @pytest.mark.complete("nl ") def test_1(self, completion): assert completion + + @pytest.mark.complete("nl -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_nm.py b/test/t/test_nm.py index 49ff167ef46..328fa5078ce 100644 --- a/test/t/test_nm.py +++ b/test/t/test_nm.py @@ -5,3 +5,7 @@ class TestNm: @pytest.mark.complete("nm ") def test_1(self, completion): assert completion + + @pytest.mark.complete("nm -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_objcopy.py b/test/t/test_objcopy.py index 13a93df587f..e3130fabcf7 100644 --- a/test/t/test_objcopy.py +++ b/test/t/test_objcopy.py @@ -5,3 +5,7 @@ class TestObjcopy: @pytest.mark.complete("objcopy ") def test_1(self, completion): assert completion + + @pytest.mark.complete("objcopy -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_od.py b/test/t/test_od.py index a1e648a864b..9eabc76bebc 100644 --- a/test/t/test_od.py +++ b/test/t/test_od.py @@ -5,3 +5,7 @@ class TestOd: @pytest.mark.complete("od ") def test_1(self, completion): assert completion + + @pytest.mark.complete("od -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_paste.py b/test/t/test_paste.py index 2d551322973..be2d1e977a4 100644 --- a/test/t/test_paste.py +++ b/test/t/test_paste.py @@ -5,3 +5,7 @@ class TestPaste: @pytest.mark.complete("paste ") def test_1(self, completion): assert completion + + @pytest.mark.complete("paste -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_pr.py b/test/t/test_pr.py index cb023ea089b..c790a866898 100644 --- a/test/t/test_pr.py +++ b/test/t/test_pr.py @@ -5,3 +5,7 @@ class TestPr: @pytest.mark.complete("pr ") def test_1(self, completion): assert completion + + @pytest.mark.complete("pr -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_ptx.py b/test/t/test_ptx.py index 2eea63bca1a..9ddc91c9a9a 100644 --- a/test/t/test_ptx.py +++ b/test/t/test_ptx.py @@ -5,3 +5,7 @@ class TestPtx: @pytest.mark.complete("ptx ") def test_1(self, completion): assert completion + + @pytest.mark.complete("ptx -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_rm.py b/test/t/test_rm.py index 622ef13c94a..4cbfd84dfc6 100644 --- a/test/t/test_rm.py +++ b/test/t/test_rm.py @@ -5,3 +5,7 @@ class TestRm: @pytest.mark.complete("rm ") def test_1(self, completion): assert completion + + @pytest.mark.complete("rm -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_rmdir.py b/test/t/test_rmdir.py index d416819aac3..b9816772c35 100644 --- a/test/t/test_rmdir.py +++ b/test/t/test_rmdir.py @@ -10,3 +10,7 @@ def test_1(self, completion): def test_2(self, completion): """Should complete dirs only, also when invoked using full path.""" assert completion == ["bar bar.d/", "foo.d/"] + + @pytest.mark.complete("rmdir -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_sum.py b/test/t/test_sum.py new file mode 100644 index 00000000000..fd3230e1a84 --- /dev/null +++ b/test/t/test_sum.py @@ -0,0 +1,11 @@ +import pytest + + +class TestSum: + @pytest.mark.complete("sum ") + def test_1(self, completion): + assert completion + + @pytest.mark.complete("sum -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_tee.py b/test/t/test_tee.py index b0914624bfd..423d1b07917 100644 --- a/test/t/test_tee.py +++ b/test/t/test_tee.py @@ -5,3 +5,7 @@ class TestTee: @pytest.mark.complete("tee ") def test_1(self, completion): assert completion + + @pytest.mark.complete("tee -", require_cmd=True) + def test_options(self, completion): + assert completion diff --git a/test/t/test_vdir.py b/test/t/test_vdir.py index 2f6a744ee65..e18698969b0 100644 --- a/test/t/test_vdir.py +++ b/test/t/test_vdir.py @@ -5,3 +5,7 @@ class TestVdir: @pytest.mark.complete("vdir ") def test_1(self, completion): assert completion + + @pytest.mark.complete("vdir -", require_cmd=True) + def test_options(self, completion): + assert completion From 1e3d50429d45e44d4fe65b3c7b2f37eb6e8c7b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 6 Jul 2019 23:57:21 +0300 Subject: [PATCH 0250/1094] test: don't sort expected completion lists under the hood We need to match the order in which bash lists completions, which may not be a straightforward one. For example, it seems to add slashes after sorting dir completions without changing the sort order. For example "foo" sorts before "foo-bar", but "foo/" after "foo-bar/", but the order of completion output is "foo/" followed by "foo-bar/". Test cases should sort their lists explicitly where appropriate. --- test/t/conftest.py | 2 +- test/t/test_kdvi.py | 4 ++-- test/t/test_kpdf.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/t/conftest.py b/test/t/conftest.py index eb2d62bb1cd..485d007b1db 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -324,7 +324,7 @@ def __eq__(self, expected: Union[str, Iterable[str]]) -> bool: Defining __eq__ this way is quite ugly, but facilitates concise testing code. """ - expiter = [expected] if isinstance(expected, str) else sorted(expected) + expiter = [expected] if isinstance(expected, str) else expected if self._items is not None: return self._items == expiter return bool( diff --git a/test/t/test_kdvi.py b/test/t/test_kdvi.py index 7fb11cb0cd7..c2ab011ab9b 100644 --- a/test/t/test_kdvi.py +++ b/test/t/test_kdvi.py @@ -4,7 +4,7 @@ class TestKdvi: @pytest.mark.complete("kdvi ", cwd="kdvi") def test_1(self, completion): - assert ( - completion == "foo/ .dvi .DVI .dvi.bz2 .DVI.bz2 .dvi.gz " + assert completion == sorted( + "foo/ .dvi .DVI .dvi.bz2 .DVI.bz2 .dvi.gz " ".DVI.gz .dvi.Z .DVI.Z".split() ) diff --git a/test/t/test_kpdf.py b/test/t/test_kpdf.py index ceee34d3b63..68b36fe89d2 100644 --- a/test/t/test_kpdf.py +++ b/test/t/test_kpdf.py @@ -4,4 +4,4 @@ class TestKpdf: @pytest.mark.complete("kpdf ", cwd="kpdf") def test_1(self, completion): - assert completion == "foo/ .eps .ps .EPS .PS .pdf .PDF".split() + assert completion == sorted("foo/ .eps .ps .EPS .PS .pdf .PDF".split()) From b6d74cc99881e51e7bd9504ce55273a3f1b95def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 7 Jul 2019 11:13:46 +0300 Subject: [PATCH 0251/1094] test: hush flake8-bugbear B010 --- test/t/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/t/conftest.py b/test/t/conftest.py index 485d007b1db..5b0b54e9419 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -156,7 +156,7 @@ def bash(request) -> pexpect.spawn: if match: cmd = match.group(1) - setattr(request.cls, "cmd", cmd) + request.cls.cmd = cmd if (cmd_found and cmd is None) or is_testable(bash, cmd): before_env = get_env(bash) From b044a4f9d750410e4882e5badfa3b2f8a1145e28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 7 Jul 2019 11:14:18 +0300 Subject: [PATCH 0252/1094] test: ignore _makepkg_bootstrap in makepkg test env --- test/t/test_makepkg.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/t/test_makepkg.py b/test/t/test_makepkg.py index 6cfb943c09d..bb4344e8b83 100644 --- a/test/t/test_makepkg.py +++ b/test/t/test_makepkg.py @@ -2,7 +2,8 @@ @pytest.mark.bashcomp( - xfail="! makepkg --help 2>&1 | command grep -qiF slackware" + ignore_env=r"^-declare -f _makepkg_bootstrap$", + xfail="! makepkg --help 2>&1 | command grep -qiF slackware", ) class TestMakepkg: @pytest.mark.complete("makepkg ") From 36db77a14e516c4ab452ce57f83e4406852b83e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 7 Jul 2019 11:22:50 +0300 Subject: [PATCH 0253/1094] test: xfail MAC address completion without networking --- test/t/test_ether_wake.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/t/test_ether_wake.py b/test/t/test_ether_wake.py index d33f427fb20..7afe2862125 100644 --- a/test/t/test_ether_wake.py +++ b/test/t/test_ether_wake.py @@ -1,8 +1,14 @@ +import os + import pytest @pytest.mark.bashcomp(cmd="ether-wake") class TestEtherWake: + @pytest.mark.xfail( + os.environ.get("NETWORK") == "none", + reason="MAC addresses may be N/A with no networking configured", + ) @pytest.mark.complete("ether-wake ") def test_1(self, completion): assert completion From 0f8187ddc01dabc6129f7f1673e950d03d57cbfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 13 Jul 2019 09:46:23 +0300 Subject: [PATCH 0254/1094] travis: pass NETWORK as env var, so we can actually use it --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e7303c5ca83..790b2a756d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ before_install: script: - docker run --name bash-completion - -e CI=true -e DIST=$DIST -e BSD=$BSD + -e CI=true -e DIST=$DIST -e BSD=$BSD -e NETWORK=$NETWORK ${NETWORK:+--network $NETWORK} -t bash-completion:$DIST - if test $DIST = tools; then From 29ad38254fa52ea159d2bc1959c80599c6b52128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 13 Jul 2019 10:23:24 +0300 Subject: [PATCH 0255/1094] test: fix retrieving command to test from request --- test/t/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/t/conftest.py b/test/t/conftest.py index 5b0b54e9419..b5b2d2256ee 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -455,7 +455,7 @@ def completion(request, bash: pexpect.spawn) -> CompletionResult: for pre_cmd in marker.kwargs.get("pre_cmds", []): assert_bash_exec(bash, pre_cmd) if marker.kwargs.get("require_cmd") and not is_bash_type( - bash, getattr(request.module, "cmd", None) + bash, getattr(request.cls, "cmd", None) ): pytest.skip("Command not found") return assert_complete(bash, marker.args[0], **marker.kwargs) From bebe43d6e7881d39e9c03faadf2927fa08042241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 13 Jul 2019 11:00:28 +0300 Subject: [PATCH 0256/1094] gprof: _parse_usage, drop hardcoded option list --- completions/gprof | 10 +--------- test/t/test_gprof.py | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/completions/gprof b/completions/gprof index d1f4a4a3611..40a7482003a 100644 --- a/completions/gprof +++ b/completions/gprof @@ -44,15 +44,7 @@ _gprof() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W '--annotated-source --brief --exec-counts - --file-info --directory-path --no-annotated-source --print-path - --flat-profile --no-flat-profile --graph --no-graph --table-length= - --separate-files --no-exec-counts --function-ordering - --file-ordering --traditional --width= --all-lines --demangle - --no-demangle --no-static --static-call-graph - --ignore-non-functions -k --line --min-count= --time= --no-time= - --external-symbol-table= --display-unused-functions --debug --help - --file-format= --sum --version' -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/test/t/test_gprof.py b/test/t/test_gprof.py index d4e8d591ad7..a30cc1e78a6 100644 --- a/test/t/test_gprof.py +++ b/test/t/test_gprof.py @@ -2,6 +2,6 @@ class TestGprof: - @pytest.mark.complete("gprof --", xfail="! gprof --help &>/dev/null") + @pytest.mark.complete("gprof --", require_cmd=True) def test_1(self, completion): assert completion From 29157d07aafac3938fb26e93c542288d027eca9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 13 Jul 2019 11:11:33 +0300 Subject: [PATCH 0257/1094] lintian-info: _parse_help, add more option arg (non)completions --- completions/lintian | 11 +++++++++-- test/t/test_lintian_info.py | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/completions/lintian b/completions/lintian index fbf54f964b9..d62d8373428 100644 --- a/completions/lintian +++ b/completions/lintian @@ -149,15 +149,22 @@ _lintian_info() _init_completion || return case "$prev" in + --help|--profile) + return + ;; -t|--tags) _lintian_tags - return 0 + return + ;; + --include-dir) + _filedir -d + return ;; esac case "$cur" in --*) - COMPREPLY=($(compgen -W "--annotate --help --tags" -- "$cur")) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) ;; *) _filedir diff --git a/test/t/test_lintian_info.py b/test/t/test_lintian_info.py index 6bcc9e526b0..bf9afc527b4 100644 --- a/test/t/test_lintian_info.py +++ b/test/t/test_lintian_info.py @@ -7,6 +7,6 @@ class TestLintianInfo: def test_1(self, completion): assert completion - @pytest.mark.complete("lintian-info --") + @pytest.mark.complete("lintian-info --", require_cmd=True) def test_2(self, completion): assert completion From bf207da5b3879ca5c94fd382b609b5b41f6802b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 13 Jul 2019 11:30:36 +0300 Subject: [PATCH 0258/1094] screen, smartctl, update-alternatives: _parse_help, drop hardcoded option list --- completions/screen | 4 +--- completions/smartctl | 7 +------ completions/update-alternatives | 4 +--- test/t/test_screen.py | 2 +- test/t/test_smartctl.py | 2 +- test/t/test_update_alternatives.py | 2 +- 6 files changed, 6 insertions(+), 15 deletions(-) diff --git a/completions/screen b/completions/screen index 3b9fb27272a..7783f5b3ae4 100644 --- a/completions/screen +++ b/completions/screen @@ -84,9 +84,7 @@ _screen() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '-a -A -c -d -D -e -f -fn -fa -h -i -ln -list - -L -m -O -p -q -r -R -s -S -t -T -U -v -wipe -x -X --help - --version' -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) fi } && complete -F _screen screen diff --git a/completions/smartctl b/completions/smartctl index c34ca598618..ecef0b99bd3 100644 --- a/completions/smartctl +++ b/completions/smartctl @@ -151,12 +151,7 @@ _smartctl() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '--help --version --info --all --xall - --scan --scan-open --quietmode= --device= --tolerance= --badsum= - --report= --nocheck= --smart= --offlineauto= --saveauto= --health - --capabilities --attributes --log= --vendorattribute= - --firmwarebug= --presets= --drivedb= --test= --captive --abort' \ - -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else cur=${cur:=/dev/} diff --git a/completions/update-alternatives b/completions/update-alternatives index e9ba476b903..17b687a776d 100644 --- a/completions/update-alternatives +++ b/completions/update-alternatives @@ -82,9 +82,7 @@ _update_alternatives() _installed_alternatives ;; *) - COMPREPLY=( $(compgen -W '--verbose --quiet --help --version - --altdir --admindir --install --remove --auto --display - --config --set' -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) esac } && complete -F _update_alternatives update-alternatives alternatives diff --git a/test/t/test_screen.py b/test/t/test_screen.py index c05e0ce0170..39d92180841 100644 --- a/test/t/test_screen.py +++ b/test/t/test_screen.py @@ -2,7 +2,7 @@ class TestScreen: - @pytest.mark.complete("screen -") + @pytest.mark.complete("screen -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_smartctl.py b/test/t/test_smartctl.py index ac6dc68d0f5..26d0147dc9a 100644 --- a/test/t/test_smartctl.py +++ b/test/t/test_smartctl.py @@ -2,6 +2,6 @@ class TestSmartctl: - @pytest.mark.complete("smartctl --") + @pytest.mark.complete("smartctl --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_update_alternatives.py b/test/t/test_update_alternatives.py index 1209bebfd56..7c77730744f 100644 --- a/test/t/test_update_alternatives.py +++ b/test/t/test_update_alternatives.py @@ -3,6 +3,6 @@ @pytest.mark.bashcomp(cmd="update-alternatives") class TestUpdateAlternatives: - @pytest.mark.complete("update-alternatives --") + @pytest.mark.complete("update-alternatives --", require_cmd=True) def test_1(self, completion): assert completion From e32ca04b96f4e7c78232d6d75bc3782847f8aa97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 13 Jul 2019 11:37:38 +0300 Subject: [PATCH 0259/1094] sysctl: invoke completed sysctl instead of one from path to get variables --- completions/sysctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/sysctl b/completions/sysctl index e683977b9a0..6eb3f39155b 100644 --- a/completions/sysctl +++ b/completions/sysctl @@ -22,7 +22,7 @@ _sysctl() local suffix= [[ $prev == -w ]] && suffix="=" COMPREPLY=( $(compgen -S "$suffix" -W \ - "$(PATH="$PATH:/sbin" sysctl -N -a 2>/dev/null)" -- "$cur") ) + "$(PATH="$PATH:/sbin" $1 -N -a 2>/dev/null)" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && From 503143bf4dd7c43088b646f81eafa4494c476b26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 13 Jul 2019 11:46:58 +0300 Subject: [PATCH 0260/1094] test: mark more tests that parse command output as requiring command --- test/t/test_arch.py | 2 +- test/t/test_arp.py | 6 ++++-- test/t/test_arping.py | 2 +- test/t/test_bind.py | 2 +- test/t/test_chmod.py | 2 +- test/t/test_chpasswd.py | 2 +- test/t/test_configure.py | 2 +- test/t/test_createdb.py | 4 +++- test/t/test_declare.py | 4 ++-- test/t/test_dmesg.py | 2 +- test/t/test_dropdb.py | 4 +++- test/t/test_eject.py | 2 +- test/t/test_export.py | 2 +- test/t/test_flake8.py | 5 +++-- test/t/test_hexdump.py | 2 +- test/t/test_hostname.py | 2 +- test/t/test_hwclock.py | 2 +- test/t/test_iconv.py | 6 ++++-- test/t/test_ifup.py | 4 +++- test/t/test_ionice.py | 2 +- test/t/test_makepkg.py | 2 +- test/t/test_modinfo.py | 2 +- test/t/test_nc.py | 2 +- test/t/test_passwd.py | 2 +- test/t/test_perl.py | 22 +++++++++++++--------- test/t/test_perldoc.py | 2 +- test/t/test_ping.py | 2 +- test/t/test_pwd.py | 2 +- test/t/test_rmmod.py | 2 +- test/t/test_sysctl.py | 3 ++- test/t/test_timeout.py | 2 +- test/t/test_ulimit.py | 2 +- test/t/test_watch.py | 2 +- test/t/test_wget.py | 2 +- test/t/test_xmodmap.py | 2 +- test/t/test_xvfb_run.py | 2 +- test/t/test_xxd.py | 2 +- 37 files changed, 65 insertions(+), 49 deletions(-) diff --git a/test/t/test_arch.py b/test/t/test_arch.py index 69e0b1ae6a1..7a0f4478780 100644 --- a/test/t/test_arch.py +++ b/test/t/test_arch.py @@ -3,6 +3,6 @@ @pytest.mark.bashcomp(pre_cmds=("PATH=/usr/lib/mailman/bin:$PATH",)) class TestArch: - @pytest.mark.complete("arch -") + @pytest.mark.complete("arch -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_arp.py b/test/t/test_arp.py index 0dc117284e5..cd038bdb098 100644 --- a/test/t/test_arp.py +++ b/test/t/test_arp.py @@ -2,10 +2,12 @@ class TestArp: - @pytest.mark.complete("arp ", skipif='test -z "$(arp 2>/dev/null)"') + @pytest.mark.complete( + "arp ", require_cmd=True, skipif='test -z "$(arp 2>/dev/null)"' + ) def test_1(self, completion): assert completion - @pytest.mark.complete("arp -") + @pytest.mark.complete("arp -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_arping.py b/test/t/test_arping.py index 850344bed95..0eef5c9e984 100644 --- a/test/t/test_arping.py +++ b/test/t/test_arping.py @@ -6,6 +6,6 @@ class TestArping: def test_1(self, completion): assert completion - @pytest.mark.complete("arping -") + @pytest.mark.complete("arping -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_bind.py b/test/t/test_bind.py index f97a246e1ba..97a504441d2 100644 --- a/test/t/test_bind.py +++ b/test/t/test_bind.py @@ -2,7 +2,7 @@ class TestBind: - @pytest.mark.complete("bind -") + @pytest.mark.complete("bind -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_chmod.py b/test/t/test_chmod.py index ed59cf137c6..3838b5573ab 100644 --- a/test/t/test_chmod.py +++ b/test/t/test_chmod.py @@ -12,7 +12,7 @@ def test_1(self, completion): def test_2(self, completion): assert completion - @pytest.mark.complete("chmod -") + @pytest.mark.complete("chmod -", require_cmd=True) def test_3(self, completion): assert completion diff --git a/test/t/test_chpasswd.py b/test/t/test_chpasswd.py index ce16a75d670..ebb292f3d88 100644 --- a/test/t/test_chpasswd.py +++ b/test/t/test_chpasswd.py @@ -2,6 +2,6 @@ class TestChpasswd: - @pytest.mark.complete("chpasswd -") + @pytest.mark.complete("chpasswd -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_configure.py b/test/t/test_configure.py index 17bc9d4869f..0fc61171400 100644 --- a/test/t/test_configure.py +++ b/test/t/test_configure.py @@ -8,7 +8,7 @@ ) ) class TestConfigure: - @pytest.mark.complete("configure --") + @pytest.mark.complete("configure --", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_createdb.py b/test/t/test_createdb.py index d281dc794e0..030338a00c9 100644 --- a/test/t/test_createdb.py +++ b/test/t/test_createdb.py @@ -4,6 +4,8 @@ class TestCreatedb: # --help can fail due to missing package dependencies, e.g. on Ubuntu 14 - @pytest.mark.complete("createdb -", xfail="! createdb --help &>/dev/null") + @pytest.mark.complete( + "createdb -", require_cmd=True, xfail="! createdb --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_declare.py b/test/t/test_declare.py index b17affc2fb1..a61d9260b77 100644 --- a/test/t/test_declare.py +++ b/test/t/test_declare.py @@ -2,11 +2,11 @@ class TestDeclare: - @pytest.mark.complete("declare -") + @pytest.mark.complete("declare -", require_cmd=True) def test_1(self, completion): assert completion - @pytest.mark.complete("declare +") + @pytest.mark.complete("declare +", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_dmesg.py b/test/t/test_dmesg.py index 4416fe1c2f9..a081fb67c80 100644 --- a/test/t/test_dmesg.py +++ b/test/t/test_dmesg.py @@ -2,6 +2,6 @@ class TestDmesg: - @pytest.mark.complete("dmesg -") + @pytest.mark.complete("dmesg -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_dropdb.py b/test/t/test_dropdb.py index 82e2aef6f0f..2f6585760c6 100644 --- a/test/t/test_dropdb.py +++ b/test/t/test_dropdb.py @@ -4,6 +4,8 @@ class TestDropdb: # --help can fail due to missing package dependencies, e.g. on Ubuntu 14 - @pytest.mark.complete("dropdb -", xfail="! dropdb --help &>/dev/null") + @pytest.mark.complete( + "dropdb -", require_cmd=True, xfail="! dropdb --help &>/dev/null" + ) def test_1(self, completion): assert completion diff --git a/test/t/test_eject.py b/test/t/test_eject.py index 037ea98e2ac..d4ec1bd1990 100644 --- a/test/t/test_eject.py +++ b/test/t/test_eject.py @@ -2,6 +2,6 @@ class TestEject: - @pytest.mark.complete("eject -") + @pytest.mark.complete("eject -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_export.py b/test/t/test_export.py index 59dfdb2ee11..8738913ad1c 100644 --- a/test/t/test_export.py +++ b/test/t/test_export.py @@ -31,6 +31,6 @@ def test_6(self, completion): def test_7(self, completion): assert completion - @pytest.mark.complete("export -") + @pytest.mark.complete("export -", require_cmd=True) def test_8(self, completion): assert completion diff --git a/test/t/test_flake8.py b/test/t/test_flake8.py index 52246e1e256..67649fa7ec7 100644 --- a/test/t/test_flake8.py +++ b/test/t/test_flake8.py @@ -1,13 +1,14 @@ import pytest -@pytest.mark.bashcomp(xfail="! flake8 --help &>/dev/null") class TestFlake8: @pytest.mark.complete("flake8 ") def test_1(self, completion): assert completion - @pytest.mark.complete("flake8 -") + @pytest.mark.complete( + "flake8 -", require_cmd=True, xfail="! flake8 --help &>/dev/null" + ) def test_2(self, completion): assert completion diff --git a/test/t/test_hexdump.py b/test/t/test_hexdump.py index 82b6d2ba52e..03a7b1f22cb 100644 --- a/test/t/test_hexdump.py +++ b/test/t/test_hexdump.py @@ -2,6 +2,6 @@ class TestHexdump: - @pytest.mark.complete("hexdump -") + @pytest.mark.complete("hexdump -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_hostname.py b/test/t/test_hostname.py index 5ccdf4583b4..f644c1eabfd 100644 --- a/test/t/test_hostname.py +++ b/test/t/test_hostname.py @@ -2,6 +2,6 @@ class TestHostname: - @pytest.mark.complete("hostname -") + @pytest.mark.complete("hostname -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_hwclock.py b/test/t/test_hwclock.py index a9cb30faf19..47172103109 100644 --- a/test/t/test_hwclock.py +++ b/test/t/test_hwclock.py @@ -2,6 +2,6 @@ class TestHwclock: - @pytest.mark.complete("hwclock -") + @pytest.mark.complete("hwclock -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_iconv.py b/test/t/test_iconv.py index 5639cf8e210..f42a87fee51 100644 --- a/test/t/test_iconv.py +++ b/test/t/test_iconv.py @@ -2,11 +2,13 @@ class TestIconv: - @pytest.mark.complete("iconv -", xfail="! iconv --help &>/dev/null") + @pytest.mark.complete( + "iconv -", require_cmd=True, xfail="! iconv --help &>/dev/null" + ) def test_1(self, completion): assert completion - @pytest.mark.complete("iconv -f UTF") + @pytest.mark.complete("iconv -f UTF", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_ifup.py b/test/t/test_ifup.py index 65767dd7603..843190e41d4 100644 --- a/test/t/test_ifup.py +++ b/test/t/test_ifup.py @@ -9,7 +9,9 @@ class TestIfup: def test_1(self, completion): assert completion - @pytest.mark.complete("ifup -", skipif="! ifup --help &>/dev/null") + @pytest.mark.complete( + "ifup -", require_cmd=True, skipif="! ifup --help &>/dev/null" + ) def test_2(self, completion): assert completion diff --git a/test/t/test_ionice.py b/test/t/test_ionice.py index ae047043f02..b097ebe07d2 100644 --- a/test/t/test_ionice.py +++ b/test/t/test_ionice.py @@ -2,6 +2,6 @@ class TestIonice: - @pytest.mark.complete("ionice -") + @pytest.mark.complete("ionice -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_makepkg.py b/test/t/test_makepkg.py index bb4344e8b83..f643a292456 100644 --- a/test/t/test_makepkg.py +++ b/test/t/test_makepkg.py @@ -10,7 +10,7 @@ class TestMakepkg: def test_1(self, completion): assert completion - @pytest.mark.complete("makepkg --") + @pytest.mark.complete("makepkg --", require_cmd=True) def test_2(self, completion): assert all( x in completion for x in "--chown --linkadd --prepend".split() diff --git a/test/t/test_modinfo.py b/test/t/test_modinfo.py index d3c78a218e6..a4f5c50ae47 100644 --- a/test/t/test_modinfo.py +++ b/test/t/test_modinfo.py @@ -4,7 +4,7 @@ class TestModinfo: - @pytest.mark.complete("modinfo -") + @pytest.mark.complete("modinfo -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_nc.py b/test/t/test_nc.py index 6a50106e869..38db5acd444 100644 --- a/test/t/test_nc.py +++ b/test/t/test_nc.py @@ -2,6 +2,6 @@ class TestNc: - @pytest.mark.complete("nc -") + @pytest.mark.complete("nc -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_passwd.py b/test/t/test_passwd.py index 60441de9d49..f253701b2bd 100644 --- a/test/t/test_passwd.py +++ b/test/t/test_passwd.py @@ -6,6 +6,6 @@ class TestPasswd: def test_1(self, completion): assert completion - @pytest.mark.complete("passwd -") + @pytest.mark.complete("passwd -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_perl.py b/test/t/test_perl.py index 7c0c6094024..5442024c509 100644 --- a/test/t/test_perl.py +++ b/test/t/test_perl.py @@ -11,33 +11,33 @@ def test_1(self, completion): def test_2(self, completion): assert not completion - @pytest.mark.complete("perl -V:install") + @pytest.mark.complete("perl -V:install", require_cmd=True) def test_3(self, completion): assert completion - @pytest.mark.complete("perl -V::install") + @pytest.mark.complete("perl -V::install", require_cmd=True) def test_4(self, completion): assert completion # Assume File::Spec and friends are always installed - @pytest.mark.complete("perl -MFile") + @pytest.mark.complete("perl -MFile", require_cmd=True) def test_5(self, completion): assert completion - @pytest.mark.complete("perl -MFile::Sp") + @pytest.mark.complete("perl -MFile::Sp", require_cmd=True) def test_6(self, completion): assert completion - @pytest.mark.complete("perl -MFile::Spec::Func") + @pytest.mark.complete("perl -MFile::Spec::Func", require_cmd=True) def test_7(self, completion): assert completion - @pytest.mark.complete("perl -M-File") + @pytest.mark.complete("perl -M-File", require_cmd=True) def test_8(self, completion): assert completion - @pytest.mark.complete("perl -m-File::") + @pytest.mark.complete("perl -m-File::", require_cmd=True) def test_9(self, completion): assert completion @@ -70,10 +70,14 @@ def test_15(self, completion): """-x with space should complete dirs.""" assert completion == ["shared/default/bar bar.d/"] - @pytest.mark.complete("perl -d:", env=dict(PERL5LIB="$PWD/perl")) + @pytest.mark.complete( + "perl -d:", env=dict(PERL5LIB="$PWD/perl"), require_cmd=True + ) def test_16(self, completion): assert "BashCompletion" in completion - @pytest.mark.complete("perl -dt:", env=dict(PERL5LIB="$PWD/perl")) + @pytest.mark.complete( + "perl -dt:", env=dict(PERL5LIB="$PWD/perl"), require_cmd=True + ) def test_17(self, completion): assert "BashCompletion" in completion diff --git a/test/t/test_perldoc.py b/test/t/test_perldoc.py index 9f772944ade..282f824b0ce 100644 --- a/test/t/test_perldoc.py +++ b/test/t/test_perldoc.py @@ -9,7 +9,7 @@ def test_1(self, completion): assert "fixtures/" not in completion # Our fixtures/ dir assert not [x for x in completion if "File::File::" in x] - @pytest.mark.complete("perldoc -") + @pytest.mark.complete("perldoc -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_ping.py b/test/t/test_ping.py index e7c77365e99..f70582a0a87 100644 --- a/test/t/test_ping.py +++ b/test/t/test_ping.py @@ -6,6 +6,6 @@ class TestPing: def test_1(self, completion): assert completion - @pytest.mark.complete("ping -") + @pytest.mark.complete("ping -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_pwd.py b/test/t/test_pwd.py index b1ec337829b..fe7dd08b333 100644 --- a/test/t/test_pwd.py +++ b/test/t/test_pwd.py @@ -2,6 +2,6 @@ class TestPwd: - @pytest.mark.complete("pwd -") + @pytest.mark.complete("pwd -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_rmmod.py b/test/t/test_rmmod.py index dfeb00900b0..55287059217 100644 --- a/test/t/test_rmmod.py +++ b/test/t/test_rmmod.py @@ -2,6 +2,6 @@ class TestRmmod: - @pytest.mark.complete("rmmod -") + @pytest.mark.complete("rmmod -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_sysctl.py b/test/t/test_sysctl.py index e666c4c044e..f8db50bd417 100644 --- a/test/t/test_sysctl.py +++ b/test/t/test_sysctl.py @@ -2,12 +2,13 @@ class TestSysctl: - @pytest.mark.complete("sysctl -") + @pytest.mark.complete("sysctl -", require_cmd=True) def test_1(self, completion): assert completion @pytest.mark.complete( "sysctl kern", + require_cmd=True, xfail="! sysctl -N -a 2>/dev/null | command grep -q ^kern", ) def test_2(self, completion): diff --git a/test/t/test_timeout.py b/test/t/test_timeout.py index 6b5ac5f0153..46fe2e0027e 100644 --- a/test/t/test_timeout.py +++ b/test/t/test_timeout.py @@ -6,6 +6,6 @@ class TestTimeout: def test_1(self, completion): assert not completion - @pytest.mark.complete("timeout -") + @pytest.mark.complete("timeout -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_ulimit.py b/test/t/test_ulimit.py index 24785beba9c..3ab974cfd8f 100644 --- a/test/t/test_ulimit.py +++ b/test/t/test_ulimit.py @@ -6,7 +6,7 @@ class TestUlimit: def test_1(self, completion): assert completion - @pytest.mark.complete("ulimit -") + @pytest.mark.complete("ulimit -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_watch.py b/test/t/test_watch.py index 8387ae0a880..b1de7f55dee 100644 --- a/test/t/test_watch.py +++ b/test/t/test_watch.py @@ -2,6 +2,6 @@ class TestWatch: - @pytest.mark.complete("watch -") + @pytest.mark.complete("watch -", require_cmd=True) def test_1(self, completion): assert completion diff --git a/test/t/test_wget.py b/test/t/test_wget.py index 297434605b3..de752c2667e 100644 --- a/test/t/test_wget.py +++ b/test/t/test_wget.py @@ -6,6 +6,6 @@ class TestWget: def test_1(self, completion): assert not completion - @pytest.mark.complete("wget --s") + @pytest.mark.complete("wget --s", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_xmodmap.py b/test/t/test_xmodmap.py index d6d0ceae341..cc33d737d92 100644 --- a/test/t/test_xmodmap.py +++ b/test/t/test_xmodmap.py @@ -6,6 +6,6 @@ class TestXmodmap: def test_1(self, completion): assert completion - @pytest.mark.complete("xmodmap -") + @pytest.mark.complete("xmodmap -", require_cmd=True) def test_2(self, completion): assert completion diff --git a/test/t/test_xvfb_run.py b/test/t/test_xvfb_run.py index bb324c457c4..89eb83082a2 100644 --- a/test/t/test_xvfb_run.py +++ b/test/t/test_xvfb_run.py @@ -7,6 +7,6 @@ class TestXvfbRun: def test_no_args(self, completion): assert any(x in completion for x in ("bash", "xvfb-run")) - @pytest.mark.complete("xvfb-run -") + @pytest.mark.complete("xvfb-run -", require_cmd=True) def test_options(self, completion): assert completion diff --git a/test/t/test_xxd.py b/test/t/test_xxd.py index bd461eb72ba..9e84bb7ca35 100644 --- a/test/t/test_xxd.py +++ b/test/t/test_xxd.py @@ -6,6 +6,6 @@ class TestXxd: def test_1(self, completion): assert completion - @pytest.mark.complete("xxd -") + @pytest.mark.complete("xxd -", require_cmd=True) def test_2(self, completion): assert completion From 6d79948d9fe5923a3ec9fcaf881fb182cb59569d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 13 Jul 2019 19:21:58 +0300 Subject: [PATCH 0261/1094] test: add require_longopt xfail helper, use it --- test/t/conftest.py | 15 ++++++++++++--- test/t/test_awk.py | 2 +- test/t/test_base64.py | 2 +- test/t/test_bc.py | 9 +-------- test/t/test_cat.py | 2 +- test/t/test_chroot.py | 2 +- test/t/test_cp.py | 2 +- test/t/test_cut.py | 2 +- test/t/test_df.py | 2 +- test/t/test_du.py | 2 +- test/t/test_env.py | 9 +-------- test/t/test_expand.py | 9 +-------- test/t/test_fold.py | 9 +-------- test/t/test_grep.py | 9 +-------- test/t/test_head.py | 9 +-------- test/t/test_less.py | 9 +-------- test/t/test_ln.py | 2 +- test/t/test_md5sum.py | 2 +- test/t/test_mkdir.py | 2 +- test/t/test_mkfifo.py | 2 +- test/t/test_mknod.py | 2 +- test/t/test_mv.py | 2 +- test/t/test_netstat.py | 2 +- test/t/test_nl.py | 2 +- test/t/test_od.py | 2 +- test/t/test_paste.py | 2 +- test/t/test_rm.py | 2 +- test/t/test_sed.py | 9 +-------- test/t/test_seq.py | 9 +-------- test/t/test_sha1sum.py | 9 +-------- test/t/test_sort.py | 9 +-------- test/t/test_split.py | 9 +-------- test/t/test_sum.py | 2 +- test/t/test_tac.py | 9 +-------- test/t/test_tail.py | 9 +-------- test/t/test_tee.py | 2 +- test/t/test_touch.py | 9 +-------- test/t/test_tr.py | 9 +-------- test/t/test_uname.py | 9 +-------- test/t/test_unexpand.py | 9 +-------- test/t/test_uniq.py | 9 +-------- test/t/test_wc.py | 9 +-------- 42 files changed, 53 insertions(+), 184 deletions(-) diff --git a/test/t/conftest.py b/test/t/conftest.py index b5b2d2256ee..ad9f629d81d 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -454,9 +454,18 @@ def completion(request, bash: pexpect.spawn) -> CompletionResult: return CompletionResult("", []) for pre_cmd in marker.kwargs.get("pre_cmds", []): assert_bash_exec(bash, pre_cmd) - if marker.kwargs.get("require_cmd") and not is_bash_type( - bash, getattr(request.cls, "cmd", None) - ): + cmd = getattr(request.cls, "cmd", None) + if marker.kwargs.get("require_longopt"): + # longopt completions require both command presence and that it + # responds something useful to --help + if "require_cmd" not in marker.kwargs: + marker.kwargs["require_cmd"] = True + if "xfail" not in marker.kwargs: + marker.kwargs["xfail"] = ( + "! %s --help &>/dev/null || " + "! %s --help 2>&1 | command grep -qF -- --help" + ) % ((cmd,) * 2) + if marker.kwargs.get("require_cmd") and not is_bash_type(bash, cmd): pytest.skip("Command not found") return assert_complete(bash, marker.args[0], **marker.kwargs) diff --git a/test/t/test_awk.py b/test/t/test_awk.py index f2f6daca193..9fd738044ab 100644 --- a/test/t/test_awk.py +++ b/test/t/test_awk.py @@ -6,6 +6,6 @@ class TestAwk: def test_1(self, completion): assert completion - @pytest.mark.complete("awk -", require_cmd=True) + @pytest.mark.complete("awk -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_base64.py b/test/t/test_base64.py index ffb9a788f1d..957f5a37768 100644 --- a/test/t/test_base64.py +++ b/test/t/test_base64.py @@ -6,6 +6,6 @@ class TestBase64: def test_1(self, completion): assert completion - @pytest.mark.complete("base64 -", require_cmd=True) + @pytest.mark.complete("base64 -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_bc.py b/test/t/test_bc.py index 0b9cc184fb0..7f8056e503e 100644 --- a/test/t/test_bc.py +++ b/test/t/test_bc.py @@ -2,13 +2,6 @@ class TestBc: - @pytest.mark.complete( - "bc --", - require_cmd=True, - xfail=( - "! bc --help &>/dev/null || " - "! bc --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("bc --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_cat.py b/test/t/test_cat.py index 3ed2f442358..5fa4c8ff650 100644 --- a/test/t/test_cat.py +++ b/test/t/test_cat.py @@ -6,6 +6,6 @@ class TestCat: def test_1(self, completion): assert completion - @pytest.mark.complete("cat -", require_cmd=True) + @pytest.mark.complete("cat -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_chroot.py b/test/t/test_chroot.py index 77384006a08..08ace867f38 100644 --- a/test/t/test_chroot.py +++ b/test/t/test_chroot.py @@ -11,6 +11,6 @@ def test_2(self, completion): """Should complete dirs only, also when invoked using full path.""" assert completion == ["bar bar.d/", "foo.d/"] - @pytest.mark.complete("chroot -", require_cmd=True) + @pytest.mark.complete("chroot -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_cp.py b/test/t/test_cp.py index dd315225764..7634df75d95 100644 --- a/test/t/test_cp.py +++ b/test/t/test_cp.py @@ -6,6 +6,6 @@ class TestCp: def test_1(self, completion): assert completion - @pytest.mark.complete("cp -", require_cmd=True) + @pytest.mark.complete("cp -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_cut.py b/test/t/test_cut.py index 7f74aa651b2..b0faca6a32d 100644 --- a/test/t/test_cut.py +++ b/test/t/test_cut.py @@ -6,6 +6,6 @@ class TestCut: def test_1(self, completion): assert completion - @pytest.mark.complete("cut -", require_cmd=True) + @pytest.mark.complete("cut -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_df.py b/test/t/test_df.py index d54c131d0b0..be28e6cbcd6 100644 --- a/test/t/test_df.py +++ b/test/t/test_df.py @@ -6,6 +6,6 @@ class TestDf: def test_1(self, completion): assert completion - @pytest.mark.complete("df -", require_cmd=True) + @pytest.mark.complete("df -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_du.py b/test/t/test_du.py index 29dfbf81834..3d73e99a663 100644 --- a/test/t/test_du.py +++ b/test/t/test_du.py @@ -6,6 +6,6 @@ class TestDu: def test_1(self, completion): assert completion - @pytest.mark.complete("du -", require_cmd=True) + @pytest.mark.complete("du -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_env.py b/test/t/test_env.py index 84228e8190d..3d1a684ed92 100644 --- a/test/t/test_env.py +++ b/test/t/test_env.py @@ -2,13 +2,6 @@ class TestEnv: - @pytest.mark.complete( - "env --", - require_cmd=True, - xfail=( - "! env --help &>/dev/null || " - "! env --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("env --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_expand.py b/test/t/test_expand.py index 9e9884f7575..11f4bdb8a63 100644 --- a/test/t/test_expand.py +++ b/test/t/test_expand.py @@ -2,13 +2,6 @@ class TestExpand: - @pytest.mark.complete( - "expand --", - require_cmd=True, - xfail=( - "! expand --help &>/dev/null || " - "! expand --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("expand --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_fold.py b/test/t/test_fold.py index b530cc2ebda..1cbaef9288e 100644 --- a/test/t/test_fold.py +++ b/test/t/test_fold.py @@ -2,13 +2,6 @@ class TestFold: - @pytest.mark.complete( - "fold --", - require_cmd=True, - xfail=( - "! fold --help &>/dev/null || " - "! fold --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("fold --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_grep.py b/test/t/test_grep.py index 49b327768b1..a249122eb12 100644 --- a/test/t/test_grep.py +++ b/test/t/test_grep.py @@ -2,14 +2,7 @@ class TestGrep: - @pytest.mark.complete( - "grep --", - require_cmd=True, - xfail=( - "! grep --help &>/dev/null || " - "! grep --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("grep --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_head.py b/test/t/test_head.py index a0148839ed9..815b938c8dd 100644 --- a/test/t/test_head.py +++ b/test/t/test_head.py @@ -2,13 +2,6 @@ class TestHead: - @pytest.mark.complete( - "head --", - require_cmd=True, - xfail=( - "! head --help &>/dev/null || " - "! head --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("head --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_less.py b/test/t/test_less.py index c7230c3022b..0b14e21ea3b 100644 --- a/test/t/test_less.py +++ b/test/t/test_less.py @@ -2,13 +2,6 @@ class TestLess: - @pytest.mark.complete( - "less --", - require_cmd=True, - xfail=( - "! less --help &>/dev/null || " - "! less --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("less --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_ln.py b/test/t/test_ln.py index 2df5706f4f9..6bf809c6ba7 100644 --- a/test/t/test_ln.py +++ b/test/t/test_ln.py @@ -6,6 +6,6 @@ class TestLn: def test_1(self, completion): assert completion - @pytest.mark.complete("ln -", require_cmd=True) + @pytest.mark.complete("ln -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_md5sum.py b/test/t/test_md5sum.py index 4009f58e35c..0a3286ade1e 100644 --- a/test/t/test_md5sum.py +++ b/test/t/test_md5sum.py @@ -6,6 +6,6 @@ class TestMd5sum: def test_1(self, completion): assert completion - @pytest.mark.complete("md5sum -", require_cmd=True) + @pytest.mark.complete("md5sum -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_mkdir.py b/test/t/test_mkdir.py index 397e4970b07..1b9cb9dc020 100644 --- a/test/t/test_mkdir.py +++ b/test/t/test_mkdir.py @@ -17,6 +17,6 @@ def test_3(self, completion): assert completion.output == "foo" assert completion == [completion.output] - @pytest.mark.complete("mkdir -", require_cmd=True) + @pytest.mark.complete("mkdir -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_mkfifo.py b/test/t/test_mkfifo.py index 718e0bb668a..92e82de7986 100644 --- a/test/t/test_mkfifo.py +++ b/test/t/test_mkfifo.py @@ -6,6 +6,6 @@ class TestMkfifo: def test_1(self, completion): assert completion - @pytest.mark.complete("mkfifo -", require_cmd=True) + @pytest.mark.complete("mkfifo -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_mknod.py b/test/t/test_mknod.py index f0b516cd2bf..03f21e8cd9f 100644 --- a/test/t/test_mknod.py +++ b/test/t/test_mknod.py @@ -6,6 +6,6 @@ class TestMknod: def test_1(self, completion): assert completion - @pytest.mark.complete("mknod -", require_cmd=True) + @pytest.mark.complete("mknod -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_mv.py b/test/t/test_mv.py index ce00add7111..4a354db2f2d 100644 --- a/test/t/test_mv.py +++ b/test/t/test_mv.py @@ -6,6 +6,6 @@ class TestMv: def test_1(self, completion): assert completion - @pytest.mark.complete("mv -", require_cmd=True) + @pytest.mark.complete("mv -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_netstat.py b/test/t/test_netstat.py index 58db5760403..57ef26c007e 100644 --- a/test/t/test_netstat.py +++ b/test/t/test_netstat.py @@ -6,6 +6,6 @@ class TestNetstat: def test_1(self, completion): assert completion - @pytest.mark.complete("netstat -", require_cmd=True) + @pytest.mark.complete("netstat -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_nl.py b/test/t/test_nl.py index 50ff24596f8..ca910a59dd9 100644 --- a/test/t/test_nl.py +++ b/test/t/test_nl.py @@ -6,6 +6,6 @@ class TestNl: def test_1(self, completion): assert completion - @pytest.mark.complete("nl -", require_cmd=True) + @pytest.mark.complete("nl -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_od.py b/test/t/test_od.py index 9eabc76bebc..e2f5de282a1 100644 --- a/test/t/test_od.py +++ b/test/t/test_od.py @@ -6,6 +6,6 @@ class TestOd: def test_1(self, completion): assert completion - @pytest.mark.complete("od -", require_cmd=True) + @pytest.mark.complete("od -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_paste.py b/test/t/test_paste.py index be2d1e977a4..ecf030b52be 100644 --- a/test/t/test_paste.py +++ b/test/t/test_paste.py @@ -6,6 +6,6 @@ class TestPaste: def test_1(self, completion): assert completion - @pytest.mark.complete("paste -", require_cmd=True) + @pytest.mark.complete("paste -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_rm.py b/test/t/test_rm.py index 4cbfd84dfc6..6fda5a1d217 100644 --- a/test/t/test_rm.py +++ b/test/t/test_rm.py @@ -6,6 +6,6 @@ class TestRm: def test_1(self, completion): assert completion - @pytest.mark.complete("rm -", require_cmd=True) + @pytest.mark.complete("rm -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_sed.py b/test/t/test_sed.py index e2b4554081d..53079c9f364 100644 --- a/test/t/test_sed.py +++ b/test/t/test_sed.py @@ -2,13 +2,6 @@ class TestSed: - @pytest.mark.complete( - "sed --", - require_cmd=True, - xfail=( - "! sed --help &>/dev/null || " - "! sed --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("sed --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_seq.py b/test/t/test_seq.py index 5a6d6a6d22c..b672238097b 100644 --- a/test/t/test_seq.py +++ b/test/t/test_seq.py @@ -2,13 +2,6 @@ class TestSeq: - @pytest.mark.complete( - "seq --", - require_cmd=True, - xfail=( - "! seq --help &>/dev/null || " - "! seq --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("seq --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_sha1sum.py b/test/t/test_sha1sum.py index d4fd2782538..e4296d4628f 100644 --- a/test/t/test_sha1sum.py +++ b/test/t/test_sha1sum.py @@ -2,13 +2,6 @@ class TestSha1sum: - @pytest.mark.complete( - "sha1sum --", - require_cmd=True, - xfail=( - "! sha1sum --help &>/dev/null || " - "! sha1sum --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("sha1sum --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_sort.py b/test/t/test_sort.py index 58481784a36..d1a4e369c6a 100644 --- a/test/t/test_sort.py +++ b/test/t/test_sort.py @@ -2,13 +2,6 @@ class TestSort: - @pytest.mark.complete( - "sort --", - require_cmd=True, - xfail=( - "! sort --help &>/dev/null || " - "! sort --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("sort --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_split.py b/test/t/test_split.py index 8642040ed18..8c3f1f4cb7e 100644 --- a/test/t/test_split.py +++ b/test/t/test_split.py @@ -2,13 +2,6 @@ class TestSplit: - @pytest.mark.complete( - "split --", - require_cmd=True, - xfail=( - "! split --help &>/dev/null || " - "! split --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("split --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_sum.py b/test/t/test_sum.py index fd3230e1a84..bfb2cf4e0cf 100644 --- a/test/t/test_sum.py +++ b/test/t/test_sum.py @@ -6,6 +6,6 @@ class TestSum: def test_1(self, completion): assert completion - @pytest.mark.complete("sum -", require_cmd=True) + @pytest.mark.complete("sum -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_tac.py b/test/t/test_tac.py index 2627e3b70cb..db433cc92f2 100644 --- a/test/t/test_tac.py +++ b/test/t/test_tac.py @@ -2,13 +2,6 @@ class TestTac: - @pytest.mark.complete( - "tac --", - require_cmd=True, - xfail=( - "! tac --help &>/dev/null || " - "! tac --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("tac --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_tail.py b/test/t/test_tail.py index 4b8b8a831dd..6f2b3c61c6b 100644 --- a/test/t/test_tail.py +++ b/test/t/test_tail.py @@ -2,13 +2,6 @@ class TestTail: - @pytest.mark.complete( - "tail --", - require_cmd=True, - xfail=( - "! tail --help &>/dev/null || " - "! tail --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("tail --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_tee.py b/test/t/test_tee.py index 423d1b07917..3d8bcd7d500 100644 --- a/test/t/test_tee.py +++ b/test/t/test_tee.py @@ -6,6 +6,6 @@ class TestTee: def test_1(self, completion): assert completion - @pytest.mark.complete("tee -", require_cmd=True) + @pytest.mark.complete("tee -", require_longopt=True) def test_options(self, completion): assert completion diff --git a/test/t/test_touch.py b/test/t/test_touch.py index bf6de8e4b0e..8a49e500bd6 100644 --- a/test/t/test_touch.py +++ b/test/t/test_touch.py @@ -2,13 +2,6 @@ class TestTouch: - @pytest.mark.complete( - "touch --", - require_cmd=True, - xfail=( - "! touch --help &>/dev/null || " - "! touch --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("touch --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_tr.py b/test/t/test_tr.py index da907eb3e1b..0a51e9e4c3e 100644 --- a/test/t/test_tr.py +++ b/test/t/test_tr.py @@ -2,13 +2,6 @@ class TestTr: - @pytest.mark.complete( - "tr --", - require_cmd=True, - xfail=( - "! tr --help &>/dev/null || " - "! tr --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("tr --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_uname.py b/test/t/test_uname.py index 133377f0cc0..e71a433453a 100644 --- a/test/t/test_uname.py +++ b/test/t/test_uname.py @@ -2,13 +2,6 @@ class TestUname: - @pytest.mark.complete( - "uname --", - require_cmd=True, - xfail=( - "! uname --help &>/dev/null || " - "! uname --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("uname --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_unexpand.py b/test/t/test_unexpand.py index b9b34f3ec2d..2f1359b4757 100644 --- a/test/t/test_unexpand.py +++ b/test/t/test_unexpand.py @@ -2,13 +2,6 @@ class TestUnexpand: - @pytest.mark.complete( - "unexpand --", - require_cmd=True, - xfail=( - "! unexpand --help &>/dev/null || " - "! unexpand --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("unexpand --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_uniq.py b/test/t/test_uniq.py index 8d99d09b14b..73691fd8c36 100644 --- a/test/t/test_uniq.py +++ b/test/t/test_uniq.py @@ -2,13 +2,6 @@ class TestUniq: - @pytest.mark.complete( - "uniq --", - require_cmd=True, - xfail=( - "! uniq --help &>/dev/null || " - "! uniq --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("uniq --", require_longopt=True) def test_1(self, completion): assert completion diff --git a/test/t/test_wc.py b/test/t/test_wc.py index b87bcb22555..1f83ea7f75d 100644 --- a/test/t/test_wc.py +++ b/test/t/test_wc.py @@ -2,13 +2,6 @@ class TestWc: - @pytest.mark.complete( - "wc --", - require_cmd=True, - xfail=( - "! wc --help &>/dev/null || " - "! wc --help 2>&1 | command grep -qF -- --help" - ), - ) + @pytest.mark.complete("wc --", require_longopt=True) def test_1(self, completion): assert completion From 3135bc3780fda004a2c04e2ae007ae9ae1672f22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 28 Jul 2019 08:37:12 +0300 Subject: [PATCH 0262/1094] dmypy: new completion --- completions/Makefile.am | 1 + completions/dmypy | 47 +++++++++++++++++++++++++++++++++++++++++ test/t/Makefile.am | 1 + test/t/test_dmypy.py | 12 +++++++++++ 4 files changed, 61 insertions(+) create mode 100644 completions/dmypy create mode 100644 test/t/test_dmypy.py diff --git a/completions/Makefile.am b/completions/Makefile.am index 29dd95021f5..7cc9426a2bd 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -79,6 +79,7 @@ bashcomp_DATA = 2to3 \ dhclient \ dict \ _dmesg \ + dmypy \ dnssec-keygen \ dnsspoof \ dot \ diff --git a/completions/dmypy b/completions/dmypy new file mode 100644 index 00000000000..a8c0743756c --- /dev/null +++ b/completions/dmypy @@ -0,0 +1,47 @@ +# dmypy completion -*- shell-script -*- + +_dmypy() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --help|--version|-[hV]) + return + ;; + --status-file) + _filedir + return + ;; + esac + + local cmd i + for (( i=1; i < cword; i++ )); do + if [[ ${words[i]} != -* && ${words[i-1]} != --status-file ]]; then + cmd=${words[i]} + break + fi + done + + case $cmd in + check|run) + _filedir '@(py|pyi)' + return + esac + + if [[ $cur == -* ]]; then + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) + return + fi + + if [[ ! $cmd ]]; then + local cmds=$($1 --help 2>&1 \ + | command sed -ne '/positional arguments/{p;n;p;q}' \ + | command sed -ne 's/{\(.*\)}/\1/p') + COMPREPLY=( $(IFS="," compgen -W '$cmds' -- "$cur") ) + return + fi +} && +complete -F _dmypy dmypy + +# ex: filetype=sh diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 2b345f468b7..4f491024b42 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -125,6 +125,7 @@ EXTRA_DIST = \ test_dir.py \ test_display.py \ test_dmesg.py \ + test_dmypy.py \ test_dnssec_keygen.py \ test_dnsspoof.py \ test_dot.py \ diff --git a/test/t/test_dmypy.py b/test/t/test_dmypy.py new file mode 100644 index 00000000000..efaef7caa25 --- /dev/null +++ b/test/t/test_dmypy.py @@ -0,0 +1,12 @@ +import pytest + + +class TestDmypy: + @pytest.mark.complete("dmypy ", require_cmd=True) + def test_commands(self, completion): + assert "help" in completion + assert not any("," in x for x in completion) + + @pytest.mark.complete("dmypy -", require_cmd=True) + def test_options(self, completion): + assert "--help" in completion From be2e8f3fe6be17051a9aa6fe081b66897e0d8b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 29 Jul 2019 09:48:09 +0300 Subject: [PATCH 0263/1094] travis: generate dist tarball on alpine Fedora development might be a bit too unstable for this kind of a task, and they apparently have had an automake that caused broken/incompatible script shebangs in our 2.9 dist tarball. Closes #331 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 790b2a756d5..a11b61a3e23 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,5 +41,5 @@ deploy: skip_cleanup: true on: repo: scop/bash-completion - condition: $DIST = fedoradev + condition: $DIST = alpine tags: true From afc5a303ae25afdb109464e4f63fc17783383ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 29 Jul 2019 18:02:30 +0300 Subject: [PATCH 0264/1094] wine: install for wine-development and wine-stable too --- completions/.gitignore | 2 ++ completions/Makefile.am | 2 ++ completions/wine | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/completions/.gitignore b/completions/.gitignore index a1abde61733..34167766480 100644 --- a/completions/.gitignore +++ b/completions/.gitignore @@ -225,6 +225,8 @@ vgscan vgsplit vigr whatis +wine-development +wine-stable xpovray xvnc4viewer ypcat diff --git a/completions/Makefile.am b/completions/Makefile.am index 7cc9426a2bd..96f01b8324e 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -910,6 +910,8 @@ symlinks: $(DATA) vigr $(ss) vncviewer \ tightvncviewer xvnc4viewer + $(ss) wine \ + wine-development wine-stable $(ss) wodim \ cdrecord $(ss) xz \ diff --git a/completions/wine b/completions/wine index f871e74407c..dab45ae4cd5 100644 --- a/completions/wine +++ b/completions/wine @@ -15,6 +15,6 @@ _wine() _filedir fi } && -complete -F _wine wine +complete -F _wine wine wine-development wine-stable # ex: filetype=sh From 96b5e07b585b3122d51c5c25bc4289daa96524a7 Mon Sep 17 00:00:00 2001 From: Felix Lechner Date: Fri, 2 Aug 2019 09:20:40 -0700 Subject: [PATCH 0265/1094] perltidy: associate *.t (#338) Lintian enforces perltidy in its code base, including test scripts written in Perl. When perltidy is invoked, such arguments are not completed. This commit catches test scripts ending in *.t. --- completions/perltidy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/perltidy b/completions/perltidy index ce93b2a50d6..91bd50942b7 100644 --- a/completions/perltidy +++ b/completions/perltidy @@ -47,7 +47,7 @@ _perltidy() COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else - _filedir 'p[lm]' + _filedir 'p[lm]|t' fi } && complete -F _perltidy perltidy From c0a3c5592dadcee37cf41dcf5fac2a357d1b5f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 2 Aug 2019 19:22:19 +0300 Subject: [PATCH 0266/1094] travis: test with Debian 10 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a11b61a3e23..d6a5e81c977 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ services: env: - DIST=alpine - DIST=centos6 + - DIST=debian10 - DIST=fedoradev - DIST=ubuntu14 - DIST=ubuntu14 BSD=true NETWORK=none From 29a14f0f33ea8f3e8a77070eb30d14d547f8ac2b Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Sat, 3 Aug 2019 11:13:09 +0200 Subject: [PATCH 0267/1094] ssh: option and argument completion updates (#332) * Drop rsa1 keys if they are not supported by used OpenSSH * ssh-add: Complete missing arguments * Update ssh, scp and sftp completions and add missing options Signed-off-by: Jakub Jelen --- completions/ssh | 42 ++++++++++++++++++++++++++++++++++-------- completions/ssh-add | 10 +++++++++- completions/ssh-keygen | 7 ++++++- 3 files changed, 49 insertions(+), 10 deletions(-) diff --git a/completions/ssh b/completions/ssh index aaa103464fe..3a1472a7af3 100644 --- a/completions/ssh +++ b/completions/ssh @@ -3,7 +3,7 @@ _ssh_queries() { COMPREPLY+=( $(compgen -W \ - "cipher cipher-auth mac kex key key-cert key-plain protocol-version" \ + "cipher cipher-auth mac kex key key-cert key-plain protocol-version sig" \ -- "$cur") ) } @@ -34,7 +34,7 @@ _ssh_options() local opts=( AddKeysToAgent AddressFamily BatchMode BindAddress CanonicalDomains CanonicalizeFallbackLocal CanonicalizeHostname CanonicalizeMaxDots - CanonicalizePermittedCNAMEs CertificateFile + CanonicalizePermittedCNAMEs CASignatureAlgorithms CertificateFile ChallengeResponseAuthentication CheckHostIP Ciphers ClearAllForwardings Compression ConnectionAttempts ConnectTimeout ControlMaster ControlPath ControlPersist DynamicForward EnableSSHKeysign EscapeChar @@ -90,10 +90,10 @@ _ssh_suboption() gssapidelegatecredentials|gssapirenewalforcesrekey|gssapitrustdns|\ hashknownhosts|hostbasedauthentication|identitiesonly|\ kbdinteractiveauthentication|kbdinteractivedevices|\ - nohostauthenticationforlocalhost|passwordauthentication|\ + nohostauthenticationforlocalhost|passwordauthentication|permitlocalcommand|\ proxyusefdpass|pubkeyauthentication|rhostsrsaauthentication|\ - rsaauthentication|stricthostkeychecking|streamlocalbindunlink|\ - tcpkeepalive|useprivilegedport|verifyhostkeydns|visualhostkey) + rsaauthentication|streamlocalbindunlink|\ + tcpkeepalive|useprivilegedport|visualhostkey) COMPREPLY=( $(compgen -W 'yes no' -- "$cur") ) ;; addkeystoagent) @@ -108,15 +108,21 @@ _ssh_suboption() canonicalizehostname) COMPREPLY=( $(compgen -W 'yes no always' -- "$cur") ) ;; - *file|identityagent|include) + *file|identityagent|include|controlpath|revokedhostkeys|xauthlocation) _filedir ;; + casignaturealgorithms) + COMPREPLY=( $(compgen -W '$(_ssh_query "$2" sig)' -- "$cur") ) + ;; cipher) COMPREPLY=( $(compgen -W 'blowfish des 3des' -- "$cur") ) ;; ciphers) _ssh_ciphers "$2" ;; + controlmaster) + COMPREPLY=( $(compgen -W 'yes ask auto autoask no' -- "$cur") ) + ;; compressionlevel) COMPREPLY=( $(compgen -W '{1..9}' -- "$cur") ) ;; @@ -133,9 +139,15 @@ _ssh_suboption() kexalgorithms) COMPREPLY=( $(compgen -W '$(_ssh_query "$2" kex)' -- "$cur") ) ;; + loglevel) + COMPREPLY=( $(compgen -W 'QUIET FATAL ERROR INFO VERBOSE DEBUG{,1,2,3}' -- "$cur") ) + ;; macs) _ssh_macs "$2" ;; + pkcs11provider) + _filedir so + ;; preferredauthentications) COMPREPLY=( $(compgen -W 'gssapi-with-mic host-based publickey keyboard-interactive password' -- "$cur") ) @@ -150,12 +162,18 @@ _ssh_suboption() proxyjump) _known_hosts_real -a -F "$configfile" -- "$cur" ;; + proxycommand|remotecommand|localcommand) + COMPREPLY=( $(compgen -c -- "$cur") ) + ;; pubkeyacceptedkeytypes) COMPREPLY=( $(compgen -W '$(_ssh_query "$2" key)' -- "$cur") ) ;; requesttty) COMPREPLY=( $(compgen -W 'no yes force auto' -- "$cur") ) ;; + stricthostkeychecking) + COMPREPLY=( $(compgen -W 'accept-new ask no off' -- "$cur") ) + ;; syslogfacility) COMPREPLY=( $(compgen -W 'DAEMON USER AUTH LOCAL{0..7}' -- "$cur") ) ;; @@ -163,7 +181,7 @@ _ssh_suboption() COMPREPLY=( $(compgen -W 'yes no point-to-point ethernet' \ -- "$cur") ) ;; - updatehostkeys) + updatehostkeys|verifyhostkeydns) COMPREPLY=( $(compgen -W 'yes no ask' -- "$cur") ) ;; esac @@ -255,7 +273,7 @@ _ssh() return ;; -*O) - COMPREPLY=( $(compgen -W 'check forward exit stop' -- "$cur") ) + COMPREPLY=( $(compgen -W 'check forward cancel exit stop' -- "$cur") ) return ;; -*o) @@ -325,6 +343,10 @@ _sftp() _ssh_ciphers return ;; + -*J) + _known_hosts_real -a -F "$configfile" -- "$cur" + return + ;; -*o) _ssh_options return @@ -447,6 +469,10 @@ _scp() compopt +o nospace return ;; + -*J) + _known_hosts_real -a -F "$configfile" -- "$cur" + return + ;; -*[lP]) return ;; diff --git a/completions/ssh-add b/completions/ssh-add index d9157893a5d..f35c7d00b4b 100644 --- a/completions/ssh-add +++ b/completions/ssh-add @@ -6,7 +6,15 @@ _ssh_add() _init_completion || return case $prev in - -*[tE]) + -*E) + COMPREPLY=( $(compgen -W 'md5 sha256' -- "$cur") ) + return + ;; + -*t) + return + ;; + -*T) + _filedir return ;; -*[se]) diff --git a/completions/ssh-keygen b/completions/ssh-keygen index 5c449fc01f8..36fa2cad2d4 100644 --- a/completions/ssh-keygen +++ b/completions/ssh-keygen @@ -42,7 +42,12 @@ _ssh_keygen() return ;; -*t) - COMPREPLY=( $(compgen -W 'dsa ecdsa ed25519 rsa rsa1' -- "$cur") ) + local protocols=$(_xfunc ssh _ssh_query "$1" protocol-version) + local types='dsa ecdsa ed25519 rsa' + if [[ $protocols == *1* ]]; then + types+=' rsa1' + fi + COMPREPLY=( $(compgen -W "$types" -- "$cur") ) return ;; esac From 120bf77ad2d644eba6fb506caed08fa475a426e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 19 Aug 2019 22:38:49 +0300 Subject: [PATCH 0268/1094] java: don't assume jar is installed --- completions/java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/java b/completions/java index 1b3d29918f0..89d207d239c 100644 --- a/completions/java +++ b/completions/java @@ -69,7 +69,7 @@ _java_classes() COMPREPLY+=( $(unzip -lq "$i" "$cur*" 2>/dev/null | \ awk '$NF ~ /^-+$/ { flag=!flag; next }; flag && $NF ~ /^[^$]*\.class/ { print $NF }') ) - else + elif type jar &>/dev/null; then COMPREPLY+=( $(jar tf "$i" "$cur" | \ command grep '^[^$]*\.class$') ) fi From debbff95fe35082877ccda05153d6d87562088ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 20 Aug 2019 09:32:06 +0300 Subject: [PATCH 0269/1094] _sysvdirs: always return 0 It's not an error if any of the tests result in nonzero exit status. --- bash_completion | 1 + 1 file changed, 1 insertion(+) diff --git a/bash_completion b/bash_completion index 143cc70e596..85580412144 100644 --- a/bash_completion +++ b/bash_completion @@ -99,6 +99,7 @@ _sysvdirs() [[ -d /etc/init.d ]] && sysvdirs+=( /etc/init.d ) # Slackware uses /etc/rc.d [[ -f /etc/slackware-version ]] && sysvdirs=( /etc/rc.d ) + return 0 } # This function checks whether we have a given program on the system. From 4cf7e4f52d7da127198146cf57161f9bcee546da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 20 Aug 2019 22:42:25 +0300 Subject: [PATCH 0270/1094] test: xfail locale-gen option completion if --help is not available At least on Debian 10 it isn't. --- test/t/test_locale_gen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/t/test_locale_gen.py b/test/t/test_locale_gen.py index 6ad3ea1a462..caffb0677cd 100644 --- a/test/t/test_locale_gen.py +++ b/test/t/test_locale_gen.py @@ -8,6 +8,6 @@ class TestLocaleGen: def test_1(self, completion): assert completion - @pytest.mark.complete("locale-gen --", require_cmd=True) + @pytest.mark.complete("locale-gen --", require_longopt=True) def test_2(self, completion): assert completion From 6c8380df27f6af2704d15c2de7efbb87fe0d1f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 20 Aug 2019 22:49:29 +0300 Subject: [PATCH 0271/1094] valgrind: look tool names from lib/*-linux-gnu dirs too Fixes lookup on Debian 10. --- completions/valgrind | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/completions/valgrind b/completions/valgrind index 2df097075af..01ca62c5a7a 100644 --- a/completions/valgrind +++ b/completions/valgrind @@ -32,7 +32,8 @@ _valgrind() # Tools seem to be named e.g. like memcheck-amd64-linux from which # we want to grab memcheck. COMPREPLY=( $(compgen -W '$( - for f in /usr{,/local}/lib{,64,exec}/valgrind/*; do + for f in /usr{,/local}/lib{,64,exec}{/*-linux-gnu,}/valgrind/* + do [[ $f != *.so && -x $f && $f =~ ^.*/(.*)-[^-]+-[^-]+ ]] && printf "%s\n" "${BASH_REMATCH[1]}" done)' -- "$cur") ) From 9e351e41eb4bbadd94f9df48915708f78b8246b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 20 Aug 2019 23:06:52 +0300 Subject: [PATCH 0272/1094] test: adjust java expectations based on whether jars can be listed --- test/t/test_java.py | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/test/t/test_java.py b/test/t/test_java.py index d18f43dc6aa..ce0f7733575 100644 --- a/test/t/test_java.py +++ b/test/t/test_java.py @@ -1,25 +1,44 @@ import pytest +from conftest import is_bash_type + @pytest.mark.bashcomp( pre_cmds=("CLASSPATH=$PWD/java/a:$PWD/java/bashcomp.jar",) ) class TestJava: + @pytest.fixture(scope="class") + def can_list_jar(self, bash): + return ( + is_bash_type(bash, "zipinfo") + or is_bash_type(bash, "unzip") + or is_bash_type(bash, "jar") + ) + @pytest.mark.complete("java -", require_cmd=True) def test_1(self, completion): assert completion @pytest.mark.complete("java ") - def test_2(self, completion): - assert completion == "b bashcomp.jarred c. toplevel".split() + def test_2(self, completion, can_list_jar): + if can_list_jar: + assert completion == "b bashcomp.jarred c. toplevel".split() + else: + assert completion == "b c.".split() @pytest.mark.complete("java -classpath java/bashcomp.jar ") - def test_3(self, completion): - assert completion == "bashcomp.jarred toplevel".split() + def test_3(self, completion, can_list_jar): + if can_list_jar: + assert completion == "bashcomp.jarred toplevel".split() + else: + assert not completion @pytest.mark.complete("java -cp java/bashcomp.jar:java/a/c ") - def test_4(self, completion): - assert completion == "bashcomp.jarred d toplevel".split() + def test_4(self, completion, can_list_jar): + if can_list_jar: + assert completion == "bashcomp.jarred d toplevel".split() + else: + assert completion == ["d"] @pytest.mark.complete("java -cp '' ") def test_5(self, completion): From d10dcdf798890afcb361e6286dfbff1404d43916 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 25 Aug 2019 20:17:56 +0300 Subject: [PATCH 0273/1094] op: direct command parsing stderr to /dev/null Closes https://github.com/scop/bash-completion/issues/341 --- completions/op | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/op b/completions/op index b99bd2ded34..ddbe4c7308a 100644 --- a/completions/op +++ b/completions/op @@ -2,7 +2,7 @@ _op_commands() { - "$@" --help | + "$@" --help 2>/dev/null | awk "/^(Available |Sub)commands/{flag=1;next}/^ /&&flag{print \$1}" } From f5d99f22f6da6deb4fb037a2966d8b2f8532a4f3 Mon Sep 17 00:00:00 2001 From: Wolf Date: Thu, 5 Sep 2019 20:30:58 +0300 Subject: [PATCH 0274/1094] ri: hush some warnings Closes https://github.com/scop/bash-completion/issues/343 --- completions/ri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/ri b/completions/ri index 8f331419560..7d1e7cf9774 100644 --- a/completions/ri +++ b/completions/ri @@ -23,7 +23,7 @@ _ri_get_methods() # older versions of ri didn't distinguish between class/module and # instance methods COMPREPLY+=( \ - "$(ruby -W0 $ri_path "${classes[@]}" | ruby -ane \ + "$(ruby -W0 $ri_path "${classes[@]}" 2>/dev/null | ruby -ane \ 'if /^-/.../^-/ and ! /^-/ and ! /^ +(class|module): / then \ print $_.split(/, |,$| +/).grep(/^[^\[]*$/).join("\n"); \ end' | sort -u)" ) From 6722aaa018ff426953496577db2daf3980443ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 16 Sep 2019 15:24:59 +0300 Subject: [PATCH 0275/1094] carton: new completion --- completions/Makefile.am | 1 + completions/carton | 78 +++++++++++++++++++++++++++++++++++++++++ test/t/Makefile.am | 1 + test/t/test_carton.py | 11 ++++++ 4 files changed, 91 insertions(+) create mode 100644 completions/carton create mode 100644 test/t/test_carton.py diff --git a/completions/Makefile.am b/completions/Makefile.am index 96f01b8324e..6bb8f67e8a1 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -37,6 +37,7 @@ bashcomp_DATA = 2to3 \ _cal \ cancel \ cardctl \ + carton \ ccache \ ccze \ cfagent \ diff --git a/completions/carton b/completions/carton new file mode 100644 index 00000000000..0cf6e2cac29 --- /dev/null +++ b/completions/carton @@ -0,0 +1,78 @@ +# carton(3pm) completion -*- shell-script -*- + +_carton_commands() +{ + local cmds=$("${1:-carton}" usage 2>&1 | \ + command sed -ne '/.*command.* is one of/{n;p;q}') + COMPREPLY+=( $(IFS="$IFS," compgen -W "$cmds" -- "$cur") ) +} + +_carton_command_help() +{ + local help=$(PERLDOC_PAGER=cat PERLDOC=-otext "${1:-carton}" -h $2 2>&1) + COMPREPLY+=( $(compgen -W '$help' -- "$cur") ) +} + +_carton() +{ + local cur prev words cword split + _init_completion -s || return + + local i command + for (( i=1; i < cword; i++ )); do + case ${words[i]} in + -*) ;; + *) command=${words[i]}; break ;; + esac + done + + if [[ -z "$command" ]]; then + _carton_commands "$1" + return + fi + + case $prev in + --version|-v) + return + ;; + --help|-h) + [[ -n "$command" ]] || _carton_commands "$1" + return + ;; + --cpanfile) + if [[ $command == install ]]; then + _filedir + return + fi + ;; + --path) + if [[ $command == install ]]; then + _filedir -d + return + fi + ;; + --without) + if [[ $command == install ]]; then + local phases="configure build test runtime develop" + COMPREPLY+=( $(compgen -W '$phases' -- "$cur") ) + return + fi + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + [[ $command == @(help|usage) ]] || COMPREPLY=(--help) + _carton_command_help "$1" $command + fi + + case $command in + show|update) + : # TODO modules completion + ;; + esac +} && +complete -F _carton carton + +# ex: filetype=sh diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 4f491024b42..0ce46b12614 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -54,6 +54,7 @@ EXTRA_DIST = \ test_cal.py \ test_cancel.py \ test_cardctl.py \ + test_carton.py \ test_cat.py \ test_cc.py \ test_ccache.py \ diff --git a/test/t/test_carton.py b/test/t/test_carton.py new file mode 100644 index 00000000000..1c2e45310b0 --- /dev/null +++ b/test/t/test_carton.py @@ -0,0 +1,11 @@ +import pytest + + +class TestCarton: + @pytest.mark.complete("carton ", require_cmd=True) + def test_commands(self, completion): + assert all(x in completion for x in "help install".split()) + + @pytest.mark.complete("carton install -", require_cmd=True) + def test_install_options(self, completion): + assert all(x in completion for x in "--cached --help".split()) From 8ef547aad3566cdf83e659bda1113a0de55a4738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 17 Sep 2019 11:17:25 +0300 Subject: [PATCH 0276/1094] CONTRIBUTING: disable e-mail bug gateway due to spam Refs #346, #347, #349, #350 (possible virus warning) --- CONTRIBUTING.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 44865ba7785..7f5a0962220 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -173,9 +173,7 @@ Also, please bare the following coding guidelines in mind: run-shellcheck. - File bugs, enhancement, and pull requests at GitHub, - https://github.com/scop/bash-completion or send them to the email - gateway address bash-completion@fire.fundersclub.com which will pipe - them to GitHub issues (with your email address visible). + https://github.com/scop/bash-completion. Sending them to the developers might work too, but is really strongly discouraged as bits are more likely to fall through the cracks that way compared to the tracker. Just use GitHub. If that's not an From 8f0595c6e2396e875aeffac03dbd8b9d5b3d10cf Mon Sep 17 00:00:00 2001 From: Tomasz N Date: Tue, 8 Oct 2019 20:06:34 +0200 Subject: [PATCH 0277/1094] apt-get: fix pkg version completion if it contains a colon (#351) --- completions/apt-get | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/completions/apt-get b/completions/apt-get index 3b00c56a1de..9c88fe60a42 100644 --- a/completions/apt-get +++ b/completions/apt-get @@ -2,8 +2,8 @@ _apt_get() { - local cur prev words cword - _init_completion -n = || return + local cur prev words cword package + _init_completion -n ':=' || return local special i for (( i=0; i < ${#words[@]}-1; i++ )); do @@ -34,11 +34,15 @@ _apt_get() _filedir deb return elif [[ $cur == *=* ]]; then - COMPREPLY=( $(compgen -W "$(\ - apt-cache --no-generate show "${cur%%=*}" 2>/dev/null | - command sed -ne \ - 's/^Version:[[:space:]]*\([^[:space:]]\)/\1/p')" \ - -- "${cur#*=}") ) + package="${cur%%=*}" + cur="${cur#*=}" + COMPREPLY=($(IFS=$'\n' compgen -W "$( \ + apt-cache --no-generate madison "$package" 2>/dev/null | \ + while IFS=' |' read -r _ version _; do + echo "$version" + done )" \ + -- "$cur")) + __ltrim_colon_completions "$cur" return fi ;;& From d1756f06ef9bffb1b4621c4e63e47e181ddf1086 Mon Sep 17 00:00:00 2001 From: Grisha Levit Date: Thu, 10 Oct 2019 12:12:30 -0400 Subject: [PATCH 0278/1094] _variables: add TERM and LC_* completion (#353) --- bash_completion | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bash_completion b/bash_completion index 85580412144..84a62a3cc42 100644 --- a/bash_completion +++ b/bash_completion @@ -666,6 +666,15 @@ _variables() done return 0 ;; + TERM) + _terms + return 0 + ;; + LANG|LC_*) + COMPREPLY=( $(compgen -W '$(locale -a 2>/dev/null)' \ + -- "$cur" ) ) + return 0 + ;; esac fi return 1 From d8df8b5e2d56a5f2fa5930b7278cc2cc6b6c90b8 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 14 Oct 2019 20:43:33 +0200 Subject: [PATCH 0279/1094] cppcheck: Add new standards to --std option. (#356) --- completions/cppcheck | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/completions/cppcheck b/completions/cppcheck index 2e487f812cd..ef1e1ecb7cc 100644 --- a/completions/cppcheck +++ b/completions/cppcheck @@ -51,8 +51,8 @@ _cppcheck() return ;; --std) - COMPREPLY=( $(compgen -W 'c89 c99 c11 c++03 c++11 posix' \ - -- "$cur") ) + COMPREPLY=( $(compgen -W 'c89 c99 c11 c++03 c++11 c++14 c++17 + c++20 posix' -- "$cur") ) return ;; --platform) From 73e8faf4d987aef26d52c2354d4336596a7cee92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 17 Oct 2019 22:57:35 +0300 Subject: [PATCH 0280/1094] test: mark dcop and mr testcases requiring the cmd as such --- test/t/test_dcop.py | 11 ++--------- test/t/test_mr.py | 24 ++++++++++++++++++------ 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/test/t/test_dcop.py b/test/t/test_dcop.py index 669725e2879..5c3c04d0423 100644 --- a/test/t/test_dcop.py +++ b/test/t/test_dcop.py @@ -1,14 +1,7 @@ -import subprocess - import pytest class TestDcop: - @pytest.mark.complete("dcop ") + @pytest.mark.complete("dcop ", require_cmd=True) def test_1(self, completion): - try: - subprocess.check_call("dcop &>/dev/null", shell=True) - except BaseException: - assert not completion - else: - assert completion + assert completion diff --git a/test/t/test_mr.py b/test/t/test_mr.py index 2f9a504b037..768e1b3590f 100644 --- a/test/t/test_mr.py +++ b/test/t/test_mr.py @@ -9,7 +9,9 @@ def test_1(self, completion): # man -h tests below: Some mr versions require man to be around in order # to provide useful output. - @pytest.mark.complete("mr --", xfail="! man -h &>/dev/null") + @pytest.mark.complete( + "mr --", require_cmd=True, xfail="! man -h &>/dev/null" + ) def test_2(self, completion): assert completion @@ -20,24 +22,34 @@ def test_3(self, completion): assert completion == "shared/default/foo.d/foo" @pytest.mark.complete( - "mr bootstrap shared/default/", xfail="! man -h &>/dev/null" + "mr bootstrap shared/default/", + require_cmd=True, + xfail="! man -h &>/dev/null", ) def test_4(self, completion): assert completion == ["bar", "bar bar.d/", "foo", "foo.d/"] @pytest.mark.xfail # "clean" doesn't exist before mr 1.20141023 - @pytest.mark.complete("mr clean -", xfail="! man -h &>/dev/null") + @pytest.mark.complete( + "mr clean -", require_cmd=True, xfail="! man -h &>/dev/null" + ) def test_5(self, completion): assert completion == "-f" - @pytest.mark.complete("mr commit -", xfail="! man -h &>/dev/null") + @pytest.mark.complete( + "mr commit -", require_cmd=True, xfail="! man -h &>/dev/null" + ) def test_6(self, completion): assert completion == "-m" - @pytest.mark.complete("mr status ", xfail="! man -h &>/dev/null") + @pytest.mark.complete( + "mr status ", require_cmd=True, xfail="! man -h &>/dev/null" + ) def test_7(self, completion): assert not completion - @pytest.mark.complete("mr run ", xfail="! man -h &>/dev/null") + @pytest.mark.complete( + "mr run ", require_cmd=True, xfail="! man -h &>/dev/null" + ) def test_8(self, completion): assert completion From 356635225de0fb1efecb6e17bb1284fb2c6c5a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 17 Oct 2019 23:10:36 +0300 Subject: [PATCH 0281/1094] makepkg: fix option completion --- completions/makepkg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/completions/makepkg b/completions/makepkg index 98edda8f3ca..71d4f76dd8a 100644 --- a/completions/makepkg +++ b/completions/makepkg @@ -15,7 +15,8 @@ _makepkg_slackware() if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W \ - '$1 | command sed -e "s/^options://" | _parse_help -' -- "$cur") ) + '$($1 | command sed -e "s/^options://" | _parse_help -)' \ + -- "$cur") ) return fi From 0dd1e652c6045a51a4d5c6eb2952248d43fdc88e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 17 Oct 2019 23:19:25 +0300 Subject: [PATCH 0282/1094] .gitignore: mypy cache --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d207dbc0612..d58464b7a26 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ __pycache__/ .pytest_cache/ .python-version pytestdebug.log +.mypy_cache/ helpers/perl.bak helpers/perl.tdy helpers/perl.ERR From 860766ea4f44ebb98497eb8990634b705dd3d4f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 17 Oct 2019 23:19:38 +0300 Subject: [PATCH 0283/1094] test: add minimal mypy config --- test/setup.cfg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/setup.cfg b/test/setup.cfg index cef707ce83b..ef9c755e29f 100644 --- a/test/setup.cfg +++ b/test/setup.cfg @@ -3,3 +3,7 @@ minversion = 3.6 markers = bashcomp complete + +[mypy] +python_version = 3.4 +ignore_missing_imports = true From af136b50b222dcbfb9d881a8c33280b5051dc266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 17 Oct 2019 23:19:56 +0300 Subject: [PATCH 0284/1094] test: python typing fixes --- test/t/conftest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/t/conftest.py b/test/t/conftest.py index ad9f629d81d..20942e87eed 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -82,7 +82,7 @@ def bash(request) -> pexpect.spawn: logfile = None if os.environ.get("BASHCOMP_TEST_LOGFILE"): - logfile = open(os.environ.get("BASHCOMP_TEST_LOGFILE"), "w") + logfile = open(os.environ["BASHCOMP_TEST_LOGFILE"], "w") testdir = os.path.abspath( os.path.join(os.path.dirname(__file__), os.pardir) ) @@ -122,7 +122,7 @@ def bash(request) -> pexpect.spawn: assert_bash_exec(bash, "source '%s/../bash_completion'" % testdir) # Use command name from marker if set, or grab from test filename - cmd = None + cmd = None # type: Optional[str] cmd_found = False marker = request.node.get_closest_marker("bashcomp") if marker: @@ -478,7 +478,7 @@ def in_container() -> bool: shell=True, ).strip() except subprocess.CalledProcessError: - container = None + container = b"" if container and container != b"none": return True if os.path.exists("/.dockerenv"): From 20cacd2ebabfd1cb9178f0bccb2faf859e5469bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 17 Oct 2019 23:24:21 +0300 Subject: [PATCH 0285/1094] test: fix cpio users test in presence of usernames with whitespace --- test/t/test_cpio.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/t/test_cpio.py b/test/t/test_cpio.py index 69bb5702961..1b9e37dfdd8 100644 --- a/test/t/test_cpio.py +++ b/test/t/test_cpio.py @@ -11,6 +11,8 @@ def test_1(self, completion): @pytest.mark.complete("cpio -R ") def test_2(self, bash, completion): users = sorted( - assert_bash_exec(bash, "compgen -A user", want_output=True).split() + assert_bash_exec(bash, "compgen -A user", want_output=True) + .strip() + .splitlines() ) - assert completion == users + assert list(completion) == users From 000fa10469d4704803ed48563cf656449d77232a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 20 Oct 2019 12:08:02 +0300 Subject: [PATCH 0286/1094] shellcheck: add some option arg (non)completions --- completions/shellcheck | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/completions/shellcheck b/completions/shellcheck index 197c1811fa4..4a40c8f9e55 100644 --- a/completions/shellcheck +++ b/completions/shellcheck @@ -16,7 +16,7 @@ _shellcheck() --version|-!(-*)V*) return ;; - --exclude|-!(-*)e) + --exclude|--include|-!(-*)[ei]) return ;; --format|-!(-*)f) @@ -34,6 +34,18 @@ _shellcheck() _shellcheck_optarg "$1" --shell return ;; + --enable|-!(-*)o) + COMPREPLY=( $(compgen -W 'all' -- "$cur") ) # TODO others? + return + ;; + --source-path|-!(-*)P) + _filedir -d + COMPREPLY+=( $(compgen -W 'SCRIPTDIR' -- "$cur") ) + return + ;; + --wiki-link-count|-!(-*)W) + return + ;; esac $split && return From 0f3922be10b83361505fffa76d7bb2931415d25e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 20 Oct 2019 13:06:38 +0300 Subject: [PATCH 0287/1094] test: shellcheck config cleanups --- .shellcheckrc | 4 +++- .travis.yml | 4 ++-- bash_completion.sh.in | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.shellcheckrc b/.shellcheckrc index bb16bddab06..9bec7145d27 100644 --- a/.shellcheckrc +++ b/.shellcheckrc @@ -1,2 +1,4 @@ shell=bash -disable=SC1090,SC2039,SC2128,SC2155,SC2166 +disable=SC1090 # not really fixable usually (ever?) +disable=SC2128 # intentional style choice +disable=SC2155 # TODO diff --git a/.travis.yml b/.travis.yml index d6a5e81c977..9e793d9b072 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,8 +24,8 @@ script: ${NETWORK:+--network $NETWORK} -t bash-completion:$DIST - if test $DIST = tools; then - test/run-shellcheck -f gcc bash_completion completions/!(Makefile*); - test/run-shellcheck -f gcc -s sh bash_completion.sh.in; + test/run-shellcheck -f gcc + bash_completion bash_completion.sh.in completions/!(Makefile*); fi before_deploy: diff --git a/bash_completion.sh.in b/bash_completion.sh.in index a28e1a62e21..a931f96aacb 100644 --- a/bash_completion.sh.in +++ b/bash_completion.sh.in @@ -1,3 +1,4 @@ +# shellcheck shell=sh disable=SC1091,SC2039,SC2166 # Check for interactive bash and that we haven't already been sourced. if [ "x${BASH_VERSION-}" != x -a "x${PS1-}" != x -a "x${BASH_COMPLETION_VERSINFO-}" = x ]; then From ded48bb7ab53c1836c6ec436cb304b6823a180f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 20 Oct 2019 13:07:53 +0300 Subject: [PATCH 0288/1094] bash_completion.sh: shellcheck SC2086 fixes --- bash_completion.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bash_completion.sh.in b/bash_completion.sh.in index a931f96aacb..1188211a9df 100644 --- a/bash_completion.sh.in +++ b/bash_completion.sh.in @@ -3,8 +3,8 @@ if [ "x${BASH_VERSION-}" != x -a "x${PS1-}" != x -a "x${BASH_COMPLETION_VERSINFO-}" = x ]; then # Check for recent enough version of bash. - if [ ${BASH_VERSINFO[0]} -gt 4 ] || \ - [ ${BASH_VERSINFO[0]} -eq 4 -a ${BASH_VERSINFO[1]} -ge 1 ]; then + if [ "${BASH_VERSINFO[0]}" -gt 4 ] || \ + [ "${BASH_VERSINFO[0]}" -eq 4 -a "${BASH_VERSINFO[1]}" -ge 1 ]; then [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && \ . "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" if shopt -q progcomp && [ -r @pkgdatadir@/bash_completion ]; then From 2701887f4862b29dafa0d9ecef329a766713a3fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 20 Oct 2019 13:10:19 +0300 Subject: [PATCH 0289/1094] _filedir: remove unused $x --- bash_completion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_completion b/bash_completion index 84a62a3cc42..f7030b08dbe 100644 --- a/bash_completion +++ b/bash_completion @@ -557,7 +557,7 @@ _filedir() _tilde "$cur" || return local -a toks - local x reset + local reset reset=$(shopt -po noglob); set -o noglob toks=( $(compgen -d -- "$cur") ) From da99bc55954e9f60b9c3a9e9071ff6301d7015cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 20 Oct 2019 19:26:58 +0300 Subject: [PATCH 0290/1094] _filedir: avoid duplicate dirs internally, and a compgen -d call for files Not having duplicates in completions here is useful so we can sometimes check if a _filedir resulted in only one completion. The previous implementation resulted in duplicate dirs internally. --- bash_completion | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/bash_completion b/bash_completion index f7030b08dbe..ce45b4bb087 100644 --- a/bash_completion +++ b/bash_completion @@ -559,25 +559,34 @@ _filedir() local -a toks local reset - reset=$(shopt -po noglob); set -o noglob - toks=( $(compgen -d -- "$cur") ) - IFS=' '; $reset; IFS=$'\n' - - if [[ "$1" != -d ]]; then + if [[ "$1" == -d ]]; then + reset=$(shopt -po noglob); set -o noglob + toks=( $(compgen -d -- "$cur") ) + IFS=' '; $reset; IFS=$'\n' + else local quoted _quote_readline_by_ref "$cur" quoted # Munge xspec to contain uppercase version too # http://thread.gmane.org/gmane.comp.shells.bash.bugs/15294/focus=15306 - local xspec=${1:+"!*.@($1|${1^^})"} + local xspec=${1:+"!*.@($1|${1^^})"} plusdirs=() + + # Use plusdirs to get dir completions if we have a xspec; if we don't, + # there's no need, dirs come along with other completions. Don't use + # plusdirs quite yet if fallback is in use though, in order to not ruin + # the fallback condition with the "plus" dirs. + local opts=( -f -X "$xspec" ) + [[ $xspec ]] && plusdirs=(-o plusdirs) + [[ ${COMP_FILEDIR_FALLBACK-} ]] || opts+=( "${plusdirs[@]}" ) + reset=$(shopt -po noglob); set -o noglob - toks+=( $(compgen -f -X "$xspec" -- $quoted) ) + toks+=( $(compgen "${opts[@]}" -- $quoted) ) IFS=' '; $reset; IFS=$'\n' # Try without filter if it failed to produce anything and configured to [[ -n ${COMP_FILEDIR_FALLBACK:-} && -n "$1" && ${#toks[@]} -lt 1 ]] && { reset=$(shopt -po noglob); set -o noglob - toks+=( $(compgen -f -- $quoted) ) + toks+=( $(compgen -f "${plusdirs[@]}" -- $quoted) ) IFS=' '; $reset; IFS=$'\n' } fi From aa3652b6b7de9aabfafa79f52c70825f23f967ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 20 Oct 2019 19:31:00 +0300 Subject: [PATCH 0291/1094] curl: make @filename completion do the right thing with dirs --- completions/curl | 4 ++++ test/t/test_curl.py | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/completions/curl b/completions/curl index 2fe06272dfb..1064491d609 100644 --- a/completions/curl +++ b/completions/curl @@ -43,6 +43,10 @@ _curl() if [[ $cur == \@* ]]; then cur=${cur:1} _filedir + if [[ ${#COMPREPLY[@]} -eq 1 && -d "${COMPREPLY[0]}" ]]; then + COMPREPLY[0]+=/ + compopt -o nospace + fi COMPREPLY=( "${COMPREPLY[@]/#/@}" ) fi return diff --git a/test/t/test_curl.py b/test/t/test_curl.py index 974688fae52..ebccca955b4 100644 --- a/test/t/test_curl.py +++ b/test/t/test_curl.py @@ -17,3 +17,12 @@ def test_3(self, completion): @pytest.mark.complete("curl --o f") def test_4(self, completion): assert not completion + + @pytest.mark.complete("curl --data @", cwd="shared/default/foo.d") + def test_data_atfile(self, completion): + assert completion == "@foo" + + @pytest.mark.complete("curl --data @foo.", cwd="shared/default") + def test_data_atfile_dir(self, completion): + assert completion == "@foo.d/" + assert not completion.endswith(" ") From 32369a009d14f129e000cba4a0a2d1b8fc65ccea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo=20Mart=C3=ADnez?= Date: Fri, 8 Nov 2019 18:17:22 +0200 Subject: [PATCH 0292/1094] pkg-config: generate Name from autotools PACKAGE Refs #344 --- bash-completion.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash-completion.pc.in b/bash-completion.pc.in index ea03fd75453..18ffd3d6038 100644 --- a/bash-completion.pc.in +++ b/bash-completion.pc.in @@ -3,7 +3,7 @@ compatdir=@compatdir@ completionsdir=@pkgdatadir@/completions helpersdir=@pkgdatadir@/helpers -Name: bash-completion +Name: @PACKAGE@ Description: programmable completion for the bash shell URL: https://github.com/scop/bash-completion Version: @VERSION@ From 31b5cbc8016b181675e10dd068c92008782d4196 Mon Sep 17 00:00:00 2001 From: pcc Date: Fri, 8 Nov 2019 09:01:15 -0800 Subject: [PATCH 0293/1094] unzip, zipinfo: complete *.aab (#340) .aab is the extension used for Android App Bundles, which are zip files. https://developer.android.com/guide/app-bundle --- bash_completion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_completion b/bash_completion index ce45b4bb087..c692ecb97f1 100644 --- a/bash_completion +++ b/bash_completion @@ -2010,7 +2010,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|[egjswx]ar|exe|pk3|wsz|zargo|xpi|s[tx][cdiw]|sx[gm]|o[dt][tspgfc]|od[bm]|oxt|epub|apk|ipa|do[ct][xm]|p[op]t[mx]|xl[st][xm]|pyz|whl)' unzip zipinfo +_install_xspec '!*.@(zip|[egjswx]ar|exe|pk3|wsz|zargo|xpi|s[tx][cdiw]|sx[gm]|o[dt][tspgfc]|od[bm]|oxt|epub|apk|aab|ipa|do[ct][xm]|p[op]t[mx]|xl[st][xm]|pyz|whl)' 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 From 8c5302581ad20954cfa164dcae26f1ed6277dd90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo=20Mart=C3=ADnez?= Date: Thu, 29 Aug 2019 10:40:35 +0200 Subject: [PATCH 0294/1094] pkg-config: Relative paths Define our completion and helper dirs using the standard data and sysconf dirs. Enables 3rd party package staged installs by overriding these two dirs, in addition to the already existing mechanisms. --- Makefile.am | 6 ++++-- bash-completion-config.cmake.in | 7 ++++--- bash-completion.pc.in | 9 ++++++--- configure.ac | 1 - 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Makefile.am b/Makefile.am index c54eb8ed44f..e7bae0989e4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,6 +3,7 @@ SUBDIRS = completions doc helpers test pkgdata_DATA = bash_completion # Empty, but here just to get the compat dir created with install +compatdir = $(sysconfdir)/bash_completion.d compat_DATA = profiledir = $(sysconfdir)/profile.d @@ -18,8 +19,9 @@ cmakeconfig_DATA = bash-completion-config.cmake \ %: %.in Makefile $(SED) \ -e 's|@prefix[@]|$(prefix)|' \ - -e 's|@compatdir[@]|$(compatdir)|' \ - -e 's|@pkgdatadir[@]|$(pkgdatadir)|' \ + -e 's|@datadir[@]|$(datadir)|' \ + -e 's|@sysconfdir[@]|$(sysconfdir)|' \ + -e 's|@PACKAGE[@]|$(PACKAGE)|' \ -e 's|@VERSION[@]|$(VERSION)|' \ <$(srcdir)/$@.in >$@ diff --git a/bash-completion-config.cmake.in b/bash-completion-config.cmake.in index d907b76cebe..2b7de6c9759 100644 --- a/bash-completion-config.cmake.in +++ b/bash-completion-config.cmake.in @@ -4,8 +4,9 @@ set (BASH_COMPLETION_VERSION "@VERSION@") set (BASH_COMPLETION_PREFIX "@prefix@") -set (BASH_COMPLETION_COMPATDIR "@compatdir@") -set (BASH_COMPLETION_COMPLETIONSDIR "@pkgdatadir@/completions") -set (BASH_COMPLETION_HELPERSDIR "@pkgdatadir@/helpers") + +set (BASH_COMPLETION_COMPATDIR "@sysconfdir@/bash_completion.d") +set (BASH_COMPLETION_COMPLETIONSDIR "@datadir@/@PACKAGE@/completions") +set (BASH_COMPLETION_HELPERSDIR "@datadir@/@PACKAGE@/helpers") set (BASH_COMPLETION_FOUND "TRUE") diff --git a/bash-completion.pc.in b/bash-completion.pc.in index 18ffd3d6038..f0a3572c261 100644 --- a/bash-completion.pc.in +++ b/bash-completion.pc.in @@ -1,7 +1,10 @@ prefix=@prefix@ -compatdir=@compatdir@ -completionsdir=@pkgdatadir@/completions -helpersdir=@pkgdatadir@/helpers +datadir=@datadir@ +sysconfdir=@sysconfdir@ + +compatdir=${sysconfdir}/bash_completion.d +completionsdir=${datadir}/@PACKAGE@/completions +helpersdir=${datadir}/@PACKAGE@/helpers Name: @PACKAGE@ Description: programmable completion for the bash shell diff --git a/configure.ac b/configure.ac index 3c4640a257c..565041ce2b5 100644 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,6 @@ AC_ARG_WITH([pytest],[ --with-pytest=executable],[PYTEST="$withval"]) if test -z "$PYTEST"; then AC_CHECK_PROGS([PYTEST],[pytest pytest-3],[pytest]) fi -AC_SUBST(compatdir, $sysconfdir/bash_completion.d) AC_CONFIG_FILES([ Makefile completions/Makefile From 0cc34e8de658bd11fa7f728eb9852c7e29d8d6d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1igo=20Mart=C3=ADnez?= Date: Sat, 9 Nov 2019 22:32:25 +0100 Subject: [PATCH 0295/1094] autotools: Replace pkgdatadir with datadir `pkgdatadir` has been replaced in some cases when adding support for variable redefinition in `pkg-config` files. These changes removes all use of `pkgdatadir` to add consistency. --- Makefile.am | 4 ++-- bash_completion.sh.in | 4 ++-- completions/Makefile.am | 2 +- helpers/Makefile.am | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index e7bae0989e4..26f3c7c22d9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,6 +36,6 @@ EXTRA_DIST = CHANGES $(pkgdata_DATA) bash_completion.sh.in .dir-locals.el \ install-data-hook: tmpfile=`mktemp $${TMPDIR:-/tmp}/bash_completion.XXXXXX` && \ $(SED) -e 's|-/etc/bash_completion\.d|-$(compatdir)|' \ - $(DESTDIR)$(pkgdatadir)/bash_completion >$$tmpfile && \ - cat $$tmpfile >$(DESTDIR)$(pkgdatadir)/bash_completion && \ + $(DESTDIR)$(datadir)/$(PACKAGE)/bash_completion >$$tmpfile && \ + cat $$tmpfile >$(DESTDIR)$(datadir)/$(PACKAGE)/bash_completion && \ rm $$tmpfile diff --git a/bash_completion.sh.in b/bash_completion.sh.in index 1188211a9df..d23198fd607 100644 --- a/bash_completion.sh.in +++ b/bash_completion.sh.in @@ -7,9 +7,9 @@ if [ "x${BASH_VERSION-}" != x -a "x${PS1-}" != x -a "x${BASH_COMPLETION_VERSINFO [ "${BASH_VERSINFO[0]}" -eq 4 -a "${BASH_VERSINFO[1]}" -ge 1 ]; then [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && \ . "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" - if shopt -q progcomp && [ -r @pkgdatadir@/bash_completion ]; then + if shopt -q progcomp && [ -r @datadir@/@PACKAGE@/bash_completion ]; then # Source completion code. - . @pkgdatadir@/bash_completion + . @datadir@/@PACKAGE@/bash_completion fi fi diff --git a/completions/Makefile.am b/completions/Makefile.am index 6bb8f67e8a1..8f276d664dc 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -1,4 +1,4 @@ -bashcompdir = $(pkgdatadir)/completions +bashcompdir = $(datadir)/$(PACKAGE)/completions bashcomp_DATA = 2to3 \ 7z \ a2x \ diff --git a/helpers/Makefile.am b/helpers/Makefile.am index aef19b0ca14..2a0a18d7469 100644 --- a/helpers/Makefile.am +++ b/helpers/Makefile.am @@ -1,4 +1,4 @@ -helpersdir = $(pkgdatadir)/helpers +helpersdir = $(datadir)/$(PACKAGE)/helpers helpers_DATA = perl python EXTRA_DIST = $(helpers_DATA) From d1ae094807532e42b71c18e648b182c5c44a0daf Mon Sep 17 00:00:00 2001 From: versat Date: Tue, 22 Oct 2019 15:12:19 +0200 Subject: [PATCH 0296/1094] cppcheck: Remove deprecated option 'posix' for '--std=' '--std=posix' is deprecated and will be removed. See this Cppcheck commit: https://github.com/danmar/cppcheck/commit/cb06aebdab894c2ca767869889df8e1175aeb379 --- completions/cppcheck | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/cppcheck b/completions/cppcheck index ef1e1ecb7cc..ebc3ba3b6b6 100644 --- a/completions/cppcheck +++ b/completions/cppcheck @@ -52,7 +52,7 @@ _cppcheck() ;; --std) COMPREPLY=( $(compgen -W 'c89 c99 c11 c++03 c++11 c++14 c++17 - c++20 posix' -- "$cur") ) + c++20' -- "$cur") ) return ;; --platform) From 8eba6d0c6b88dacd80762ada3a3bc5fe14673fb2 Mon Sep 17 00:00:00 2001 From: "Gabriel F. T. Gomes" Date: Sat, 1 Jun 2019 16:07:23 -0300 Subject: [PATCH 0297/1094] perl: fix completion with space between option and argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Most perl options do not allow a space between the switch and the argument, however, bash-completion incorrectly suggests completions for `-d', `-M` (or `-m'), and `-V', as reported in Debian bug #614775 [1], as well as for `-x', which was not mentioned in the bug report. This patch fixes the incorrect completions for these options, by falling back to regular _filedir completion when a space is present. On the other hand, and unlike all other perl options, a space between the `-e', `-E', and `-I' options and their arguments, e.g. `perl -e "exit 2"', *is* valid syntax. However, the argument for `-e' and `-E' is neither a filename nor a directory, but one line of perl program. So, in order to keep the old behavior, which was correct, this patch adds extra code that skips _filedir completion for `-e' and `-E' with a space. Finally, the test case for `-x' requires changes, because it expects that `-x' with a space should complete only with directories. That is misleading, because it might suggest that the directory would be treated as the argument to the `-x' option, when it will not, as can be verified with the following test: $ cat test.pl Some regular text with an embedded script #!perl use Cwd; my $dir = getcwd; print "$dir\n"; __END__ More text messages, not code. By executing the script with the `-x[dir]' option, the non-code part of the file will be ignored, i.e. only the embedded script will be executed. It will also be executed under [dir], if it is provided: $ perl -xperl/ test.pl /tmp/perl However, if a space is present between `-x' and [dir], the script fails, because the perl interpreter thinks that [dir] is a script, not the argument to `-x': $ perl -x perl/ test.pl Can't open perl script "perl/": Is a directory The rationale for the changes is based on `perl --help', which explains that there are no spaces between options and arguments (see note below for `-I'): $ perl --help | grep "\-d\|\-V\|-I\|-x\|-\[mM\]" -d[:debugger] run program under debugger -Idirectory specify @INC/#include directory (several -I's allowed) -[mM][-]module execute "use/no module..." before executing program -V[:variable] print configuration summary (or a single Config.pm variable) -x[directory] ignore text before #!perl line (optionally cd to directory) When a space is required, `perl --help' makes it explicit: $ perl --help | grep "\-e\|-E" -e program one line of program (several -e's allowed, omit programfile) -E program like -e, but enables all optional features As an exception to this rule, `-I' does accept a space. ¬¬ [1] https://bugs.debian.org/614775 --- completions/perl | 19 +++++++++++++++++-- test/t/test_perl.py | 4 ++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/completions/perl b/completions/perl index 98ddb9eb664..325c58d9d91 100644 --- a/completions/perl +++ b/completions/perl @@ -27,7 +27,6 @@ _perl() optPrefix=-P$prev optSuffix=-S/ prefix=$prev - fi case $prev in -*[DeEiFl]) @@ -68,7 +67,23 @@ _perl() ;; esac - if [[ "$cur" == -* ]]; then + # Unlike other perl options, having a space between the `-e' and + # `-E' options and their arguments, e.g. `perl -e "exit 2"', is + # valid syntax. However, the argument is neither a filename nor a + # directory, but one line of perl program, thus do not suggest + # _filedir completion. + elif [[ "$prev" == -e ]] || [[ "$prev" == -E ]]; then + return + + # Likewise, `-I' also accepts a space between option and argument + # and it takes a directory as value. + elif [[ "$prev" == -I ]]; then + local IFS=$'\n' + compopt -o filenames + COMPREPLY=( $(compgen -d $optPrefix $optSuffix -- "$cur") ) + return + + elif [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '-C -s -T -u -U -W -X -h -v -V -c -w -d -D -p -n -a -F -l -0 -I -m -M -P -S -x -i -e' -- "$cur") ) else diff --git a/test/t/test_perl.py b/test/t/test_perl.py index 5442024c509..1592efd00b9 100644 --- a/test/t/test_perl.py +++ b/test/t/test_perl.py @@ -67,8 +67,8 @@ def test_14(self, completion): @pytest.mark.complete("perl -x shared/default/b") def test_15(self, completion): - """-x with space should complete dirs.""" - assert completion == ["shared/default/bar bar.d/"] + """-x with space should complete files+dirs.""" + assert completion == ["bar", "bar bar.d/"] @pytest.mark.complete( "perl -d:", env=dict(PERL5LIB="$PWD/perl"), require_cmd=True From 1360ba95149d0880486d1abfdcfcf6f77355c44d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 13 Nov 2019 21:34:46 +0200 Subject: [PATCH 0298/1094] perl: indentation fixes --- completions/perl | 72 ++++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/completions/perl b/completions/perl index 325c58d9d91..bf117970587 100644 --- a/completions/perl +++ b/completions/perl @@ -28,44 +28,44 @@ _perl() optSuffix=-S/ prefix=$prev - case $prev in - -*[DeEiFl]) - return - ;; - -*[Ix]) - local IFS=$'\n' - compopt -o filenames - COMPREPLY=( $(compgen -d $optPrefix $optSuffix -- "$cur") ) - return - ;; - -*[mM]) - temp="${cur#-}" - prefix+="${cur%$temp}" - cur="$temp" - _perl_helper modules $1 - return - ;; - -*V) - if [[ $cur == :* ]]; then - temp="${cur##+(:)}" - prefix+="${cur%$temp}" + case $prev in + -*[DeEiFl]) + return + ;; + -*[Ix]) local IFS=$'\n' - COMPREPLY=( $(compgen -P "$prefix" -W \ - '$($1 -MConfig -e "print join \"\\n\", - keys %Config::Config" 2>/dev/null)' -- "$temp") ) - __ltrim_colon_completions "$prefix$temp" - fi - return - ;; - -*d|-*dt) - if [[ $cur == :* ]]; then - temp="${cur#:}" - prefix="$prefix${cur%$temp}" - cur="Devel::$temp" + compopt -o filenames + COMPREPLY=( $(compgen -d $optPrefix $optSuffix -- "$cur") ) + return + ;; + -*[mM]) + temp="${cur#-}" + prefix+="${cur%$temp}" + cur="$temp" _perl_helper modules $1 - fi - ;; - esac + return + ;; + -*V) + if [[ $cur == :* ]]; then + temp="${cur##+(:)}" + prefix+="${cur%$temp}" + local IFS=$'\n' + COMPREPLY=( $(compgen -P "$prefix" -W \ + '$($1 -MConfig -e "print join \"\\n\", + keys %Config::Config" 2>/dev/null)' -- "$temp") ) + __ltrim_colon_completions "$prefix$temp" + fi + return + ;; + -*d|-*dt) + if [[ $cur == :* ]]; then + temp="${cur#:}" + prefix="$prefix${cur%$temp}" + cur="Devel::$temp" + _perl_helper modules $1 + fi + ;; + esac # Unlike other perl options, having a space between the `-e' and # `-E' options and their arguments, e.g. `perl -e "exit 2"', is From 188ca8af208f35ebdc9895d5fd41d6cdd83d90a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 13 Nov 2019 21:37:04 +0200 Subject: [PATCH 0299/1094] test: add some trivial perl -E/-e cases --- test/t/test_perl.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/t/test_perl.py b/test/t/test_perl.py index 1592efd00b9..c8baa2f3ce8 100644 --- a/test/t/test_perl.py +++ b/test/t/test_perl.py @@ -81,3 +81,11 @@ def test_16(self, completion): ) def test_17(self, completion): assert "BashCompletion" in completion + + @pytest.mark.complete("perl -E ") + def test_dash_capital_e(self, completion): + assert not completion + + @pytest.mark.complete("perl -e") + def test_dash_e(self, completion): + assert not completion From 9cde25bfd74bdd1cb51e46a4b1958ebd444cdbd6 Mon Sep 17 00:00:00 2001 From: jerkey Date: Wed, 13 Nov 2019 15:43:10 -0800 Subject: [PATCH 0300/1094] screen: complete first arg with serial devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Modified-by: Ville Skyttä --- completions/screen | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/completions/screen b/completions/screen index 7783f5b3ae4..f60f0c21651 100644 --- a/completions/screen +++ b/completions/screen @@ -25,6 +25,13 @@ _screen() local cur prev words cword _init_completion || return + if [[ $cword -eq 1 && $cur == /dev* ]]; then + COMPREPLY=( $(compgen -W "$(shopt -s nullglob; printf '%s\n' \ + /dev/serial/by-id/* /dev/ttyUSB* /dev/ttyACM* 2>/dev/null)" \ + -- "$cur") ) + return + fi + if ((cword > 2)); then case ${words[cword-2]} in -*[dD]) From 7a8e408267ca21530d6d6de4ae92b9a0362e14fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 16 Nov 2019 17:52:59 +0200 Subject: [PATCH 0301/1094] screen: add //telnet completion --- completions/screen | 23 ++++++++++++++++++----- test/fixtures/shared/.ssh/known_hosts | 1 + test/t/test_screen.py | 16 ++++++++++++++++ 3 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 test/fixtures/shared/.ssh/known_hosts diff --git a/completions/screen b/completions/screen index f60f0c21651..25555dc0349 100644 --- a/completions/screen +++ b/completions/screen @@ -25,13 +25,26 @@ _screen() local cur prev words cword _init_completion || return - if [[ $cword -eq 1 && $cur == /dev* ]]; then - COMPREPLY=( $(compgen -W "$(shopt -s nullglob; printf '%s\n' \ - /dev/serial/by-id/* /dev/ttyUSB* /dev/ttyACM* 2>/dev/null)" \ - -- "$cur") ) - return + if ((cword == 1)); then + if [[ $cur == /dev* ]]; then + COMPREPLY=( $(compgen -W "$(shopt -s nullglob; printf '%s\n' \ + /dev/serial/by-id/* /dev/ttyUSB* /dev/ttyACM* 2>/dev/null)" \ + -- "$cur") ) + return + fi + if [[ $cur == //* ]]; then + COMPREPLY=( $(compgen -W '//telnet' -- "$cur") ) + return + fi fi + case ${words[1]} in + //telnet) + ((cword == 2)) && _known_hosts_real -- "$cur" + return + ;; + esac + if ((cword > 2)); then case ${words[cword-2]} in -*[dD]) diff --git a/test/fixtures/shared/.ssh/known_hosts b/test/fixtures/shared/.ssh/known_hosts new file mode 100644 index 00000000000..03d444ac6cc --- /dev/null +++ b/test/fixtures/shared/.ssh/known_hosts @@ -0,0 +1 @@ +bash-completion-canary-host.local diff --git a/test/t/test_screen.py b/test/t/test_screen.py index 39d92180841..2b5ad7ff407 100644 --- a/test/t/test_screen.py +++ b/test/t/test_screen.py @@ -22,3 +22,19 @@ def test_4(self, completion): @pytest.mark.complete("screen -T foo cat") def test_5(self, completion): assert completion + + @pytest.mark.complete("screen //") + def test_telnet(self, completion): + assert completion == "//telnet" + + @pytest.mark.complete("screen cat //") + def test_not_telnet(self, completion): + assert completion != "//telnet" + + @pytest.mark.complete("screen //telnet ", env=dict(HOME="$PWD/shared")) + def test_telnet_first_arg(self, completion): + assert "bash-completion-canary-host.local" in completion + + @pytest.mark.complete("screen //telnet foo ", env=dict(HOME="$PWD/shared")) + def test_telnet_other_args(self, completion): + assert not completion From fb46fed657d6b6575974b2fd5a9b6529ed2472b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 16 Nov 2019 18:02:33 +0200 Subject: [PATCH 0302/1094] screen: add serial device basic arg (non)completion --- completions/screen | 8 ++++++++ test/t/test_screen.py | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/completions/screen b/completions/screen index 25555dc0349..17642863d46 100644 --- a/completions/screen +++ b/completions/screen @@ -39,6 +39,14 @@ _screen() fi case ${words[1]} in + /dev*) + if ((cword == 2)); then + COMPREPLY=( $(compgen -W '110 300 600 1200 2400 4800 9600 \ + 14400 19200 38400 57600 115200 128000 256000' -- "$cur") ) + # TODO more, comma separated options + fi + return + ;; //telnet) ((cword == 2)) && _known_hosts_real -- "$cur" return diff --git a/test/t/test_screen.py b/test/t/test_screen.py index 2b5ad7ff407..d9254bda75f 100644 --- a/test/t/test_screen.py +++ b/test/t/test_screen.py @@ -38,3 +38,11 @@ def test_telnet_first_arg(self, completion): @pytest.mark.complete("screen //telnet foo ", env=dict(HOME="$PWD/shared")) def test_telnet_other_args(self, completion): assert not completion + + @pytest.mark.complete("screen /dev/ttyUSB0 ") + def test_serial_2nd_arg(self, completion): + assert "19200" in completion + + @pytest.mark.complete("screen /dev/ttyUSB0 9600 ") + def test_serial_3rdplus_arg(self, completion): + assert not completion From 845be116278719c2a4ab4d4edaee81f38cc17b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 25 Nov 2019 23:24:40 +0800 Subject: [PATCH 0303/1094] update-rc.d: remove dead code --- completions/update-rc.d | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/completions/update-rc.d b/completions/update-rc.d index 384b8dd4803..8a58f78a804 100644 --- a/completions/update-rc.d +++ b/completions/update-rc.d @@ -7,7 +7,7 @@ _update_rc_d() local cur prev words cword _init_completion || return - local sysvdir services options valid_options + local sysvdir services options [[ -d /etc/rc.d/init.d ]] && sysvdir=/etc/rc.d/init.d \ || sysvdir=/etc/init.d @@ -17,11 +17,6 @@ _update_rc_d() options=( -f -n ) if [[ $cword -eq 1 || "$prev" == -* ]]; then - valid_options=( $(\ - tr " " "\n" <<<"${words[*]} ${options[*]}" \ - | command sed -ne "/$(command sed "s/ /\\|/g" <<<"${options[*]}")/p" \ - | sort | uniq -u \ - ) ) COMPREPLY=( $(compgen -W '${options[@]} ${services[@]}' \ -X '$(tr " " "|" <<<${words[@]})' -- "$cur") ) elif [[ "$prev" == ?($(tr " " "|" <<<"${services[*]}")) ]]; then From 645cc41deab3dce6a38120be05ab02ee1ca6bc89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 25 Nov 2019 23:25:33 +0800 Subject: [PATCH 0304/1094] update-rc.d: indentation fix --- completions/update-rc.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/completions/update-rc.d b/completions/update-rc.d index 8a58f78a804..31cd820b8d9 100644 --- a/completions/update-rc.d +++ b/completions/update-rc.d @@ -17,8 +17,8 @@ _update_rc_d() options=( -f -n ) if [[ $cword -eq 1 || "$prev" == -* ]]; then - COMPREPLY=( $(compgen -W '${options[@]} ${services[@]}' \ - -X '$(tr " " "|" <<<${words[@]})' -- "$cur") ) + COMPREPLY=( $(compgen -W '${options[@]} ${services[@]}' \ + -X '$(tr " " "|" <<<${words[@]})' -- "$cur") ) elif [[ "$prev" == ?($(tr " " "|" <<<"${services[*]}")) ]]; then COMPREPLY=( $(compgen -W 'remove defaults start stop' -- "$cur") ) elif [[ "$prev" == defaults && "$cur" == [0-9] ]]; then From 44ce11334803f924f60e2e2c00c8b7d3dc81c33f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 25 Nov 2019 23:56:49 +0800 Subject: [PATCH 0305/1094] ssh, scp, sftp, ssh-copy-id, curl: improve identity file completion Default to ~/.ssh/id*, exclude *.pub if looking for private. --- completions/curl | 2 +- completions/ssh | 33 ++++++++++++++++++++++++++++++--- completions/ssh-copy-id | 2 +- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/completions/curl b/completions/curl index 1064491d609..d744e49a81e 100644 --- a/completions/curl +++ b/completions/curl @@ -76,7 +76,7 @@ _curl() return ;; --pubkey) - _filedir pub + _xfunc ssh _ssh_identityfile pub return ;; --stderr) diff --git a/completions/ssh b/completions/ssh index 3a1472a7af3..ecbd589643b 100644 --- a/completions/ssh +++ b/completions/ssh @@ -108,6 +108,9 @@ _ssh_suboption() canonicalizehostname) COMPREPLY=( $(compgen -W 'yes no always' -- "$cur") ) ;; + identityfile) + _ssh_identityfile + ;; *file|identityagent|include|controlpath|revokedhostkeys|xauthlocation) _filedir ;; @@ -220,6 +223,17 @@ _ssh_configfile() done } +# With $1 set, look for public key files, else private +_ssh_identityfile() +{ + [[ -z $cur && -d ~/.ssh ]] && cur=~/.ssh/id + _filedir + if (( ${#COMPREPLY[@]} > 0 )); then + COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' \ + -X "${1:+!}*.pub" -- "$cur") ) + fi +} + _ssh() { local cur prev words cword @@ -252,10 +266,14 @@ _ssh() -*[DeLpRW]) return ;; - -*[EFiS]) + -*[EFS]) _filedir return ;; + -*i) + _ssh_identityfile + return + ;; -*I) _filedir so return @@ -335,10 +353,14 @@ _sftp() -*[BDlPRs]) return ;; - -*[bFi]) + -*[bF]) _filedir return ;; + -*i) + _ssh_identityfile + return + ;; -*c) _ssh_ciphers return @@ -464,11 +486,16 @@ _scp() COMPREPLY=( "${COMPREPLY[@]/%/ }" ) return ;; - -*[Fi]) + -*F) _filedir compopt +o nospace return ;; + -*i) + _ssh_identityfile + compopt +o nospace + return + ;; -*J) _known_hosts_real -a -F "$configfile" -- "$cur" return diff --git a/completions/ssh-copy-id b/completions/ssh-copy-id index cb4cf9204d2..ebfc46e669c 100644 --- a/completions/ssh-copy-id +++ b/completions/ssh-copy-id @@ -9,7 +9,7 @@ _ssh_copy_id() case $prev in -i) - _filedir pub + _xfunc ssh _ssh_identityfile pub return ;; -p) From 2b8198919e4bc65efd8c68ade769e65f6df473f1 Mon Sep 17 00:00:00 2001 From: andreabravetti Date: Mon, 25 Nov 2019 17:12:11 +0100 Subject: [PATCH 0306/1094] unrar: complete on *.exe (#337) To support some common rar self-extracting (SFX) archives. --- completions/unrar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/unrar b/completions/unrar index 5381876fbf5..959a5c9c23e 100644 --- a/completions/unrar +++ b/completions/unrar @@ -13,7 +13,7 @@ _unrar() if [[ $cword -eq 1 ]]; then COMPREPLY=( $(compgen -W 'e l lb lt p t v vb vt x' -- "$cur") ) else - _filedir rar + _filedir '@(rar|exe)' fi fi From 87a9e9c47f028efb6178c69ced2df74b62a73639 Mon Sep 17 00:00:00 2001 From: marxin Date: Tue, 3 Dec 2019 19:05:28 +0100 Subject: [PATCH 0307/1094] gcc: support new --completion option (#222) --- completions/gcc | 82 +++++++++++++++++++++++++--------------------- test/t/test_gcc.py | 60 +++++++++++++++++++++++++++++++++ 2 files changed, 105 insertions(+), 37 deletions(-) diff --git a/completions/gcc b/completions/gcc index b72bf972eb9..86d0d095251 100644 --- a/completions/gcc +++ b/completions/gcc @@ -1,50 +1,58 @@ # gcc(1) completion -*- shell-script -*- -# -# The only unusual feature is that we don't parse "gcc --help -v" output -# directly, because that would include the options of all the other backend -# tools (linker, assembler, preprocessor, etc) without any indication that -# you cannot feed such options to the gcc driver directly. (For example, the -# linker takes a -z option, but you must type -Wl,-z for gcc.) Instead, we -# ask the driver ("g++") for the name of the compiler ("cc1"), and parse the -# --help output of the compiler. _gcc() { - local cur prev words cword + local cur prev prev2 words cword argument prefix prefix_length _init_completion || return - local cc backend + # Test that GCC is recent enough and if not fallback to + # parsing of --completion option. + if ! $1 --completion=" " 2>/dev/null; then + if [[ "$cur" == -* ]]; then + local cc=$($1 -print-prog-name=cc1 2>/dev/null) + [[ $cc ]] || return + COMPREPLY=($( compgen -W "$($cc --help 2>/dev/null | tr '\t' ' ' |\ + command sed -e '/^ *-/!d' -e 's/ *-\([^][ <>]*\).*/-\1/')" \ + -- "$cur" )) + [[ $COMPREPLY == *= ]] && compopt -o nospace + else + _filedir + fi + return + fi - case $1 in - gcj) - backend=jc1 - ;; - gpc) - backend=gpc1 - ;; - *77) - backend=f771 - ;; - *95) - backend=f951 - ;; - *) - backend=cc1 # (near-)universal backend - ;; - esac + # extract also for situations like: -fsanitize=add + if [[ $cword -gt 2 ]]; then + prev2="${COMP_WORDS[$cword - 2]}" + fi + # sample: -fsan if [[ "$cur" == -* ]]; then - cc=$($1 -print-prog-name=$backend 2>/dev/null) - [[ $cc ]] || return - # sink stderr: - # for C/C++/ObjectiveC it's useless - # for FORTRAN/Java it's an error - COMPREPLY=( $(compgen -W "$($cc --help 2>/dev/null | tr '\t' ' ' |\ - command sed -e '/^ *-/!d' -e 's/ *-\([^][ <>]*\).*/-\1/')" \ - -- "$cur") ) - [[ $COMPREPLY == *= ]] && compopt -o nospace - else + argument=$cur + prefix="" + # sample: -fsanitize= + elif [[ "$cur" == "=" && $prev == -* ]]; then + argument=$prev$cur + prefix=$prev$cur + # sample: -fsanitize=add + elif [[ "$prev" == "=" && $prev2 == -* ]]; then + argument=$prev2$prev$cur + prefix=$prev2$prev + # sample: --param lto- + elif [[ "$prev" == --param ]]; then + argument="$prev $cur" + prefix="$prev " + fi + + if [[ -z $argument ]]; then _filedir + else + # In situation like '-fsanitize=add' $cur is equal to last token. + # Thus we need to strip the beginning of suggested option. + prefix_length=$((${#prefix}+1)) + local flags=$($1 --completion="$argument" | cut -c $prefix_length-) + [[ "${flags}" == "=*" ]] && compopt -o nospace 2>/dev/null + COMPREPLY=( $(compgen -W "$flags" -- "") ) fi } && complete -F _gcc gcc{,-5,-6,-7,-8} g++{,-5,-6,-7,-8} g77 g95 \ diff --git a/test/t/test_gcc.py b/test/t/test_gcc.py index 67f4ee579d9..87f25797ec8 100644 --- a/test/t/test_gcc.py +++ b/test/t/test_gcc.py @@ -1,7 +1,67 @@ import pytest +from conftest import assert_bash_exec + class TestGcc: + @pytest.fixture(scope="class") + def gcc_with_completion(self, bash): + got = assert_bash_exec( + bash, "gcc --help=common || :", want_output=True + ) + if "--completion" not in got: + pytest.skip("GCC does not support --completion") + + @pytest.fixture(scope="class") + def gcc_x86(self, bash): + got = assert_bash_exec(bash, "gcc -v || :", want_output=True) + if "Target: x86" not in got: + pytest.skip("Not a x86 GCC") + @pytest.mark.complete("gcc ") def test_1(self, completion): assert completion + + @pytest.mark.complete("gcc -fsanitize=add") + def test_enum_value(self, completion, gcc_with_completion): + assert completion == "-fsanitize=address" + + @pytest.mark.complete("gcc -fsanitize=") + def test_enum_value_with_eq(self, completion, gcc_with_completion): + assert "address" in completion + + @pytest.mark.complete("gcc -fno-ipa-ic") + def test_negative_option(self, completion, gcc_with_completion): + assert "-fno-ipa-icf" in completion + + @pytest.mark.complete("gcc -fxyz-abc") + def test_no_completion(self, completion): + assert not completion + + @pytest.mark.complete("gcc --param ") + def test_param_with_space(self, completion, gcc_with_completion): + assert len(completion) > 50 + # starting with GCC 10.1 param end with = + assert ( + "lto-partitions" in completion or "lto-partitions=" in completion + ) + + @pytest.mark.complete("gcc --param=lto-max-p") + def test_param_with_eq(self, completion, gcc_with_completion): + # starting with GCC 10.1 param end with = + assert ( + completion == "--param=lto-max-partition" + or completion == "--param=lto-max-partition=" + ) + + @pytest.mark.complete("gcc -march=amd") + def test_march(self, completion, gcc_with_completion, gcc_x86): + assert completion == "-march=amdfam10" + + @pytest.mark.complete("gcc -march=") + def test_march_native(self, completion, gcc_with_completion): + assert "native" in completion + + @pytest.mark.complete("gcc -mtune=") + def test_mtune_generic(self, completion, gcc_with_completion): + assert "generic" in completion From 540e5d1a7ec9599f404ec88d35aa37bf25557755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 5 Dec 2019 17:01:59 +0200 Subject: [PATCH 0308/1094] test: bump black to >=19.10b0 --- test/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/requirements.txt b/test/requirements.txt index 3a3c3f4dd7b..70d77d02625 100644 --- a/test/requirements.txt +++ b/test/requirements.txt @@ -1,4 +1,4 @@ -black>=19.3b0;python_version>"3.6" +black>=19.10b0;python_version>"3.6" pexpect>=4 pytest>=3.6 pytest-xdist From 712632a009e7b05647eeb71dc835df4b19d6413b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Thu, 5 Dec 2019 17:05:37 +0200 Subject: [PATCH 0309/1094] Release 2.10 --- CHANGES | 200 ++++++++++++++++++++++++++++++++++++++++++++++++ bash_completion | 2 +- configure.ac | 2 +- 3 files changed, 202 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 60a81a1881c..cfd18c4a3d9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,203 @@ +bash-completion (2.10) + + [ Felix Lechner ] + * perltidy: associate *.t (#338) + + [ Gabriel F. T. Gomes ] + * perl: fix completion with space between option and argument + + [ Grisha Levit ] + * _variables: add TERM and LC_* completion (#353) + + [ Iñigo Martínez ] + * autotools: Replace pkgdatadir with datadir + * pkg-config: Relative paths + * pkg-config: generate Name from autotools PACKAGE + + [ Jakub Jelen ] + * ssh: option and argument completion updates (#332) + + [ Michał Górny ] + * test_arp: Skip if ARP tables are empty + * test_chromium_browser: Skip test_2 if 'chromium-browser --help' + fails + * test_rpm2tgz: Fix expected output + + [ Sebastian ] + * cppcheck: Add new standards to --std option. (#356) + + [ Tomasz N ] + * apt-get: fix pkg version completion if it contains a colon (#351) + + [ Ville Skyttä ] + * test: bump black to >=19.10b0 + * ssh, scp, sftp, ssh-copy-id, curl: improve identity file + completion + * update-rc.d: indentation fix + * update-rc.d: remove dead code + * screen: add serial device basic arg (non)completion + * screen: add //telnet completion + * test: add some trivial perl -E/-e cases + * perl: indentation fixes + * curl: make @filename completion do the right thing with dirs + * _filedir: avoid duplicate dirs internally, and a compgen -d call + for files + * _filedir: remove unused $x + * bash_completion.sh: shellcheck SC2086 fixes + * test: shellcheck config cleanups + * shellcheck: add some option arg (non)completions + * test: fix cpio users test in presence of usernames with whitespace + * test: python typing fixes + * test: add minimal mypy config + * .gitignore: mypy cache + * makepkg: fix option completion + * test: mark dcop and mr testcases requiring the cmd as such + * CONTRIBUTING: disable e-mail bug gateway due to spam + * carton: new completion + * op: direct command parsing stderr to /dev/null + * test: adjust java expectations based on whether jars can be listed + * valgrind: look tool names from lib/*-linux-gnu dirs too + * test: xfail locale-gen option completion if --help is not + available + * _sysvdirs: always return 0 + * java: don't assume jar is installed + * travis: test with Debian 10 + * wine: install for wine-development and wine-stable too + * travis: generate dist tarball on alpine + * dmypy: new completion + * test: add require_longopt xfail helper, use it + * test: mark more tests that parse command output as requiring + command + * sysctl: invoke completed sysctl instead of one from path to get + variables + * screen, smartctl, update-alternatives: _parse_help, drop hardcoded + option list + * lintian-info: _parse_help, add more option arg (non)completions + * gprof: _parse_usage, drop hardcoded option list + * test: fix retrieving command to test from request + * travis: pass NETWORK as env var, so we can actually use it + * test: xfail MAC address completion without networking + * test: ignore _makepkg_bootstrap in makepkg test env + * test: hush flake8-bugbear B010 + * test: don't sort expected completion lists under the hood + * test: add bunch of basic option parsing test cases + * test: always run tests which don't require tested command + * test: explodepkg and upgradepkg test fixes + * test: mark sbcl-mt xfail due to whitespace split issues + * _terms: search directly from various terminfo dirs + * _terms: combine and simplify somewhat + * pkg-get: fix $i leak + * pkgutil: fix $i leak + * test: portinstall/upgrade test case and setup fixes + * lvm pv*, vg*: parse help instead of hardcoding option list + * ipv6calc: parse help instead of hardcoding option list + * test: avoid some sed -r/-E runLint false positives + * test: use sh +* as ccache command test case + * java: make jar/zip listing work with unzip + * test: installpkg test fixes + * test: fix acroread fixture dir + * test: remove unnecessary returns after pytest.skip + * test: avoid gnome-mplayer core dump on Ubuntu 14 + * xvfb-run: new completion + * test: skip gssdp-discover --message-type when option not available + * test: expect failures for bc without --help useful with _longopt + * test: don't expect a .tox dir in fixture + * test: drop sourcing our no longer existing profile.d script + * tox: include -- in option completions + * tox: complete defaults after a -- + * gssdp-discover: new completion + * test: register our pytest markers to hush warnings from 4.5+ + * test: fix required pytest version + * ip: invoke the tool as $1 + * README: drop distro badges, link to Repology instead + * chromium-browser: add --proxy-server arg completion + * test: source our profile.d test env script in docker + * influx: new completion + * README: badge title tweaks + * tox: do simple parse on tox.ini if --listenvs* yields nothing + * test: add basic tox fixture + * man: fall back to _parse_usage for _parse_help + * test_wsimport: xfail options test on unparseable -help + * test: don't try to install black on Python < 3.6 + * pgrep: fix fallback to _parse_usage + * test: xfail unparseable mock and munin-node-configure --help cases + * test_pwdx: xfail more unparseable help cases + * build: make pytest executable configurable, look for pytest-3 too + * test: enforce minimum pytest version + * test: zopflipng flake8 fix + * test: xfail getent and pwdx option completions with unparseable + --help + * test: add more basic _parse_help use test cases + * test: add bunch of basic _parse_help use test cases + * .gitignore: add configure.lineno + * badblocks: fix $i leak + * postfix: option completion is expected to fail at the moment + * cal: try _parse_help before _parse_usage + * test: add bunch of basic _parse_usage use test cases + * chsh, pwck: try _parse_help before _parse_usage + * test: add basic autossh test + * test: convert more _filedir unit tests to pytest+pexpect + * test: flake8 fix + * test: convert bunch of _filedir unit tests to pytest+pexpect + * test: convert finger partial test case to pytest+pexpect + * README: add some badges, tweak existing + * test: port _variables unit tests to pytest+pexpect + * test: port compgen and quote tests to pytest+pexpect + * iconv, lz4, tipc, xsltproc: replace some seds with compgen -X + * test: disallow Alpine failure on Travis + * _pnames: adapt for busybox ps, rewrite in pure bash + * test: run our docker script in test containers by default + * test: use one Dockerfile for all dists + * test_ifup: accept short option completions too + * timeout: fallback to _parse_usage from _parse_help + * test_wget: test --s instead of --h + * test_lsusb: xfail with unparseable --help + * test: expect failures for various completions without useful + --help + * test: support xfail in our markers like skipif, use it a lot + * test: add Alpine Linux container, allow failures for now + * iconv: weed out ... from encoding completions + * test_iconv: add basic file completion test + * test_iconv: skip option completion if --help fails + * test_getconf: skip if -a doesn't output any POSIX_V* + * test_feh, test_makepkg: invoke grep as "command grep" + * test: generalize check whether we're being run in a container + * tar: simplify locating tarball from command line + * pkg_delete: don't limit to FreeBSD + * test: reformat test_chromium_browser.py source + * test: set up BASH_COMPLETION_COMPAT_DIR in bashrc (only) + * test: more thorough system location interference avoidance + * test: bashrc comment and whitespace tweaks + * build: makefile whitespace tweaks + * build: really reset return value before completions check + * build: simplify symlink setup + * tar: add missing bsdtar, gtar, and star symlinks + * README: use light gray badges for unknown versions + * README: link to cygwin package + + [ Wolf ] + * ri: hush some warnings + + [ andreabravetti ] + * unrar: complete on *.exe (#337) + + [ ezr ] + * chromium-browser: Add support for .mhtml files + + [ jerkey ] + * screen: complete first arg with serial devices + + [ marxin ] + * gcc: support new --completion option (#222) + + [ pcc ] + * unzip, zipinfo: complete *.aab (#340) + + [ versat ] + * cppcheck: Remove deprecated option 'posix' for '--std=' + + -- Ville Skyttä Thu, 05 Dec 2019 17:04:26 +0200 + bash-completion (2.9) [ Antonio Terceiro ] diff --git a/bash_completion b/bash_completion index c692ecb97f1..6ec510e5d4c 100644 --- a/bash_completion +++ b/bash_completion @@ -23,7 +23,7 @@ # # https://github.com/scop/bash-completion -BASH_COMPLETION_VERSINFO=(2 9) +BASH_COMPLETION_VERSINFO=(2 10) if [[ $- == *v* ]]; then BASH_COMPLETION_ORIGINAL_V_VALUE="-v" diff --git a/configure.ac b/configure.ac index 565041ce2b5..570c85a837c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.60]) -AC_INIT([bash-completion], [2.9]) +AC_INIT([bash-completion], [2.10]) AM_INIT_AUTOMAKE([foreign dist-xz no-dist-gzip -Wall -Wno-portability -Werror]) AC_PROG_LN_S AC_PROG_MKDIR_P From 7dd16adf6ae409ee76256ac8b73977e9a88e341e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 7 Dec 2019 09:01:33 +0200 Subject: [PATCH 0310/1094] lilo: add -B and -E completions Refs https://github.com/scop/bash-completion/issues/369 Thanks-to: PauloHFB --- completions/lilo | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/completions/lilo b/completions/lilo index 03e3ee29a7f..14b4fb6ee71 100644 --- a/completions/lilo +++ b/completions/lilo @@ -37,12 +37,20 @@ _lilo() video' -- "$cur") ) return ;; + -B) + _filedir bmp + return + ;; + -E) + _filedir '@(bmp|dat)' + return + ;; esac if [[ "$cur" == -* ]]; then # relevant options completion - COMPREPLY=( $(compgen -W '-A -b -c -C -d -f -g -i -I -l -L -m -M -p -P - -q -r -R -s -S -t -T -u -U -v -V -w -x -z' -- "$cur") ) + COMPREPLY=( $(compgen -W '-A -B -b -c -C -d -E -f -g -i -I -l -L -m -M + -p -P -q -r -R -s -S -t -T -u -U -v -V -w -x -z' -- "$cur") ) fi } && complete -F _lilo lilo From 5b12f1d49bf036f99ccd97df2c3effee63fb04d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 7 Dec 2019 09:08:59 +0200 Subject: [PATCH 0311/1094] lilo: honor -C when completing labels --- completions/lilo | 12 ++++++++++-- test/fixtures/lilo/lilo.conf | 34 ++++++++++++++++++++++++++++++++++ test/t/test_lilo.py | 10 ++++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 test/fixtures/lilo/lilo.conf diff --git a/completions/lilo b/completions/lilo index 14b4fb6ee71..87ecac061e3 100644 --- a/completions/lilo +++ b/completions/lilo @@ -3,7 +3,8 @@ _lilo_labels() { COMPREPLY=( $(compgen -W "$(awk -F'=' '/label/ {print $2}' \ - /etc/lilo.conf | command sed -e 's/\"//g')" -- "$cur") ) + ${1:-/etc/lilo.conf} 2>/dev/null | command sed -e 's/\"//g')" \ + -- "$cur") ) } _lilo() @@ -22,7 +23,14 @@ _lilo() ;; -I|-D|-R) # label completion - _lilo_labels + local i conf + for i in ${!words[@]}; do + if [[ ${words[i]} == -C ]]; then + conf=${words[i+1]} + break + fi + done + _lilo_labels $conf return ;; -A|-b|-M|-u|-U) diff --git a/test/fixtures/lilo/lilo.conf b/test/fixtures/lilo/lilo.conf new file mode 100644 index 00000000000..09ca03240f9 --- /dev/null +++ b/test/fixtures/lilo/lilo.conf @@ -0,0 +1,34 @@ +# global options: +boot=/dev/hda +prompt +timeout=150 +lba32 +compact +vga=normal +root=/dev/hda1 +read-only +menu-title=" John's Computer " +# +### bootable kernel images ### +image=/boot/vmlinuz-2.6.29-1-i386 + label=try + initrd=/boot/initrd.img-2.6.29-1-i386 +image=/boot/vmlinuz-2.4.33-1-i386 + label=2.4.33 +image=/tamu/vmlinuz + label=tamu + initrd=/tamu/initrd.img + root=/dev/hdb2 + vga=ask +# +### other operating systems ### +other=/dev/hda3 + label=PCDOS + boot-as=0x80 # must be C: +other=/dev/hdb1 + label=WinXP + boot-as=0x80 # must be C: +other=/dev/hdb5 + label=oldDOS + loader=chain + table=/dev/hdb5 diff --git a/test/t/test_lilo.py b/test/t/test_lilo.py index 9783f50607e..3f407c27782 100644 --- a/test/t/test_lilo.py +++ b/test/t/test_lilo.py @@ -5,3 +5,13 @@ class TestLilo: @pytest.mark.complete("lilo -") def test_1(self, completion): assert completion + + @pytest.mark.complete("lilo -C lilo/lilo.conf -D ") + def test_labels(self, completion): + assert completion == sorted( + "try 2.4.33 tamu PCDOS WinXP oldDOS".split() + ) + + @pytest.mark.complete("lilo -C -D ") + def test_labels_incorrect_command(self, completion): + assert not completion From ad6a3496c3517534e5791334094cc23ec7f09437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 7 Dec 2019 09:36:10 +0200 Subject: [PATCH 0312/1094] lilo: don't complete on commented out labels Closes https://github.com/scop/bash-completion/issues/369 Thanks-to: PauloHFB --- completions/lilo | 2 +- test/fixtures/lilo/lilo.conf | 4 ++-- test/t/test_lilo.py | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/completions/lilo b/completions/lilo index 87ecac061e3..87ab76e4a8f 100644 --- a/completions/lilo +++ b/completions/lilo @@ -2,7 +2,7 @@ _lilo_labels() { - COMPREPLY=( $(compgen -W "$(awk -F'=' '/label/ {print $2}' \ + COMPREPLY=( $(compgen -W "$(awk -F= '$1 ~ /^[ \t]*label$/ {print $2}' \ ${1:-/etc/lilo.conf} 2>/dev/null | command sed -e 's/\"//g')" \ -- "$cur") ) } diff --git a/test/fixtures/lilo/lilo.conf b/test/fixtures/lilo/lilo.conf index 09ca03240f9..c89017584ac 100644 --- a/test/fixtures/lilo/lilo.conf +++ b/test/fixtures/lilo/lilo.conf @@ -13,8 +13,8 @@ menu-title=" John's Computer " image=/boot/vmlinuz-2.6.29-1-i386 label=try initrd=/boot/initrd.img-2.6.29-1-i386 -image=/boot/vmlinuz-2.4.33-1-i386 - label=2.4.33 +#image=/boot/vmlinuz-2.4.33-1-i386 +# label=2.4.33 image=/tamu/vmlinuz label=tamu initrd=/tamu/initrd.img diff --git a/test/t/test_lilo.py b/test/t/test_lilo.py index 3f407c27782..2c698212718 100644 --- a/test/t/test_lilo.py +++ b/test/t/test_lilo.py @@ -8,9 +8,8 @@ def test_1(self, completion): @pytest.mark.complete("lilo -C lilo/lilo.conf -D ") def test_labels(self, completion): - assert completion == sorted( - "try 2.4.33 tamu PCDOS WinXP oldDOS".split() - ) + # Note that 2.4.33 should not be here, it's commented out + assert completion == sorted("try tamu PCDOS WinXP oldDOS".split()) @pytest.mark.complete("lilo -C -D ") def test_labels_incorrect_command(self, completion): From 0f80613bd8a554c6aece24cf694a4ba9a11e57ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 8 Dec 2019 09:51:39 +0200 Subject: [PATCH 0313/1094] test/dnssec-keygen: allow more alternatives in algorithm completion Closes https://github.com/scop/bash-completion/issues/370 --- test/t/test_dnssec_keygen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/t/test_dnssec_keygen.py b/test/t/test_dnssec_keygen.py index d52e3af0ee0..f8bd6fb146e 100644 --- a/test/t/test_dnssec_keygen.py +++ b/test/t/test_dnssec_keygen.py @@ -13,7 +13,7 @@ def test_1(self, completion): @pytest.mark.complete("dnssec-keygen -a ") def test_2(self, completion): assert completion - assert "HMAC-MD5" in completion + assert any(x in completion for x in ("HMAC-MD5", "RSASHA1", "ED25519")) assert "|" not in completion assert not any(x.startswith("-") for x in completion) From 8130f87b4e035e3b439ce2f06bdb6bb495288e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 8 Dec 2019 10:06:11 +0200 Subject: [PATCH 0314/1094] test/wol: don't fail MAC test if test system has /etc/ethers entries Closes https://github.com/scop/bash-completion/issues/371 --- test/t/test_wol.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/t/test_wol.py b/test/t/test_wol.py index b7a622ee877..bf04f76edb7 100644 --- a/test/t/test_wol.py +++ b/test/t/test_wol.py @@ -5,14 +5,15 @@ class TestWol: @pytest.mark.complete("wol ") def test_1(self, completion): - assert ( - completion == "00:00:00:00:00:00 11:11:11:11:11:11 " + assert all( + x in completion + for x in "00:00:00:00:00:00 11:11:11:11:11:11 " "22:22:22:22:22:22 33:33:33:33:33:33".split() ) @pytest.mark.complete("wol 00:") def test_2(self, completion): - assert completion == "00:00:00:00:00:00" + assert any(x.endswith("00:00:00:00:00") for x in completion) @pytest.mark.complete("wol -", require_cmd=True) def test_3(self, completion): From 1e029e81dc0a121f575d35c925cc878448feccc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 10 Dec 2019 21:46:23 +0200 Subject: [PATCH 0315/1094] *: complete commands when prefixed with a backslash Closes https://github.com/scop/bash-completion/issues/368 --- bash_completion | 16 ++++++++++++++-- test/t/test_complete.py | 4 ++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/bash_completion b/bash_completion index 6ec510e5d4c..38f05082e26 100644 --- a/bash_completion +++ b/bash_completion @@ -2096,17 +2096,29 @@ __load_completion() dirs+=( ./completions ) fi + local backslash= + if [[ $cmd == \\* ]]; then + cmd="${cmd:1}" + # If we already have a completion for the "real" command, use it + $(complete -p "$cmd" 2>/dev/null || echo false) "\\$cmd" && return 0 + backslash=\\ + fi + for dir in "${dirs[@]}"; do [[ -d "$dir" ]] || continue for compfile in "$cmd" "$cmd.bash" "_$cmd"; do compfile="$dir/$compfile" # Avoid trying to source dirs; https://bugzilla.redhat.com/903540 - [[ -f "$compfile" ]] && . "$compfile" &>/dev/null && return 0 + if [[ -f "$compfile" ]] && . "$compfile" &>/dev/null; then + [[ $backslash ]] && $(complete -p "$cmd") "\\$cmd" + return 0 + fi done done # Look up simple "xspec" completions - [[ "${_xspecs[$cmd]}" ]] && complete -F _filedir_xspec "$cmd" && return 0 + [[ "${_xspecs[$cmd]}" ]] && + complete -F _filedir_xspec "$cmd" "$backslash$cmd" && return 0 return 1 } diff --git a/test/t/test_complete.py b/test/t/test_complete.py index 036f954edcb..7ff56b41235 100644 --- a/test/t/test_complete.py +++ b/test/t/test_complete.py @@ -5,3 +5,7 @@ class TestComplete: @pytest.mark.complete("complete -") def test_1(self, completion): assert completion + + @pytest.mark.complete(r"\complete -") + def test_2(self, completion): + assert completion From 1307b7ae9f809aec4d1cda74a13878c1947eb095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Fri, 13 Dec 2019 08:50:26 +0200 Subject: [PATCH 0316/1094] ipcalc: new completion --- completions/Makefile.am | 1 + completions/ipcalc | 25 +++++++++++++++++++++++++ test/t/Makefile.am | 1 + test/t/test_ipcalc.py | 23 +++++++++++++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 completions/ipcalc create mode 100644 test/t/test_ipcalc.py diff --git a/completions/Makefile.am b/completions/Makefile.am index 8f276d664dc..2f11c796a45 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -173,6 +173,7 @@ bashcomp_DATA = 2to3 \ invoke-rc.d \ _ionice \ ip \ + ipcalc \ iperf \ ipmitool \ ipsec \ diff --git a/completions/ipcalc b/completions/ipcalc new file mode 100644 index 00000000000..5d39f4312e4 --- /dev/null +++ b/completions/ipcalc @@ -0,0 +1,25 @@ +# ipcalc(1) completion -*- shell-script -*- + +_ipcalc() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --help|--version|--split|-[hs]) + return + ;; + esac + + # --split takes 3 args + local i + for i in {1..3}; do + [[ ${words[cword-i]} == -@(-split|s) ]] && return + done + + [[ $cur != -* ]] || \ + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) +} && +complete -F _ipcalc ipcalc + +# ex: filetype=sh diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 0ce46b12614..5ed3a51ebf7 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -249,6 +249,7 @@ EXTRA_DIST = \ test_invoke_rc_d.py \ test_ionice.py \ test_ip.py \ + test_ipcalc.py \ test_iperf.py \ test_ipmitool.py \ test_ipsec.py \ diff --git a/test/t/test_ipcalc.py b/test/t/test_ipcalc.py new file mode 100644 index 00000000000..b7f37c4abf7 --- /dev/null +++ b/test/t/test_ipcalc.py @@ -0,0 +1,23 @@ +import pytest + + +class TestIpcalc: + @pytest.mark.complete("ipcalc -", require_cmd=True) + def test_options(self, completion): + assert "--help" in completion + + @pytest.mark.complete("ipcalc --split -") + def test_split_3args_1(self, completion): + assert not completion + + @pytest.mark.complete("ipcalc --split 1 -") + def test_split_3args_2(self, completion): + assert not completion + + @pytest.mark.complete("ipcalc --split 1 2 -") + def test_split_3args_3(self, completion): + assert not completion + + @pytest.mark.complete("ipcalc --split 1 2 3 -", require_cmd=True) + def test_split_3args_4(self, completion): + assert "--help" in completion From 3e941a643097d080277af00924e34ef925c4c41f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Wed, 25 Dec 2019 11:20:48 +0200 Subject: [PATCH 0317/1094] README.md: add introduction Closes https://github.com/scop/bash-completion/issues/358 Closes https://github.com/scop/bash-completion/pull/376 --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index e78cf189061..458333831a8 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,13 @@ [![Build Status](https://travis-ci.org/scop/bash-completion.svg?branch=master)](https://travis-ci.org/scop/bash-completion) +## Introduction + +bash-completion is a collection of command line command completions for the +[Bash shell](https://www.gnu.org/software/bash/), collection of helper +functions to assist in creating new completions, and set of facilities for +loading completions on demand as well as installing them. + ## Installation The easiest way to install this software is to use a package; refer to From d7051234afee6cc164b59660dade18f34fb0d52f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 4 Jan 2020 11:53:07 +0200 Subject: [PATCH 0318/1094] chromium-browser, firefox: complete on *.txt (#379) Closes https://github.com/scop/bash-completion/issues/379 --- completions/chromium-browser | 2 +- completions/firefox | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/completions/chromium-browser b/completions/chromium-browser index a26b04f22d3..4b0502b83ea 100644 --- a/completions/chromium-browser +++ b/completions/chromium-browser @@ -42,7 +42,7 @@ _chromium_browser() return fi - _filedir "@(?([mxs])htm?(l)|pdf)" + _filedir "@(?([mxs])htm?(l)|pdf|txt)" } && complete -F _chromium_browser chromium-browser google-chrome \ google-chrome-stable chromium chrome diff --git a/completions/firefox b/completions/firefox index eeaca9f6727..307028319e8 100644 --- a/completions/firefox +++ b/completions/firefox @@ -39,7 +39,7 @@ _firefox() return fi - _filedir "@(?([xs])htm?(l)|pdf)" + _filedir "@(?([xs])htm?(l)|pdf|txt)" } && complete -F _firefox firefox mozilla-firefox iceweasel From ba3b2ea05632e07920c4670d0297af557ba717c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 4 Jan 2020 12:10:23 +0200 Subject: [PATCH 0319/1094] test/ipcalc: fix tests with busybox ipcalc --- test/t/test_ipcalc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/t/test_ipcalc.py b/test/t/test_ipcalc.py index b7f37c4abf7..5611674c48e 100644 --- a/test/t/test_ipcalc.py +++ b/test/t/test_ipcalc.py @@ -4,7 +4,7 @@ class TestIpcalc: @pytest.mark.complete("ipcalc -", require_cmd=True) def test_options(self, completion): - assert "--help" in completion + assert any(x in completion for x in "--help -h".split()) @pytest.mark.complete("ipcalc --split -") def test_split_3args_1(self, completion): @@ -20,4 +20,4 @@ def test_split_3args_3(self, completion): @pytest.mark.complete("ipcalc --split 1 2 3 -", require_cmd=True) def test_split_3args_4(self, completion): - assert "--help" in completion + assert any(x in completion for x in "--help -h".split()) From 42dbeefb8a681e52f381218c2b69e586537ab6e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 4 Jan 2020 12:23:23 +0200 Subject: [PATCH 0320/1094] lilo: work around shellcheck false positive https://github.com/koalaman/shellcheck/issues/1787 --- completions/lilo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/lilo b/completions/lilo index 87ab76e4a8f..60850a9dcd5 100644 --- a/completions/lilo +++ b/completions/lilo @@ -24,7 +24,7 @@ _lilo() -I|-D|-R) # label completion local i conf - for i in ${!words[@]}; do + for i in "${!words[@]}"; do if [[ ${words[i]} == -C ]]; then conf=${words[i+1]} break From aab32df7ec7a9bff6059560d58c0c7088a983bd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 4 Jan 2020 21:31:26 +0200 Subject: [PATCH 0321/1094] test: port remaining finger, sftp, ssh, and xhost cases to pytest+pexpect --- test/completion/finger.exp | 1 - test/completion/sftp.exp | 1 - test/completion/ssh.exp | 1 - test/completion/xhost.exp | 1 - test/lib/completions/finger.exp | 41 -------------- test/lib/completions/sftp.exp | 60 --------------------- test/lib/completions/ssh.exp | 61 --------------------- test/lib/completions/xhost.exp | 95 --------------------------------- test/lib/library.exp | 70 ++++-------------------- test/t/Makefile.am | 1 + test/t/conftest.py | 58 +++++++++++++++++++- test/t/test_finger.py | 8 ++- test/t/test_sftp.py | 35 ++++++++++++ test/t/test_ssh.py | 14 +++++ test/t/test_xhost.py | 17 ++++++ 15 files changed, 140 insertions(+), 324 deletions(-) delete mode 100644 test/completion/finger.exp delete mode 100644 test/completion/sftp.exp delete mode 100644 test/completion/ssh.exp delete mode 100644 test/completion/xhost.exp delete mode 100644 test/lib/completions/finger.exp delete mode 100644 test/lib/completions/sftp.exp delete mode 100644 test/lib/completions/ssh.exp delete mode 100644 test/lib/completions/xhost.exp create mode 100644 test/t/test_xhost.py diff --git a/test/completion/finger.exp b/test/completion/finger.exp deleted file mode 100644 index 7c7b8a26d32..00000000000 --- a/test/completion/finger.exp +++ /dev/null @@ -1 +0,0 @@ -assert_source_completions finger diff --git a/test/completion/sftp.exp b/test/completion/sftp.exp deleted file mode 100644 index 448cd2187f1..00000000000 --- a/test/completion/sftp.exp +++ /dev/null @@ -1 +0,0 @@ -assert_source_completions sftp diff --git a/test/completion/ssh.exp b/test/completion/ssh.exp deleted file mode 100644 index 0477cba56e8..00000000000 --- a/test/completion/ssh.exp +++ /dev/null @@ -1 +0,0 @@ -assert_source_completions ssh diff --git a/test/completion/xhost.exp b/test/completion/xhost.exp deleted file mode 100644 index 159782b26c5..00000000000 --- a/test/completion/xhost.exp +++ /dev/null @@ -1 +0,0 @@ -assert_source_completions xhost diff --git a/test/lib/completions/finger.exp b/test/lib/completions/finger.exp deleted file mode 100644 index c055f354191..00000000000 --- a/test/lib/completions/finger.exp +++ /dev/null @@ -1,41 +0,0 @@ -proc setup {} { - save_env -} - - -proc teardown {} { - assert_env_unmodified -} - - -setup - - -sync_after_int - - -set test "Tab should complete partial hostname" -# Build string list of hostnames, starting with the character of the first -# host, unless host starts with a COMP_WORDBREAKS character, e.g. a colon (:). -# Hosts starting with a COMP_WORDBREAKS character are left out because these -# are exceptional cases, requiring specific tests. -set hosts {} -set char "" -foreach h [get_known_hosts] { - set first [string range $h 0 0] - if {$char == "" && [string first $first $::COMP_WORDBREAKS] == -1} {set char $first} - if {$char != ""} { - # Only append unique hostnames starting with $char - if {$first == $char && [lsearch -exact $hosts "test@$h"] == -1} { - # Prefix hosts with username 'test@' - lappend hosts "test@$h" - } - } -} -assert_complete $hosts "finger test@$char" $test -expect-cmd-minus "test@$char" - - -sync_after_int - - -teardown diff --git a/test/lib/completions/sftp.exp b/test/lib/completions/sftp.exp deleted file mode 100644 index c5c0919fdec..00000000000 --- a/test/lib/completions/sftp.exp +++ /dev/null @@ -1,60 +0,0 @@ -proc setup {} { - save_env - # NOTE: Changing dir to $SRCDIR is necessary because file locations in the - # ssh config files (e.g. UserKnownHostsFile) are relative to $SRCDIR. - assert_bash_exec {cd $SRCDIR/fixtures/sftp} -} - - -proc teardown {} { - assert_bash_exec {cd $TESTDIR} - assert_env_unmodified { - /BASH_LINENO=/d - /BASH_SOURCE=/d - /OLDPWD=/d - } -} - - -setup - - - # Build string list of expected completions -set expected [get_hosts] - # Hosts `gee' and `hut' are defined in ./fixtures/sftp/config - # Hosts `10.10.10.10', `doo' and `ike' are defined in ./fixtures/sftp/known_hosts -lappend expected 10.10.10.10 doo gee hut ike -assert_complete $expected "sftp -F config " - - -sync_after_int - - -set test "-F without space shouldn't error" - # Try completion -set cmd "sftp -F" -send "$cmd\t " -expect { - -re "^${cmd}bash: option requires an argument -- F" { fail "$test" } - -re "^$cmd\r\n.*\r\n/@" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - default { unresolved "$test" } -} - - -sync_after_int - - - # Build string list of expected completions - # Get hostnames and give them a colon (:) suffix -set expected [get_hosts] - # Hosts `gee' and `jar' are defined in "./fixtures/sftp/spaced conf" - # Hosts `10.10.10.10', `doo' and `ike' are defined in ./fixtures/sftp/known_hosts -lappend expected 10.10.10.10 doo gee ike jar -assert_complete $expected "sftp -F spaced\\ \\ conf " - - -sync_after_int - - -teardown diff --git a/test/lib/completions/ssh.exp b/test/lib/completions/ssh.exp deleted file mode 100644 index 1702371cbde..00000000000 --- a/test/lib/completions/ssh.exp +++ /dev/null @@ -1,61 +0,0 @@ -proc setup {} { - save_env - # NOTE: Changing dir to $SRCDIR is necessary because file locations in the - # ssh config files (e.g. UserKnownHostsFile) are relative to $SRCDIR. - assert_bash_exec {cd $SRCDIR/fixtures/ssh} -} - - -proc teardown {} { - assert_bash_exec {cd $TESTDIR} - assert_env_unmodified { - /BASH_LINENO=/d - /BASH_SOURCE=/d - /OLDPWD=/d - } -} - - -setup - - -set test "-F without space shouldn't error" - # Try completion -set cmd "ssh -F" -send "$cmd\t " -set expected "^$cmd $" -expect { - -re "^${cmd}bash: option requires an argument -- F" { fail "$test" } - -re "^$cmd\r\n.*\r\n/@" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - default { unresolved "$test" } -} - - -sync_after_int - - -set test "First argument should complete partial hostname" -# Build string list of hostnames, starting with the character of the first -# host, unless host starts with a COMP_WORDBREAKS character, e.g. a colon (:). -# Hosts starting with a COMP_WORDBREAKS character are left out because these -# are exceptional cases, requiring specific tests. -set hosts {} -set char "" -foreach h [get_known_hosts] { - set first [string range $h 0 0] - if {$char == "" && [string first $first $::COMP_WORDBREAKS] == -1} {set char $first} - if {$char != ""} { - # Only append unique hostnames starting with $char - if {$first == $char && [lsearch -exact $hosts "$h"] == -1} { - lappend hosts "$h" - } - } -} -assert_complete $hosts "ssh $char" $test -ltrim-colon-completions -expect-cmd-minus "$char" - - -sync_after_int - - -teardown diff --git a/test/lib/completions/xhost.exp b/test/lib/completions/xhost.exp deleted file mode 100644 index 02aa4cb2add..00000000000 --- a/test/lib/completions/xhost.exp +++ /dev/null @@ -1,95 +0,0 @@ -proc setup {} { - assert_bash_exec {HOME=$TESTDIR} - save_env -} - - -proc teardown {} { - assert_env_unmodified -} - - -setup - - -set test "Tab should complete hostnames" -assert_complete [get_hosts] "xhost " $test - - -sync_after_int - - -set test "Tab should complete partial hostname" -# Build string list of hostnames, starting with the character of the first hostname -set hosts {} -set char "" -foreach h [get_hosts] { - if {$char == ""} {set char [string range $h 0 0]} - # Only append hostname if starting with $char - if {[string range $h 0 0] == "$char"} { - lappend hosts $h - } -} -assert_complete $hosts "xhost $char" $test -expect-cmd-minus "$char" - - -sync_after_int - - -set test "Tab should complete hostnames prefixed with +" -# Build string list of hostnames, prefixed with plus (+) -set hosts {} -foreach h [get_hosts] { - lappend hosts "+$h" -} -assert_complete $hosts "xhost \+" $test - - -sync_after_int - - -set test "Tab should complete partial hostname prefixed with +" - # Build string list of hostnames, starting with character of first host. -set hosts {} -foreach h [get_hosts] { - if {$char == ""} {set char [string range $h 0 0]} - # Only append hostname if starting with $char - if {[string range $h 0 0] == "$char"} { - lappend hosts "+$h" - } -} -assert_complete $hosts "xhost +$char" $test -expect-cmd-minus "\+$char" - - -sync_after_int - - -set test "Tab should complete hostnames prefixed with -" - # Build string list of hostnames, prefix with minus (-) -set hosts {} -foreach h [get_hosts] { - lappend hosts "-$h" -} -assert_complete $hosts "xhost -" $test - - -sync_after_int - - -set test "Tab should complete partial hostname prefixed with -" - # Build list of hostnames, starting with character of first host -set hosts {} -foreach h [get_hosts] { - if {$char == ""} {set char [string range $h 0 0]} - # Only append hostname if starting with $char - if {[string range $h 0 0] == "$char"} { - lappend hosts "-$h" - } -} -assert_complete $hosts "xhost -$char" $test -expect-cmd-minus "-$char" - - -sync_after_int - - -teardown diff --git a/test/lib/library.exp b/test/lib/library.exp index c90c927cf8d..d660be59c9c 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -164,8 +164,6 @@ proc assert_bash_list_dir {expected cmd dir test {args {}}} { # a time. Default is 20. # -nospace Don't expect space character to be output after completion match. # Valid only if a single completion is expected. -# -ltrim-colon-completions Left-trim completions with cword containing -# colon (:) # -expect-cmd-minus DWORD Expect $cmd minus DWORD to be echoed. # Expected is: # @@ -179,7 +177,6 @@ proc assert_complete {expected cmd {test ""} {args {}}} { {prompt.arg "/@" "bash prompt"} {chunk-size.arg 20 "compare N list items at a time"} {nospace "don't expect space after completion"} - {ltrim-colon-completions "left-trim completions with cword containing :"} {expect-cmd-minus.arg "" "Expect cmd minus DWORD after prompt"} }] if {[llength $expected] == 0} { @@ -200,7 +197,6 @@ proc assert_complete_many {expected cmd {test ""} {args {}}} { {prompt.arg "/@" "bash prompt"} {chunk-size.arg 20 "compare N list items at a time"} {nospace "don't expect space after completion"} - {ltrim-colon-completions "left-trim completions with cword containing :"} {expect-cmd-minus.arg "" "Expect cmd minus CWORD after prompt"} }] if {$test == ""} {set test "$cmd should show completions"} @@ -217,10 +213,6 @@ proc assert_complete_many {expected cmd {test ""} {args {}}} { # Determine common prefix of completions set common [::textutil::string::longestCommonPrefixList $expected] - if {$arg(ltrim-colon-completions)} { - # If partial contains colon (:), remove partial from begin of items - _ltrim_colon_completions $cmd expected dword - } set cmd2 [_remove_cword_from_cmd $cmd $dword $common] set prompt "$prompt$cmd2$common" @@ -245,7 +237,6 @@ proc assert_complete_one {expected cmd {test ""} {args {}}} { {prompt.arg "/@" "bash prompt"} {chunk-size.arg 20 "compare N list items at a time"} {nospace "don't expect space after completion"} - {ltrim-colon-completions "left-trim completions with cword containing :"} {expect-cmd-minus.arg "" "Expect cmd minus CWORD after prompt"} }] set prompt $arg(prompt) @@ -253,23 +244,16 @@ proc assert_complete_one {expected cmd {test ""} {args {}}} { if {$test == ""} {set test "$cmd should show completion"} send "$cmd\t" expect -ex "$cmd" - set trimmed false - if {$arg(ltrim-colon-completions)} { - # If partial contains colon (:), remove partial from begin of items - set trimmed [_ltrim_colon_completions $cmd expected cword] + set cur ""; # Default to empty word to complete on + set words [split_words_bash $cmd] + if {[llength $words] > 1} { + # Assume last word of `$cmd' is word to complete on. + set index [expr [llength $words] - 1] + set cur [lindex $words $index] } - if {! $trimmed} { - set cur ""; # Default to empty word to complete on - set words [split_words_bash $cmd] - if {[llength $words] > 1} { - # Assume last word of `$cmd' is word to complete on. - set index [expr [llength $words] - 1] - set cur [lindex $words $index] - } - # Remove second word from beginning of $expected - if {[string first $cur $expected] == 0} { - set expected [list [string range $expected [string length $cur] end]] - } + # Remove second word from beginning of $expected + if {[string first $cur $expected] == 0} { + set expected [list [string range $expected [string length $cur] end]] } if {$arg(nospace)} {set endspace ""} else {set endspace "-end-space"} @@ -378,42 +362,6 @@ proc assert_complete_dir {expected cmd dir {test ""} {args {}}} { -# If cword contains colon (:), left-trim completions with cword -# @param string $cmd Command to complete -# @param list $items Reference to list of completions to trim -# @param string $dword Reference to variable to contain word to remove from -# expected cmd. -# See also: bash_completion._ltrim_colon_completions -proc _ltrim_colon_completions {cmd items dword} { - upvar 1 $items items_out - upvar 1 $dword dword_out - - set cur ""; # Default to empty word to complete on - set words [split_words_bash $cmd] - if {[llength $words] > 1} { - # Assume last word of `$cmd' is word to complete on. - set index [expr [llength $words] - 1] - set cur [lindex $words $index] - } - # If word-to-complete contains a colon, - # and COMP_WORDBREAKS contains a colon - if { - [string first : $cur] > -1 && [string first ":" $::COMP_WORDBREAKS] > -1 - } { - set dword_out $cur - for {set i 0} {$i < [llength $items_out]} {incr i} { - set item [lindex $items_out $i] - if {[string first $cur $item] == 0} { - # Strip colon-prefix - lset items_out $i [string range $item [string length $cur] end] - } - } - return true - } - return false -} - - # Make sure the bash environment hasn't changed between now and the last call # to `save_env()'. # @param string $sed Sed commands to preprocess diff output. diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 5ed3a51ebf7..704460131cb 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -658,6 +658,7 @@ EXTRA_DIST = \ test_xdg_settings.py \ test_xfreerdp.py \ test_xgamma.py \ + test_xhost.py \ test_xm.py \ test_xmllint.py \ test_xmlwf.py \ diff --git a/test/t/conftest.py b/test/t/conftest.py index 20942e87eed..40f731dd5fc 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -14,7 +14,7 @@ def find_unique_completion_pair( - items: Iterable[str] + items: Iterable[str], ) -> Optional[Tuple[str, str]]: result = None bestscore = 0 @@ -77,6 +77,62 @@ def part_full_group(bash: pexpect.spawn) -> Optional[Tuple[str, str]]: return pair +@pytest.fixture(scope="class") +def hosts(bash: pexpect.spawn) -> List[str]: + output = assert_bash_exec( + bash, + "compgen -A hostname; " + "type avahi-browse &>/dev/null && " + "avahi-browse -cpr _workstation._tcp 2>/dev/null " + "| command grep ^= | cut -d\; -f7", + want_output=True, + ) + return sorted(set(output.split())) + + +@pytest.fixture(scope="class") +def known_hosts(bash: pexpect.spawn) -> List[str]: + output = assert_bash_exec( + bash, + # TODO: why does printf instead of echo hang here? + '_known_hosts_real; echo "${COMPREPLY[@]}"; unset COMPREPLY', + want_output=True, + ) + return sorted(set(output.split())) + + +def partialize( + bash: pexpect.spawn, items: Iterable[str] +) -> Tuple[str, List[str]]: + """ + Get list of items starting with the first char of first of items. + + Disregard items starting with a COMP_WORDBREAKS character + (e.g. a colon ~ IPv6 address), they are special cases requiring + special tests. + """ + first_char = None + comp_wordbreaks = assert_bash_exec( + bash, + 'printf "%s" "$COMP_WORDBREAKS"', + want_output=True, + want_newline=False, + ) + partial_items = [] + for item in sorted(items): + if first_char is None: + if item[0] not in comp_wordbreaks: + first_char = item[0] + partial_items.append(item) + elif item.startswith(first_char): + partial_items.append(item) + else: + break + if first_char is None: + pytest.skip("Could not generate partial items list from %s" % items) + return first_char, partial_items + + @pytest.fixture(scope="class") def bash(request) -> pexpect.spawn: diff --git a/test/t/test_finger.py b/test/t/test_finger.py index 92c983fa282..2cf92f0aefd 100644 --- a/test/t/test_finger.py +++ b/test/t/test_finger.py @@ -1,6 +1,6 @@ import pytest -from conftest import assert_bash_exec +from conftest import assert_bash_exec, assert_complete, partialize class TestFinger: @@ -23,3 +23,9 @@ def test_2(self, bash, completion, users_at): assert completion assert all(x.startswith("r") for x in completion) assert not completion.endswith(" ") + + def test_partial_hostname(self, bash, known_hosts): + first_char, partial_hosts = partialize(bash, known_hosts) + user = "test" + completion = assert_complete(bash, "finger %s@%s" % (user, first_char)) + assert completion == ["%s@%s" % (user, x) for x in partial_hosts] diff --git a/test/t/test_sftp.py b/test/t/test_sftp.py index 0c039399f80..8606f8a8a38 100644 --- a/test/t/test_sftp.py +++ b/test/t/test_sftp.py @@ -1,3 +1,5 @@ +from itertools import chain + import pytest @@ -9,3 +11,36 @@ def test_1(self, completion): @pytest.mark.complete("sftp -", require_cmd=True) def test_2(self, completion): assert completion + + @pytest.mark.complete("sftp -F config ", cwd="sftp") + def test_hosts(self, hosts, completion): + expected = sorted( + chain( + hosts, + # From fixtures/sftp/config + "gee hut".split(), + # From fixtures/sftp/known_hosts + "10.10.10.10 doo ike".split(), + ) + ) + assert completion == expected + + @pytest.mark.complete(r"sftp -F spaced\ \ conf ", cwd="sftp") + def test_hosts_spaced_conf(self, hosts, completion): + expected = sorted( + chain( + hosts, + # From "fixtures/sftp/spaced conf" + "gee jar".split(), + # From fixtures/sftp/known_hosts + "10.10.10.10 doo ike".split(), + ) + ) + assert completion == expected + + @pytest.mark.complete("sftp -F") + def test_capital_f_without_space(self, completion): + assert completion + assert not any( + "option requires an argument -- F" in x for x in completion + ) diff --git a/test/t/test_ssh.py b/test/t/test_ssh.py index 204b7c7cc49..ccf338fbc21 100644 --- a/test/t/test_ssh.py +++ b/test/t/test_ssh.py @@ -1,5 +1,7 @@ import pytest +from conftest import assert_complete, partialize + class TestSsh: @pytest.mark.complete("ssh -Fsp", cwd="ssh") @@ -32,3 +34,15 @@ def test_5(self, completion): @pytest.mark.complete("ssh -", require_cmd=True) def test_6(self, completion): assert completion + + @pytest.mark.complete("ssh -F") + def test_capital_f_without_space(self, completion): + assert completion + assert not any( + "option requires an argument -- F" in x for x in completion + ) + + def test_partial_hostname(self, bash, known_hosts): + first_char, partial_hosts = partialize(bash, known_hosts) + completion = assert_complete(bash, "ssh %s" % first_char) + assert completion == partial_hosts diff --git a/test/t/test_xhost.py b/test/t/test_xhost.py new file mode 100644 index 00000000000..01692df9685 --- /dev/null +++ b/test/t/test_xhost.py @@ -0,0 +1,17 @@ +import pytest + +from conftest import assert_complete, partialize + + +@pytest.mark.bashcomp(pre_cmds=("HOME=$PWD",)) +class TestXhost: + @pytest.mark.parametrize("prefix", ["+", "-", ""]) + def test_hosts(self, bash, hosts, prefix): + completion = assert_complete(bash, "xhost %s" % prefix) + assert completion == ["%s%s" % (prefix, x) for x in hosts] + + @pytest.mark.parametrize("prefix", ["+", "-", ""]) + def test_partial_hosts(self, bash, hosts, prefix): + first_char, partial_hosts = partialize(bash, hosts) + completion = assert_complete(bash, "xhost %s%s" % (prefix, first_char)) + assert completion == ["%s%s" % (prefix, x) for x in partial_hosts] From f4f365dd6c619b41f9947eb3e53a120fd5173cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 4 Jan 2020 22:20:49 +0200 Subject: [PATCH 0322/1094] test: port some scp test cases to pytest+pexpect --- test/lib/completions/scp.exp | 57 ------------------------------------ test/t/Makefile.am | 1 + test/t/test_scp.py | 52 ++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 57 deletions(-) create mode 100644 test/t/test_scp.py diff --git a/test/lib/completions/scp.exp b/test/lib/completions/scp.exp index 1497a7fbe80..c019d248991 100644 --- a/test/lib/completions/scp.exp +++ b/test/lib/completions/scp.exp @@ -51,63 +51,6 @@ expect { sync_after_int -set test "Tab should complete known-hosts" - - # Build string list of expected completions - # Get hostnames and give them a colon (:) suffix - # Hosts `gee' and `hut' are defined in ./fixtures/scp/config - # Hosts `blah', `doo' and `ike' are defined in ./fixtures/scp/known_hosts -set expected {} -foreach host [get_hosts] { - lappend expected "$host:" -} -lappend expected blah: doo: gee: hut: ike: - # Append local filenames -lappend expected config known_hosts "spaced\\ \\ conf" -assert_complete $expected "scp -F config " $test - - -sync_after_int - - -set test "-F without space shouldn't error" - # Try completion -set cmd "scp -F" -send "$cmd\t " -expect { - -re "^${cmd}bash: option requires an argument -- F" { fail "$test" } - -re "^$cmd\r\n.*\r\n/@" { pass "$test" } - -re /@ { unresolved "$test at prompt" } - default { unresolved "$test" } -} - - -sync_after_int - - -set test "Config file containing space should work" - # Build string list of expected completions - # Get hostnames and give them a colon (:) suffix -set expected {} -foreach host [get_hosts] { - lappend expected "$host:" -} - # Hosts `gee', `hus' and `jar' are defined in "./fixtures/scp/spaced conf" - # Hosts `blah', `doo' and `ike' are defined in ./fixtures/scp/known_hosts -lappend expected blah: doo: gee: hus: ike: jar: - # Append local filenames -lappend expected config known_hosts "spaced\\ \\ conf" -set cmd "scp -F 'spaced conf' " -send "$cmd\t" -expect -ex "$cmd\r\n" -if {[match_items [lsort -unique $expected] -bash-sort]} { - expect { - -re /@ { pass "$test" } - -re eof { unresolved "eof" } - default { fail "$test" } - } -} -sync_after_int assert_bash_exec {cd "$TESTDIR"} diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 704460131cb..50757389f80 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -524,6 +524,7 @@ EXTRA_DIST = \ test_sbcl.py \ test_sbcl_mt.py \ test_sbopkg.py \ + test_scp.py \ test_screen.py \ test_scrub.py \ test_sdptool.py \ diff --git a/test/t/test_scp.py b/test/t/test_scp.py new file mode 100644 index 00000000000..fee3eb1bc87 --- /dev/null +++ b/test/t/test_scp.py @@ -0,0 +1,52 @@ +from itertools import chain + +import pytest + + +class TestScp: + @pytest.mark.complete("scp -F config ", cwd="scp") + def test_basic(self, hosts, completion): + expected = sorted( + chain( + ( + "%s:" % x + for x in chain( + hosts, + # From fixtures/scp/config + "gee hut".split(), + # From fixtures/scp/known_hosts + "blah doo ike".split(), + ) + ), + # Local filenames + ["config", "known_hosts", r"spaced\ \ conf"], + ) + ) + assert completion == expected + + @pytest.mark.complete("scp -F 'spaced conf' ", cwd="scp") + def test_basic_spaced_conf(self, hosts, completion): + expected = sorted( + chain( + ( + "%s:" % x + for x in chain( + hosts, + # From "fixtures/scp/spaced conf" + "gee jar".split(), + # From fixtures/scp/known_hosts + "blah doo ike".split(), + ) + ), + # Local filenames + ["config", "known_hosts", r"spaced\ \ conf"], + ) + ) + assert completion == expected + + @pytest.mark.complete("scp -F") + def test_capital_f_without_space(self, completion): + assert completion + assert not any( + "option requires an argument -- F" in x for x in completion + ) From b2c12be995eb4cb9aea931abb5f8c90a9f96907c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 4 Jan 2020 23:21:32 +0200 Subject: [PATCH 0323/1094] test: fix spurious hosts fixture failure without avahi-browse installed --- test/t/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/t/conftest.py b/test/t/conftest.py index 40f731dd5fc..a1af0abb442 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -82,7 +82,7 @@ def hosts(bash: pexpect.spawn) -> List[str]: output = assert_bash_exec( bash, "compgen -A hostname; " - "type avahi-browse &>/dev/null && " + "! type avahi-browse &>/dev/null || " "avahi-browse -cpr _workstation._tcp 2>/dev/null " "| command grep ^= | cut -d\; -f7", want_output=True, From f066c676f2145acb4df84461ba75847af35d2e9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 4 Jan 2020 23:31:52 +0200 Subject: [PATCH 0324/1094] test: remove some no longer needed tcl/expect code --- test/lib/library.exp | 68 -------------------------------------------- 1 file changed, 68 deletions(-) diff --git a/test/lib/library.exp b/test/lib/library.exp index d660be59c9c..d3be714dfd0 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -103,35 +103,6 @@ proc assert_bash_list {expected cmd test {args {}}} { } -# Make sure the expected list matches the real list, as returned by executing -# the specified bash command within the specified directory. -# Specify `-sort' if the real list is sorted. -# @param list $expected Expected list items -# @param string $cmd Bash command to generate real list items -# @param string $dir Directory to execute $cmd within -# @param string $test Test title. Becomes "$cmd should show expected output" -# if empty string. -# @param list $args Options: -# -sort Compare list sorted. Default is unsorted -# -prompt Bash prompt. Default is `/@' -# -chunk-size N Compare list N items at a time. Default -# is 20. -proc assert_bash_list_dir {expected cmd dir test {args {}}} { - array set arg [::cmdline::getoptions args { - {sort "compare list sorted"} - {prompt.arg "/@" "bash prompt"} - {chunk-size.arg 20 "compare N list items at a time"} - }] - set prompt $arg(prompt) - if {$arg(sort)} {set arg_sort "-sort"} else {set arg_sort ""} - assert_bash_exec "cd $dir" "" $prompt - assert_bash_list $expected $cmd $test $arg_sort \ - -chunk-size $arg(chunk-size) -prompt $prompt - sync_after_int $prompt - assert_bash_exec {cd "$TESTDIR"} -} - - # Make sure the expected items are returned by TAB-completing the specified # command. If the number of expected items is one, expected is: # @@ -315,33 +286,6 @@ proc _escape_regexp_chars {var} { regsub -all {([\^$+*?.|(){}[\]\\])} $str {\\\1} str } -# Make sure any completions are returned -proc assert_complete_any {cmd {test ""} {prompt /@}} { - if {$test == ""} {set test "$cmd should show completions"} - send "$cmd\t" - expect -ex "$cmd" - _escape_regexp_chars cmd - expect { - -timeout 1 - # Match completions, multiple words - # NOTE: The `\S*' (zero or more non-whitespace characters) matches a - # longest common prefix of the completions shown. - # E.g. `fmt -' becomes `fmt --' (two dashes) when completing - -re "^\r\n.*$prompt$cmd\\S*$" { pass "$test" } - timeout { - expect { - # Match completion, single word. This word is shown on the - # same line as the command. - -re "^\\S* $" { pass "$test" } - # Try matching multiple words again, with new timeout - -re "^\r\n.*$prompt$cmd\\S*$" { pass "$test" } - } - } - -re $prompt { unresolved "$test at prompt" } - eof { unresolved "eof" } - } -} - # Make sure the expected files are returned by TAB-completing the specified # command in the specified subdirectory. Be prepared to filter out OLDPWD @@ -496,22 +440,10 @@ proc bash_sort {items} { } -# Get 'known' hostnames. Looks also in ssh's 'known_hosts' files. -# @param string cword (optional) Word, hosts should start with. -# @return list Hostnames -# @see get_hosts() -proc get_known_hosts {{cword ''}} { - assert_bash_exec "_known_hosts_real '$cword'; echo_array COMPREPLY" \ - {} /@ result - return $result -} - - # Get hostnames # @param list $args Options: # -unsorted Do not sort unique. Default is sort unique. # @return list Hostnames -# @see get_known_hosts() proc get_hosts {{args {}}} { array set arg [::cmdline::getoptions args { {unsorted "do not sort unique"} From 30aefd3ee918d2a2c70d24eeb37e7c36004d3ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 5 Jan 2020 00:37:31 +0200 Subject: [PATCH 0325/1094] test: port some _known_hosts_real unit tests to pytest+pexpect --- test/fixtures/_known_hosts_real/config | 2 +- test/t/conftest.py | 20 ++++++-- test/t/unit/test_unit_known_hosts_real.py | 56 +++++++++++++++++++++++ test/unit/_known_hosts_real.exp | 43 ----------------- 4 files changed, 73 insertions(+), 48 deletions(-) create mode 100644 test/t/unit/test_unit_known_hosts_real.py diff --git a/test/fixtures/_known_hosts_real/config b/test/fixtures/_known_hosts_real/config index 1231dd7924b..6da39e08632 100644 --- a/test/fixtures/_known_hosts_real/config +++ b/test/fixtures/_known_hosts_real/config @@ -1,4 +1,4 @@ - UserKnownHostsFile fixtures/_known_hosts_real/known_hosts + UserKnownHostsFile _known_hosts_real/known_hosts # Unindented Host gee jar diff --git a/test/t/conftest.py b/test/t/conftest.py index a1af0abb442..d557e6f07c1 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -79,13 +79,22 @@ def part_full_group(bash: pexpect.spawn) -> Optional[Tuple[str, str]]: @pytest.fixture(scope="class") def hosts(bash: pexpect.spawn) -> List[str]: + output = assert_bash_exec(bash, "compgen -A hostname", want_output=True) + return sorted(set(output.split() + _avahi_hosts(bash))) + + +@pytest.fixture(scope="class") +def avahi_hosts(bash: pexpect.spawn) -> List[str]: + return _avahi_hosts(bash) + + +def _avahi_hosts(bash: pexpect.spawn) -> List[str]: output = assert_bash_exec( bash, - "compgen -A hostname; " "! type avahi-browse &>/dev/null || " "avahi-browse -cpr _workstation._tcp 2>/dev/null " "| command grep ^= | cut -d\; -f7", - want_output=True, + want_output=None, ) return sorted(set(output.split())) @@ -270,7 +279,10 @@ def load_completion_for(bash: pexpect.spawn, cmd: str) -> bool: def assert_bash_exec( - bash: pexpect.spawn, cmd: str, want_output: bool = False, want_newline=True + bash: pexpect.spawn, + cmd: str, + want_output: Optional[bool] = False, + want_newline=True, ) -> str: # Send command @@ -304,7 +316,7 @@ def assert_bash_exec( 'Unexpected output from "%s": exit status=%s, output="%s"' % (cmd, status, output) ) - else: + elif want_output is not None: assert not want_output, ( 'Expected output from "%s": exit status=%s, output="%s"' % (cmd, status, output) diff --git a/test/t/unit/test_unit_known_hosts_real.py b/test/t/unit/test_unit_known_hosts_real.py new file mode 100644 index 00000000000..838818a5b48 --- /dev/null +++ b/test/t/unit/test_unit_known_hosts_real.py @@ -0,0 +1,56 @@ +from itertools import chain + +import pytest + +from conftest import assert_bash_exec + + +@pytest.mark.bashcomp( + cmd=None, ignore_env="^[+-]COMP(REPLY|_KNOWN_HOSTS_WITH_HOSTFILE)=" +) +class TestUnitKnownHostsReal: + @pytest.mark.parametrize( + "prefix,colon_flag,hostfile", + [("", "", True), ("", "", False), ("user@", "c", True)], + ) + def test_basic( + self, bash, hosts, avahi_hosts, prefix, colon_flag, hostfile + ): + expected = ( + "%s%s%s" % (prefix, x, ":" if colon_flag else "") + for x in chain( + hosts if hostfile else avahi_hosts, + # fixtures/_known_hosts_real/config + "gee hus jar".split(), + # fixtures/_known_hosts_real/known_hosts + ( + "doo", + "ike", + "jub", + "10.0.0.1", + "kyl", + "100.0.0.2", + "10.10.0.3", + "blah", + "fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555", + "fe80::123:0xff:dead:beef%eth0", + "1111:2222:3333:4444:5555:6666:xxxx:abab", + "11xx:2222:3333:4444:5555:6666:xxxx:abab", + "::42", + ), + ) + ) + assert_bash_exec( + bash, + "unset -v COMP_KNOWN_HOSTS_WITH_HOSTFILE" + if hostfile + else "COMP_KNOWN_HOSTS_WITH_HOSTFILE=", + ) + output = assert_bash_exec( + bash, + "_known_hosts_real -a%sF _known_hosts_real/config '%s'; " + # TODO: why does printf instead of echo hang here? + 'echo "${COMPREPLY[@]}"; unset COMPREPLY' % (colon_flag, prefix), + want_output=True, + ) + assert sorted(output.split()) == sorted(expected) diff --git a/test/unit/_known_hosts_real.exp b/test/unit/_known_hosts_real.exp index 01b09b6b9bc..647bd659927 100644 --- a/test/unit/_known_hosts_real.exp +++ b/test/unit/_known_hosts_real.exp @@ -18,34 +18,6 @@ proc teardown {} { setup -set test "Hosts should be put in COMPREPLY" -set hosts [get_hosts -unsorted] -# Hosts `gee', `hus' and `jar' are defined in -# ./fixtures/_known_hosts_real/config -# doo, ike, jub, 10.0.0.1, kyl, 100.0.0.2, 10.10.0.3, blah, and bunch of IPv6 -# test cases in ./fixtures/_known_hosts_real/known_hosts -lappend hosts blah doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 10.10.0.3 fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555 fe80::123:0xff:dead:beef%eth0 1111:2222:3333:4444:5555:6666:xxxx:abab 11xx:2222:3333:4444:5555:6666:xxxx:abab ::42 -set cmd {unset COMPREPLY; _known_hosts_real -aF fixtures/_known_hosts_real/config ''; echo_array COMPREPLY} -assert_bash_list $hosts $cmd $test -sort -sync_after_int - -set test "Hosts should have username prefix and colon suffix" -set hosts [get_hosts -unsorted] -# Hosts `gee', `hus' and `jar' are defined in -# ./fixtures/_known_hosts_real/config -# doo, ike, jub, 10.0.0.1, kyl, 100.0.0.2, 10.10.0.3, blah, and bunch of IPv6 -# test cases in ./fixtures/_known_hosts_real/known_hosts -lappend hosts blah doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 10.10.0.3 fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555 fe80::123:0xff:dead:beef%eth0 1111:2222:3333:4444:5555:6666:xxxx:abab 11xx:2222:3333:4444:5555:6666:xxxx:abab ::42 -set hosts [lsort -ascii $hosts] -set expected {} -foreach host $hosts { - lappend expected "user@$host:" -} -# Call _known_hosts -set cmd {unset COMPREPLY; _known_hosts_real -acF fixtures/_known_hosts_real/config 'user@'; echo_array COMPREPLY} -assert_bash_list $expected $cmd $test -sort -sync_after_int - set test "Files containing consecutive spaces should work" set hosts [get_hosts -unsorted] set hosts_orig $hosts @@ -98,21 +70,6 @@ send "$cmd\r" expect -ex "$cmd\r\n/@" sync_after_int -set test "Empty COMP_KNOWN_HOSTS_WITH_HOSTFILE should omit HOSTFILE" -assert_bash_exec "COMP_KNOWN_HOSTS_WITH_HOSTFILE=" -set hosts [get_hosts_avahi] -# Hosts `gee', `hus' and `jar' are defined in -# ./fixtures/_known_hosts_real/config -# doo, ike, jub, 10.0.0.1, kyl, 100.0.0.2, 10.10.0.3, blah, and bunch of IPv6 -# test cases in ./fixtures/_known_hosts_real/known_hosts -lappend hosts blah doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 10.10.0.3 fd00:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:5555 fe80::123:0xff:dead:beef%eth0 1111:2222:3333:4444:5555:6666:xxxx:abab 11xx:2222:3333:4444:5555:6666:xxxx:abab ::42 -# Call _known_hosts -set cmd {unset COMPREPLY; _known_hosts_real -aF fixtures/_known_hosts_real/config ''; echo_array COMPREPLY} -assert_bash_list $hosts $cmd $test -sort -sync_after_int -assert_bash_exec "unset -v COMP_KNOWN_HOSTS_WITH_HOSTFILE" -sync_after_int - set test "Included config files should work" set hosts [get_hosts -unsorted] # Host 'recursion' is defined in From bd3d509f04fe6ca0ef9477293006fada716aebca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 5 Jan 2020 00:52:04 +0200 Subject: [PATCH 0326/1094] test: host helper lint and usage fixes --- test/t/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/t/conftest.py b/test/t/conftest.py index d557e6f07c1..540ae376b4c 100644 --- a/test/t/conftest.py +++ b/test/t/conftest.py @@ -93,7 +93,7 @@ def _avahi_hosts(bash: pexpect.spawn) -> List[str]: bash, "! type avahi-browse &>/dev/null || " "avahi-browse -cpr _workstation._tcp 2>/dev/null " - "| command grep ^= | cut -d\; -f7", + "| command grep ^= | cut -d';' -f7", want_output=None, ) return sorted(set(output.split())) @@ -104,7 +104,7 @@ def known_hosts(bash: pexpect.spawn) -> List[str]: output = assert_bash_exec( bash, # TODO: why does printf instead of echo hang here? - '_known_hosts_real; echo "${COMPREPLY[@]}"; unset COMPREPLY', + '_known_hosts_real ""; echo "${COMPREPLY[@]}"; unset COMPREPLY', want_output=True, ) return sorted(set(output.split())) From 5bb526a0b6f1af02b32464879c71a1fd5a5e4104 Mon Sep 17 00:00:00 2001 From: hugoziviani Date: Sun, 19 Jan 2020 11:41:34 +0000 Subject: [PATCH 0327/1094] cryptsetup: add luksChangeKey arg completion (#380) Adding a completion for cryptsetup luksChangeKey. This command accepts the same arguments as luksAddKey and luksRemoveKey and they all operate on keys in the luks header. Closes https://github.com/scop/bash-completion/issues/197 --- completions/cryptsetup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/cryptsetup b/completions/cryptsetup index f8be116fca2..3a822f09e61 100644 --- a/completions/cryptsetup +++ b/completions/cryptsetup @@ -66,7 +66,7 @@ _cryptsetup() ;; esac ;; - luksFormat|luksAddKey|luksRemoveKey) + luksFormat|luksAddKey|luksRemoveKey|luksChangeKey) case $args in 2) _cryptsetup_device From 399771d6f19d839069f0eb45001887a04231885e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 19 Jan 2020 19:23:45 +0200 Subject: [PATCH 0328/1094] tsig-keygen: new completion --- completions/Makefile.am | 1 + completions/tsig-keygen | 28 ++++++++++++++++++++++++++++ test/t/Makefile.am | 1 + test/t/test_tsig_keygen.py | 12 ++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 completions/tsig-keygen create mode 100644 test/t/test_tsig_keygen.py diff --git a/completions/Makefile.am b/completions/Makefile.am index 2f11c796a45..18cf6ae5fe5 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -411,6 +411,7 @@ bashcomp_DATA = 2to3 \ tox \ tracepath \ tshark \ + tsig-keygen \ tune2fs \ _udevadm \ ulimit \ diff --git a/completions/tsig-keygen b/completions/tsig-keygen new file mode 100644 index 00000000000..373c4f72585 --- /dev/null +++ b/completions/tsig-keygen @@ -0,0 +1,28 @@ +# tsig-keygen(8) completion -*- shell-script -*- + +_tsig_keygen() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -h) + return + ;; + -a) + COMPREPLY=( $(compgen -W 'hmac-{md5,sha{1,224,256,384,512}}' -- "$cur") ) + return + ;; + -r) + COMPREPLY=( $(compgen -W keyboard -- "$cur") ) + _filedir + return + ;; + esac + + [[ $cur != -* ]] || \ + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) +} && +complete -F _tsig_keygen tsig-keygen + +# ex: filetype=sh diff --git a/test/t/Makefile.am b/test/t/Makefile.am index 50757389f80..3040625b893 100644 --- a/test/t/Makefile.am +++ b/test/t/Makefile.am @@ -596,6 +596,7 @@ EXTRA_DIST = \ test_tr.py \ test_tracepath.py \ test_tshark.py \ + test_tsig_keygen.py \ test_tune2fs.py \ test_udevadm.py \ test_ulimit.py \ diff --git a/test/t/test_tsig_keygen.py b/test/t/test_tsig_keygen.py new file mode 100644 index 00000000000..fb516b310a7 --- /dev/null +++ b/test/t/test_tsig_keygen.py @@ -0,0 +1,12 @@ +import pytest + + +@pytest.mark.bashcomp(cmd="tsig-keygen") +class TestTsigKeygen: + @pytest.mark.complete("tsig-keygen ") + def test_basic(self, completion): + assert not completion + + @pytest.mark.complete("tsig-keygen -") + def test_options(self, completion): + assert completion From 3a0e9c1e78d33571f272d327c7f4fbb8dca250d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 19 Jan 2020 19:30:54 +0200 Subject: [PATCH 0329/1094] test/upgradepkg: port remaining test case to pytest+pexpect --- test/completion/upgradepkg.exp | 1 - test/lib/completions/upgradepkg.exp | 26 -------------------------- test/t/test_upgradepkg.py | 17 +++++++++++++++++ 3 files changed, 17 insertions(+), 27 deletions(-) delete mode 100644 test/completion/upgradepkg.exp delete mode 100644 test/lib/completions/upgradepkg.exp diff --git a/test/completion/upgradepkg.exp b/test/completion/upgradepkg.exp deleted file mode 100644 index 4b181a86a47..00000000000 --- a/test/completion/upgradepkg.exp +++ /dev/null @@ -1 +0,0 @@ -assert_source_completions upgradepkg diff --git a/test/lib/completions/upgradepkg.exp b/test/lib/completions/upgradepkg.exp deleted file mode 100644 index ffb4ba28c8d..00000000000 --- a/test/lib/completions/upgradepkg.exp +++ /dev/null @@ -1,26 +0,0 @@ -proc setup {} { - save_env -} - - -proc teardown {} { - assert_env_unmodified {/OLDPWD=/d} -} - - -setup - - -set test "should complete *.t\[gbxl\]z files and dirs after % sign" -set oldpkg "xx-2.0-i486-2" -set dir $::srcdir/fixtures/slackware/home -set files [split [exec bash -c "cd $dir && find . -mindepth 1 -maxdepth 1 \ - \\( -type d -printf '$oldpkg%%%P/\\n' \\) -o \ - \\( -type f -name '*.t\[bglx\]z' -printf '$oldpkg%%%P\\n' \\)"] "\n"] -assert_complete_dir $files "upgradepkg $oldpkg%" $dir $test - - -sync_after_int - - -teardown diff --git a/test/t/test_upgradepkg.py b/test/t/test_upgradepkg.py index 4c72a158169..87fe8e4c1e7 100644 --- a/test/t/test_upgradepkg.py +++ b/test/t/test_upgradepkg.py @@ -32,3 +32,20 @@ def test_4(self, completion): ] ) assert completion == expected + + @pytest.mark.complete("upgradepkg foo%", cwd="slackware/home") + def test_after_percent(self, completion): + expected = sorted( + [ + "%s/" % x + for x in os.listdir("slackware/home") + if os.path.isdir("./slackware/home/%s" % x) + ] + + [ + x + for x in os.listdir("slackware/home") + if os.path.isfile("./slackware/home/%s" % x) + and fnmatch.fnmatch(x, "*.t[bglx]z") + ] + ) + assert completion == ["foo%%%s" % x for x in expected] From 9f0ae306200cbf5cc6e62f72f77ea8a774ea41e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 19 Jan 2020 19:55:04 +0200 Subject: [PATCH 0330/1094] test/tsig-keygen: require command for test_options --- test/t/test_tsig_keygen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/t/test_tsig_keygen.py b/test/t/test_tsig_keygen.py index fb516b310a7..8c8a64ac070 100644 --- a/test/t/test_tsig_keygen.py +++ b/test/t/test_tsig_keygen.py @@ -7,6 +7,6 @@ class TestTsigKeygen: def test_basic(self, completion): assert not completion - @pytest.mark.complete("tsig-keygen -") + @pytest.mark.complete("tsig-keygen -", require_cmd=True) def test_options(self, completion): assert completion From 2f34e86d988733515e21b3050d4f4ab603b9adc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 19 Jan 2020 20:01:04 +0200 Subject: [PATCH 0331/1094] test/chown,sudo: parametrize special case test, improve xfail targeting --- test/t/test_chown.py | 29 ++++++++++++++++------------- test/t/test_sudo.py | 31 ++++++++++++++++--------------- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/test/t/test_chown.py b/test/t/test_chown.py index 37221cfa861..6ab9148dc8c 100644 --- a/test/t/test_chown.py +++ b/test/t/test_chown.py @@ -49,21 +49,24 @@ def test_6(self, bash, part_full_group): assert completion == "dot.user:%s" % full assert completion.output.endswith(" ") - @pytest.mark.xfail # TODO check escaping, whitespace - def test_7(self, bash, part_full_group): + @pytest.mark.parametrize( + "prefix", + [ + # TODO(xfails): check escaping, whitespace + pytest.param(r"funky\ user:", marks=pytest.mark.xfail), + "funky.user:", + pytest.param(r"funky\.user:", marks=pytest.mark.xfail), + pytest.param(r"fu\ nky.user:", marks=pytest.mark.xfail), + pytest.param(r"f\ o\ o\.\bar:", marks=pytest.mark.xfail), + pytest.param(r"foo\_b\ a\.r\ :", marks=pytest.mark.xfail), + ], + ) + def test_7(self, bash, part_full_group, prefix): """Test preserving special chars in $prefix$partgroup.""" part, full = part_full_group - for prefix in ( - r"funky\ user:", - "funky.user:", - r"funky\.user:", - r"fu\ nky.user:", - r"f\ o\ o\.\bar:", - r"foo\_b\ a\.r\ :", - ): - completion = assert_complete(bash, "chown %s%s" % (prefix, part)) - assert completion == "%s%s" % (prefix, full) - assert completion.output.endswith(" ") + completion = assert_complete(bash, "chown %s%s" % (prefix, part)) + assert completion == "%s%s" % (prefix, full) + assert completion.output.endswith(" ") def test_8(self, bash, part_full_user, part_full_group): """Test giving up on degenerate cases instead of spewing junk.""" diff --git a/test/t/test_sudo.py b/test/t/test_sudo.py index ced6662e56c..00509ce400e 100644 --- a/test/t/test_sudo.py +++ b/test/t/test_sudo.py @@ -48,23 +48,24 @@ def test_8(self, bash, part_full_group): assert completion == "dot.user:%s" % full assert completion.endswith(" ") - @pytest.mark.xfail # TODO check escaping, whitespace - def test_9(self, bash, part_full_group): + @pytest.mark.parametrize( + "prefix", + [ + # TODO(xfails): check escaping, whitespace + pytest.param(r"funky\ user:", marks=pytest.mark.xfail), + "funky.user:", + pytest.param(r"funky\.user:", marks=pytest.mark.xfail), + pytest.param(r"fu\ nky.user:", marks=pytest.mark.xfail), + pytest.param(r"f\ o\ o\.\bar:", marks=pytest.mark.xfail), + pytest.param(r"foo\_b\ a\.r\ :", marks=pytest.mark.xfail), + ], + ) + def test_9(self, bash, part_full_group, prefix): """Test preserving special chars in $prefix$partgroup.""" part, full = part_full_group - for prefix in ( - r"funky\ user:", - "funky.user:", - r"funky\.user:", - r"fu\ nky.user:", - r"f\ o\ o\.\bar:", - r"foo\_b\ a\.r\ :", - ): - completion = assert_complete( - bash, "sudo chown %s%s" % (prefix, part) - ) - assert completion == "%s%s" % (prefix, full) - assert completion.endswith(" ") + completion = assert_complete(bash, "sudo chown %s%s" % (prefix, part)) + assert completion == "%s%s" % (prefix, full) + assert completion.endswith(" ") def test_10(self, bash, part_full_user, part_full_group): """Test giving up on degenerate cases instead of spewing junk.""" From 8b3007f7315e7313add3518599ce44c288c48aa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 19 Jan 2020 20:09:12 +0200 Subject: [PATCH 0332/1094] test: remove some no longer needed old test suite code --- test/completion/chown.exp | 1 - test/completion/sudo.exp | 1 - test/lib/completions/chown.exp | 43 --------------------- test/lib/completions/sudo.exp | 42 --------------------- test/lib/library.exp | 68 ---------------------------------- 5 files changed, 155 deletions(-) delete mode 100644 test/completion/chown.exp delete mode 100644 test/completion/sudo.exp delete mode 100644 test/lib/completions/chown.exp delete mode 100644 test/lib/completions/sudo.exp diff --git a/test/completion/chown.exp b/test/completion/chown.exp deleted file mode 100644 index 53d497c25b0..00000000000 --- a/test/completion/chown.exp +++ /dev/null @@ -1 +0,0 @@ -assert_source_completions chown diff --git a/test/completion/sudo.exp b/test/completion/sudo.exp deleted file mode 100644 index 2a8015ff30e..00000000000 --- a/test/completion/sudo.exp +++ /dev/null @@ -1 +0,0 @@ -assert_source_completions sudo diff --git a/test/lib/completions/chown.exp b/test/lib/completions/chown.exp deleted file mode 100644 index 792d52a944a..00000000000 --- a/test/lib/completions/chown.exp +++ /dev/null @@ -1,43 +0,0 @@ -proc setup {} { - # fake root command to get all users/groups completed at least for now - assert_bash_exec {root_command=sudo} - save_env -} - -proc teardown {} { - assert_env_unmodified -} - - -setup - - -# Find user/group suitable for testing. -set failed_find_unique_completion 0 -foreach ug {user group} { - # compgen -A is used because it's a bash builtin and available everywhere. - # The || true part prevents exec from throwing an exception if nothing is - # found (very very unlikely). - set list [split [exec bash -c "compgen -A $ug || true"] "\n"] - if {![find_unique_completion_pair $list part$ug full$ug]} { - untested "Not running complex chown tests; no suitable test $ug found." - set failed_find_unique_completion 1 - } -} - -# These tests require an unique completion. -if {!$failed_find_unique_completion} { - - foreach prefix { - "funky\\ user:" "funky.user:" "funky\\.user:" "fu\\ nky.user:" - "f\\ o\\ o\\.\\bar:" "foo\\_b\\ a\\.r\\ :" - } { - set test "Check preserve special chars in $prefix$partgroup" - #assert_complete_into "chown $prefix$partgroup" "chown $prefix$fullgroup " $test - assert_complete $prefix$fullgroup "chown $prefix$partgroup" $test - sync_after_int - } -} - - -teardown diff --git a/test/lib/completions/sudo.exp b/test/lib/completions/sudo.exp deleted file mode 100644 index 73e485d69a8..00000000000 --- a/test/lib/completions/sudo.exp +++ /dev/null @@ -1,42 +0,0 @@ -proc setup {} { - save_env -} - - -proc teardown {} { - assert_env_unmodified {/OLDPWD/d} -} - - -setup - - -# Find user/group suitable for testing. -set failed_find_unique_completion 0 -foreach ug {user group} { - # compgen -A is used because it's a bash builtin and available everywhere. - # The || true part prevents exec from throwing an exception if nothing is - # found (very very unlikely). - set list [split [exec bash -c "compgen -A $ug || true"] "\n"] - if {![find_unique_completion_pair $list part$ug full$ug]} { - untested "Not running complex chown tests; no suitable test $ug found." - set failed_find_unique_completion 1 - } -} - -# These tests require an unique completion. -if {!$failed_find_unique_completion} { - - foreach prefix { - "funky\\ user:" "funky.user:" "funky\\.user:" "fu\\ nky.user:" - "f\\ o\\ o\\.\\bar:" "foo\\_b\\ a\\.r\\ :" - } { - set test "Check preserve special chars in $prefix$partgroup" - #assert_complete_into "chown $prefix$partgroup" "chown $prefix$fullgroup " $test - assert_complete $prefix$fullgroup "sudo chown $prefix$partgroup" $test - sync_after_int - } -} - - -teardown diff --git a/test/lib/library.exp b/test/lib/library.exp index d3be714dfd0..33e7b8f3c03 100644 --- a/test/lib/library.exp +++ b/test/lib/library.exp @@ -674,74 +674,6 @@ proc split_words_bash {line} { } -# Given a list of items this proc finds a (part, full) pair so that when -# completing from $part $full will be the only option. -# -# Arguments: -# list The list of full completions. -# partName Output parameter for the partial string. -# fullName Output parameter for the full string, member of item. -# -# Results: -# 1, or 0 if no suitable result was found. -proc find_unique_completion_pair {{list} {partName} {fullName}} { - upvar $partName part - upvar $fullName full - set bestscore 0 - # Uniquify the list, that's what completion does too. - set list [lsort -unique $list] - set n [llength $list] - for {set i 0} {$i < $n} {incr i} { - set cur [lindex $list $i] - set curlen [string length $cur] - - set prev [lindex $list [expr {$i - 1}]] - set next [lindex $list [expr {$i + 1}]] - set diffprev [expr {$prev == ""}] - set diffnext [expr {$next == ""}] - - # Analyse each item of the list and look for the minimum length of the - # partial prefix which is distinct from both $next and $prev. The list - # is sorted so the prefix will be unique in the entire list. - # - # In the worst case we analyse every character in the list 3 times. - # That's actually very fast, sorting could take more. - for {set j 0} {$j < $curlen} {incr j} { - set curchar [string index $cur $j] - if {!$diffprev && [string index $prev $j] != $curchar} { - set diffprev 1 - } - if {!$diffnext && [string index $next $j] != $curchar} { - set diffnext 1 - } - if {$diffnext && $diffprev} { - break - } - } - - # At the end of the loop $j is the index of last character of - # the unique partial prefix. The length is one plus that. - set parlen [expr {$j + 1}] - if {$parlen >= $curlen} { - continue - } - - # Try to find the most "readable pair"; look for a long pair where - # $part is about half of $full. - if {$parlen < $curlen / 2} { - set parlen [expr {$curlen / 2}] - } - set score [expr {$curlen - $parlen}] - if {$score > $bestscore} { - set bestscore $score - set part [string range $cur 0 [expr {$parlen - 1}]] - set full $cur - } - } - return [expr {$bestscore != 0}] -} - - # Start bash running as test environment. proc start_bash {} { global TESTDIR TOOL_EXECUTABLE spawn_id env srcdirabs From c23c8079fb1d78f03acb5c183b85264f6c9e06db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 19 Jan 2020 20:55:12 +0200 Subject: [PATCH 0333/1094] test/cd: convert remaining test case to pytest+pexpect --- test/completion/cd.exp | 1 - test/lib/completions/cd.exp | 31 ------------------------------- test/t/test_cd.py | 21 +++++++++++++++++++++ 3 files changed, 21 insertions(+), 32 deletions(-) delete mode 100644 test/completion/cd.exp delete mode 100644 test/lib/completions/cd.exp diff --git a/test/completion/cd.exp b/test/completion/cd.exp deleted file mode 100644 index 94c3c5982d7..00000000000 --- a/test/completion/cd.exp +++ /dev/null @@ -1 +0,0 @@ -assert_source_completions cd diff --git a/test/lib/completions/cd.exp b/test/lib/completions/cd.exp deleted file mode 100644 index ded094c31c3..00000000000 --- a/test/lib/completions/cd.exp +++ /dev/null @@ -1,31 +0,0 @@ -proc setup {} { - save_env -} - - -proc teardown {} { - assert_env_unmodified {/OLDPWD=/d} -} - - -setup - - -set test "Tab should complete cd at cursor position" - # Try completion -set cmd "cd $::srcdir/fixtures/shared/default/foo" -append cmd \002\002\002; # \002 = ^B = Move cursor left in bash emacs mode -#append cmd \033\0133D; # Escape-[-D = Cursor left -send "$cmd\t" -expect { - -re "cd $::srcdir/fixtures/shared/default/foo\b\b\b\r\n(\.svn/ +|)bar bar.d/ +foo.d/ *(\.svn/ *|)\r\n/@cd $::srcdir/fixtures/shared/default/foo\b\b\b$" { pass "$test" } - -re "^cd $::srcdir/fixtures/shared/default/foo\b\b\bfoo.d/foo\b\b\b$" { fail "$test: Wrong cursor position" } - -re /@ { unresolved "$test at prompt" } - default { unresolved "$test" } -} - - -sync_after_int - - -teardown diff --git a/test/t/test_cd.py b/test/t/test_cd.py index fd532312cf2..36f4dfbe0c2 100644 --- a/test/t/test_cd.py +++ b/test/t/test_cd.py @@ -1,5 +1,10 @@ +import re + +import pexpect import pytest +from conftest import MAGIC_MARK, PS1 + @pytest.mark.bashcomp(ignore_env=r"^\+CDPATH=$") class TestCd: @@ -20,3 +25,19 @@ def test_3(self, completion): ) def test_4(self, completion): assert not completion # No subdirs nor CDPATH + + def test_dir_at_point(self, bash): + cmd = "cd shared/default/foo\002\002\002" # \002 = ^B = cursor left + bash.send(cmd + "\t") + bash.expect_exact(cmd.replace("\002", "\b")) + bash.send(MAGIC_MARK) + got = bash.expect( + [ + r"\r\nbar bar\.d/\s+foo\.d/\r\n" + + re.escape(PS1 + cmd.replace("\002", "\b") + MAGIC_MARK) + + "foo\b\b\b", + pexpect.EOF, + pexpect.TIMEOUT, + ] + ) + assert got == 0 From a6cfbcdc729a640b1b89af4cd4c8f3d713d51a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 19 Jan 2020 22:33:39 +0200 Subject: [PATCH 0334/1094] test/cd: make dir_at_point produce better debuggable failures --- test/t/test_cd.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/test/t/test_cd.py b/test/t/test_cd.py index 36f4dfbe0c2..48826ffe17d 100644 --- a/test/t/test_cd.py +++ b/test/t/test_cd.py @@ -31,13 +31,8 @@ def test_dir_at_point(self, bash): bash.send(cmd + "\t") bash.expect_exact(cmd.replace("\002", "\b")) bash.send(MAGIC_MARK) - got = bash.expect( - [ - r"\r\nbar bar\.d/\s+foo\.d/\r\n" - + re.escape(PS1 + cmd.replace("\002", "\b") + MAGIC_MARK) - + "foo\b\b\b", - pexpect.EOF, - pexpect.TIMEOUT, - ] + bash.expect( + r"\r\nbar bar\.d/\s+foo\.d/\r\n" + + re.escape(PS1 + cmd.replace("\002", "\b") + MAGIC_MARK) + + "foo\b\b\b" ) - assert got == 0 From e99577a3e7f7c571a61074242ab21e0245bfe3dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 20 Jan 2020 18:35:12 +0200 Subject: [PATCH 0335/1094] nmap: parse options from -h output Closes https://github.com/scop/bash-completion/pull/382 --- completions/nmap | 34 +++++----- test/fixtures/nmap/nmap-h.txt | 114 ++++++++++++++++++++++++++++++++++ test/t/test_nmap.py | 39 +++++++++++- 3 files changed, 169 insertions(+), 18 deletions(-) create mode 100644 test/fixtures/nmap/nmap-h.txt diff --git a/completions/nmap b/completions/nmap index b4e76baf92c..41e063801b2 100644 --- a/completions/nmap +++ b/completions/nmap @@ -25,22 +25,24 @@ _nmap() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '-iL -iR --exclude --excludefile -sL -sP -PN - -PS -PA -PU -PY -PE -PP -PM -PO -n -R --dns-servers --system-dns - --traceroute -sS -sT -sA -sW -sM -sU -sN -sF -sX --scanflags -sI - -sY -sZ -sO -b -p -F -r --top-ports --port-ratio -sV - --version-intensity --version-light --version-all --version-trace - -sC --script= --script-args= --script-trace --script-updatedb -O - --osscan-limit --osscan-guess -T0 -T1 -T2 -T3 -T4 -T5 - --min-hostgroup --max-hostgroup --min-parallelism --max-parallelism - --min-rtt-timeout --max-rtt-timeout --initial-rtt-timeout - --max-retries --host-timeout --scan-delay --max-scan-delay - --min-rate --max-rate -f --mtu -D -S -e --source-port --data-length - --ip-options --ttl --spoof-mac --badsum --adler32 -oN -oX -oS -oG - -oA -v -d --reason --open --packet-trace --iflist --log-errors - --append-output --resume --stylesheet --webxml --no-stylesheet -6 - -A --datadir --send-eth --send-ip --privilege--unprivileged -V - -h' -- "$cur") ) + # strip everything following a :, inclusive + # strip everything following a =, exclusive + # expand -X; -Y to -X -Y each on own line + # expand -X/-Y/-Z to -X -Y -Z each on own line + # expand -X/Y/Z to -X -Y -Z each on own line + # expand --foo/bar to --foo --bar each on own line + # strip everything following a non-option name or = char + # TODO: should expand -T<0-5> to -T0 ... -T5 each on own line + COMPREPLY=( $(compgen -W '$("$1" --help 2>&1 | command sed \ + -e "s/:.*$//" \ + -e "s/=.*$/=/" \ + -e "s/;[[:space:]]*-/\n-/g" \ + -e "s/\/-/\n-/g" \ + -e "/^[[:space:]]*-[^-]/s/\/\([^-]\)/\n -\1/g" \ + -e "/^[[:space:]]*--/s/\/\([^-]\)/\n --\1/g" \ + -e "s/[^[:space:]a-zA-Z0-9=-].*$//" \ + )' \ + -- "$cur") ) else _known_hosts_real -- "$cur" fi diff --git a/test/fixtures/nmap/nmap-h.txt b/test/fixtures/nmap/nmap-h.txt new file mode 100644 index 00000000000..0301d3742c1 --- /dev/null +++ b/test/fixtures/nmap/nmap-h.txt @@ -0,0 +1,114 @@ +Nmap 7.60 ( https://nmap.org ) +Usage: nmap [Scan Type(s)] [Options] {target specification} +TARGET SPECIFICATION: + Can pass hostnames, IP addresses, networks, etc. + Ex: scanme.nmap.org, microsoft.com/24, 192.168.0.1; 10.0.0-255.1-254 + -iL : Input from list of hosts/networks + -iR : Choose random targets + --exclude : Exclude hosts/networks + --excludefile : Exclude list from file +HOST DISCOVERY: + -sL: List Scan - simply list targets to scan + -sn: Ping Scan - disable port scan + -Pn: Treat all hosts as online -- skip host discovery + -PS/PA/PU/PY[portlist]: TCP SYN/ACK, UDP or SCTP discovery to given ports + -PE/PP/PM: ICMP echo, timestamp, and netmask request discovery probes + -PO[protocol list]: IP Protocol Ping + -n/-R: Never do DNS resolution/Always resolve [default: sometimes] + --dns-servers : Specify custom DNS servers + --system-dns: Use OS's DNS resolver + --traceroute: Trace hop path to each host +SCAN TECHNIQUES: + -sS/sT/sA/sW/sM: TCP SYN/Connect()/ACK/Window/Maimon scans + -sU: UDP Scan + -sN/sF/sX: TCP Null, FIN, and Xmas scans + --scanflags : Customize TCP scan flags + -sI : Idle scan + -sY/sZ: SCTP INIT/COOKIE-ECHO scans + -sO: IP protocol scan + -b : FTP bounce scan +PORT SPECIFICATION AND SCAN ORDER: + -p : Only scan specified ports + Ex: -p22; -p1-65535; -p U:53,111,137,T:21-25,80,139,8080,S:9 + --exclude-ports : Exclude the specified ports from scanning + -F: Fast mode - Scan fewer ports than the default scan + -r: Scan ports consecutively - don't randomize + --top-ports : Scan most common ports + --port-ratio : Scan ports more common than +SERVICE/VERSION DETECTION: + -sV: Probe open ports to determine service/version info + --version-intensity : Set from 0 (light) to 9 (try all probes) + --version-light: Limit to most likely probes (intensity 2) + --version-all: Try every single probe (intensity 9) + --version-trace: Show detailed version scan activity (for debugging) +SCRIPT SCAN: + -sC: equivalent to --script=default + --script=: is a comma separated list of + directories, script-files or script-categories + --script-args=: provide arguments to scripts + --script-args-file=filename: provide NSE script args in a file + --script-trace: Show all data sent and received + --script-updatedb: Update the script database. + --script-help=: Show help about scripts. + is a comma-separated list of script-files or + script-categories. +OS DETECTION: + -O: Enable OS detection + --osscan-limit: Limit OS detection to promising targets + --osscan-guess: Guess OS more aggressively +TIMING AND PERFORMANCE: + Options which take