Skip to content

Commit

Permalink
feat: show version when --version option is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
kyu08 committed Dec 2, 2024
1 parent 5e463b4 commit 06489d9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Binary file added fzf-bookmark-opener
Binary file not shown.
15 changes: 15 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"path"
"path/filepath"
"runtime/debug"

"github.com/go-yaml/yaml"
"github.com/ktr0731/go-fuzzyfinder"
Expand Down Expand Up @@ -35,6 +36,20 @@ type Bookmark struct {
}

func main() {
if 2 < len(os.Args) {
fmt.Println("too many arguments")
return
}

if len(os.Args) == 2 && os.Args[1] == "--version" {
bi, ok := debug.ReadBuildInfo()
if !ok {
return
}
fmt.Println(bi.Main.Version)
return
}

// initで設定ファイルの作成
homeDir, err := os.UserHomeDir()
if err != nil {
Expand Down

0 comments on commit 06489d9

Please sign in to comment.