diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2017-06-02 17:57:28 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2017-06-02 17:59:12 +0900 |
commit | 83e9af6601f2a7b7fc0fff06fc6767b7054a5467 (patch) | |
tree | ac014e169ae994f3ff433f6b2476d0f352f153e8 /src | |
parent | 8bbf9335e13f4d56fd7008757d4a9ead34e6381c (diff) |
Add git revision to --version output
Diffstat (limited to 'src')
-rw-r--r-- | src/core.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core.go b/src/core.go index 2b91ab6e..6c3b321e 100644 --- a/src/core.go +++ b/src/core.go @@ -43,12 +43,16 @@ Matcher -> EvtHeader -> Terminal (update header) */ // Run starts fzf -func Run(opts *Options) { +func Run(opts *Options, revision string) { sort := opts.Sort > 0 sortCriteria = opts.Criteria if opts.Version { - fmt.Println(version) + if len(revision) > 0 { + fmt.Printf("%s (%s)\n", version, revision) + } else { + fmt.Println(version) + } os.Exit(exitOk) } |