Skip to content

Commit

Permalink
Add end marker
Browse files Browse the repository at this point in the history
  • Loading branch information
junegunn committed Mar 13, 2024
1 parent a47dce5 commit 2b26315
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
_ "embed"
"fmt"
"strings"

fzf "github.com/junegunn/fzf/src"
"github.com/junegunn/fzf/src/protector"
Expand All @@ -26,26 +27,27 @@ var zshCompletion []byte
//go:embed shell/key-bindings.fish
var fishKeyBindings []byte

func printScript(label string, content []byte) {
fmt.Println("### " + label + " ###")
fmt.Println(strings.TrimSpace(string(content)))
fmt.Println("### end: " + label + " ###")
}

func main() {
protector.Protect()
options := fzf.ParseOptions()
if options.Bash {
fmt.Println("### key-bindings.bash ###")
fmt.Println(string(bashKeyBindings))
fmt.Println("### completion.bash ###")
fmt.Println(string(bashCompletion))
printScript("key-bindings.bash", bashKeyBindings)
printScript("completion.bash", bashCompletion)
return
}
if options.Zsh {
fmt.Println("### key-bindings.zsh ###")
fmt.Println(string(zshKeyBindings))
fmt.Println("### completion.zsh ###")
fmt.Println(string(zshCompletion))
printScript("key-bindings.zsh", zshKeyBindings)
printScript("completion.zsh", zshCompletion)
return
}
if options.Fish {
fmt.Println("### key-bindings.fish ###")
fmt.Println(string(fishKeyBindings))
printScript("key-bindings.fish", fishKeyBindings)
fmt.Println("fzf_key_bindings")
return
}
Expand Down

0 comments on commit 2b26315

Please sign in to comment.