File tree 2 files changed +20
-18
lines changed
2 files changed +20
-18
lines changed Original file line number Diff line number Diff line change @@ -79,21 +79,22 @@ __gtar_parse_help_opt()
79
79
80
80
__gtar_parse_help_line ()
81
81
{
82
- local i
83
-
84
- for i in $1 ; do
85
- case " $i " in
86
- # regular options
87
- --* | -* )
88
- __gtar_parse_help_opt " $i " " $2 "
89
- ;;
90
-
91
- # end once there is single non-option word
92
- * )
93
- break
94
- ;;
95
- esac
96
- done
82
+ local -a tmp
83
+ while read -ra tmp; do
84
+ for i in " ${tmp[@]} " ; do
85
+ case " $i " in
86
+ # regular options
87
+ --* | -* )
88
+ __gtar_parse_help_opt " $i " " $2 "
89
+ ;;
90
+
91
+ # end once there is single non-option word
92
+ * )
93
+ break
94
+ ;;
95
+ esac
96
+ done
97
+ done <<< " $1"
97
98
}
98
99
99
100
__gnu_tar_parse_help ()
Original file line number Diff line number Diff line change 5
5
from conftest import assert_bash_exec
6
6
7
7
8
- @pytest .mark .bashcomp (ignore_env = r"^-declare -f _tar$" )
8
+ @pytest .mark .bashcomp (ignore_env = r"^-declare -f _tar$||shopt -. failglob " )
9
9
class TestTar :
10
10
@pytest .fixture (scope = "class" )
11
11
def gnu_tar (self , bash ):
12
12
got = assert_bash_exec (bash , "tar --version || :" , want_output = True )
13
13
if not re .search (r"\bGNU " , got ):
14
14
pytest .skip ("Not GNU tar" )
15
15
16
- @pytest .mark .complete ("tar " )
17
- def test_1 (self , completion ):
16
+ @pytest .mark .complete ("tar " , pre_cmds = ( "shopt -s failglob" ,) )
17
+ def test_1 (self , bash , completion ):
18
18
assert completion
19
+ assert_bash_exec (bash , "shopt -u failglob" )
19
20
20
21
# Test "f" when mode is not as first option
21
22
@pytest .mark .complete ("tar zfc " , cwd = "tar" )
You can’t perform that action at this time.
0 commit comments