summaryrefslogtreecommitdiffstats
path: root/src/core.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2017-06-02 17:57:28 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2017-06-02 17:59:12 +0900
commit83e9af6601f2a7b7fc0fff06fc6767b7054a5467 (patch)
treeac014e169ae994f3ff433f6b2476d0f352f153e8 /src/core.go
parent8bbf9335e13f4d56fd7008757d4a9ead34e6381c (diff)
Add git revision to --version output
Diffstat (limited to 'src/core.go')
-rw-r--r--src/core.go8
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)
}