Skip to content
Merged
Prev Previous commit
Next Next commit
revert "#compdef" patch
  • Loading branch information
umbynos committed Jun 8, 2020
commit 054ae56ece30fe2c801df4fda0c2e564b1b78e17
3 changes: 1 addition & 2 deletions cli/completion/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ func run(cmd *cobra.Command, args []string) {
case "zsh":
buf := new(bytes.Buffer)
cmd.Root().GenZshCompletion(buf)
s := strings.Replace(buf.String(), "#", "", 1) //remove the comment from compdef
r := strings.NewReplacer("[", "\\[", "]", "\\]") //insert escaping before [ and ]
s = r.Replace(s)
s := r.Replace(buf.String())
s = strings.ReplaceAll(s, "\\[1\\]", "[1]") // revert the case
os.Stdout.WriteString(s)
break
Expand Down