File tree 2 files changed +8
-6
lines changed
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -47,13 +47,13 @@ func NewCommand() *cobra.Command {
47
47
}
48
48
49
49
func run (cmd * cobra.Command , args []string ) {
50
- if completionNoDesc && (args [0 ] == "bash" || args [ 0 ] == " powershell" ) {
50
+ if completionNoDesc && (args [0 ] == "powershell" ) {
51
51
feedback .Errorf (tr ("Error: command description is not supported by %v" ), args [0 ])
52
52
os .Exit (errorcodes .ErrGeneric )
53
53
}
54
54
switch args [0 ] {
55
55
case "bash" :
56
- cmd .Root ().GenBashCompletion (os .Stdout )
56
+ cmd .Root ().GenBashCompletionV2 (os .Stdout , ! completionNoDesc )
57
57
break
58
58
case "zsh" :
59
59
if completionNoDesc {
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ def test_completion_bash(run_command):
25
25
result = run_command ("completion bash" )
26
26
assert result .ok
27
27
assert result .stderr == ""
28
- assert "_arduino-cli_root_command() " in result .stdout
28
+ assert "# bash completion V2 for arduino-cli " in result .stdout
29
29
assert "__start_arduino-cli()" in result .stdout
30
30
31
31
@@ -55,9 +55,11 @@ def test_completion_powershell(run_command):
55
55
56
56
def test_completion_bash_no_desc (run_command ):
57
57
result = run_command ("completion bash --no-descriptions" )
58
- assert not result .ok
59
- assert result .stdout == ""
60
- assert "Error: command description is not supported by bash" in result .stderr
58
+ assert result .ok
59
+ assert result .stderr == ""
60
+ assert "# bash completion V2 for arduino-cli" in result .stdout
61
+ assert "__start_arduino-cli()" in result .stdout
62
+ assert "__completeNoDesc" in result .stdout
61
63
62
64
63
65
def test_completion_zsh_no_desc (run_command ):
You can’t perform that action at this time.
0 commit comments