Skip to content

Commit 98d6387

Browse files
committed
removed hack spf13/cobra#1121
1 parent 6a3554b commit 98d6387

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"
@@ -63,11 +61,7 @@ func run(cmd *cobra.Command, args []string) {
6361
}
6462
break
6563
case "fish":
66-
buf := new(bytes.Buffer)
67-
cmd.Root().GenFishCompletion(buf, !completionNoDesc)
68-
// Next 2 lines are Hack, fixed here https://github.com/spf13/cobra/pull/1122
69-
s := strings.ReplaceAll(buf.String(), "arduino-cli_comp", "arduino_cli_comp") //required because fish does not support env variables with "-" in the name
70-
os.Stdout.WriteString(s)
64+
cmd.Root().GenFishCompletion(os.Stdout, !completionNoDesc)
7165
break
7266
}
7367
}

0 commit comments

Comments
 (0)