We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b4c96b commit b6acdecCopy full SHA for b6acdec
cli/completion/completion.go
@@ -47,13 +47,13 @@ func NewCommand() *cobra.Command {
47
}
48
49
func run(cmd *cobra.Command, args []string) {
50
- if completionNoDesc && (args[0] == "bash"||args[0] =="powershell") {
+ if completionNoDesc && (args[0] == "powershell") {
51
feedback.Errorf(tr("Error: command description is not supported by %v"), args[0])
52
os.Exit(errorcodes.ErrGeneric)
53
54
switch args[0] {
55
case "bash":
56
- cmd.Root().GenBashCompletion(os.Stdout)
+ cmd.Root().GenBashCompletionV2(os.Stdout, !completionNoDesc)
57
break
58
case "zsh":
59
if completionNoDesc {
test/test_completion.py
@@ -25,7 +25,7 @@ def test_completion_bash(run_command):
25
result = run_command("completion bash")
26
assert result.ok
27
assert result.stderr == ""
28
- assert "_arduino-cli_root_command()" in result.stdout
+ assert "# bash completion V2 for arduino-cli" in result.stdout
29
assert "__start_arduino-cli()" in result.stdout
30
31
@@ -55,9 +55,11 @@ def test_completion_powershell(run_command):
def test_completion_bash_no_desc(run_command):
result = run_command("completion bash --no-descriptions")
- assert not result.ok
- assert result.stdout == ""
60
- assert "Error: command description is not supported by bash" in result.stderr
+ assert result.ok
+ assert result.stderr == ""
61
+ assert "__start_arduino-cli()" in result.stdout
62
+ assert "__completeNoDesc" in result.stdout
63
64
65
def test_completion_zsh_no_desc(run_command):
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments