Skip to content

Commit 330a659

Browse files
committed
removed hack spf13/cobra#1121
1 parent deadcb0 commit 330a659

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

cli/completion/completion.go

+1-7
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
package completion
1717

1818
import (
19-
"bytes"
2019
"os"
21-
"strings"
2220

2321
"github.com/arduino/arduino-cli/cli/errorcodes"
2422
"github.com/arduino/arduino-cli/cli/feedback"
@@ -62,11 +60,7 @@ func run(cmd *cobra.Command, args []string) {
6260
}
6361
break
6462
case "fish":
65-
buf := new(bytes.Buffer)
66-
cmd.Root().GenFishCompletion(buf, !completionNoDesc)
67-
// Next 2 lines are Hack, fixed here https://github.com/spf13/cobra/pull/1122
68-
s := strings.ReplaceAll(buf.String(), "arduino-cli_comp", "arduino_cli_comp") //required because fish does not support env variables with "-" in the name
69-
os.Stdout.WriteString(s)
63+
cmd.Root().GenFishCompletion(os.Stdout, !completionNoDesc)
7064
break
7165
}
7266
}

0 commit comments

Comments
 (0)