Skip to content

Commit

Permalink
removed hack spf13/cobra#1121
Browse files Browse the repository at this point in the history
  • Loading branch information
umbynos committed Aug 10, 2020
1 parent 6a3554b commit 98d6387
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions cli/completion/completion.go
Expand Up @@ -16,9 +16,7 @@
package completion

import (
"bytes"
"os"
"strings"

"github.com/arduino/arduino-cli/cli/errorcodes"
"github.com/arduino/arduino-cli/cli/feedback"
Expand Down Expand Up @@ -63,11 +61,7 @@ func run(cmd *cobra.Command, args []string) {
}
break
case "fish":
buf := new(bytes.Buffer)
cmd.Root().GenFishCompletion(buf, !completionNoDesc)
// Next 2 lines are Hack, fixed here https://github.com/spf13/cobra/pull/1122
s := strings.ReplaceAll(buf.String(), "arduino-cli_comp", "arduino_cli_comp") //required because fish does not support env variables with "-" in the name
os.Stdout.WriteString(s)
cmd.Root().GenFishCompletion(os.Stdout, !completionNoDesc)
break
}
}

0 comments on commit 98d6387

Please sign in to comment.