Skip to content

Fix zsh completion #892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 10, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
removed hack spf13/cobra#1121
  • Loading branch information
umbynos committed Aug 10, 2020
commit 98d6387076b92f79b2a4d80b18eafe13ea4c57a4
8 changes: 1 addition & 7 deletions cli/completion/completion.go
Original file line number Diff line number Diff line change
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
}
}