File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import (
1616 "os"
1717 "path/filepath"
1818 "runtime"
19+ "runtime/debug"
1920 "strconv"
2021 "strings"
2122 "time"
@@ -41,7 +42,18 @@ import (
4142 "gopkg.in/yaml.v3"
4243)
4344
44- const Version = "v0.11.0"
45+ const versionBase = "v0.11.0"
46+
47+ var Version = func () string {
48+ if info , ok := debug .ReadBuildInfo (); ok {
49+ for _ , s := range info .Settings {
50+ if s .Key == "vcs.revision" && len (s .Value ) >= 7 {
51+ return fmt .Sprintf ("%s (%s)" , versionBase , s .Value [:7 ])
52+ }
53+ }
54+ }
55+ return versionBase
56+ }()
4557
4658var (
4759 cliErrorStyle = lipgloss .NewStyle ().Foreground (lipgloss .Color ("9" )).Bold (true )
7284var rootCmd = & cobra.Command {
7385 Use : "hister" ,
7486 Short : "Your own search engine" ,
75- Long : "hister - your own search engine" ,
87+ Long : "Hister - your own search engine" ,
7688 Version : Version ,
7789 //Run: func(_ *cobra.Command, _ []string) {
7890 //},
You can’t perform that action at this time.
0 commit comments