File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ package main
44
55import "os"
66import "fmt"
7- import "path/filepath"
87import "io"
98import "net/http"
109import "strconv"
@@ -16,7 +15,7 @@ import "github.com/gesquive/fast-cli/fast"
1615import "github.com/gesquive/fast-cli/format"
1716import "github.com/gesquive/fast-cli/meters"
1817
19- var version = "v0.2.6 "
18+ var version = "v0.2.7 "
2019var dirty = ""
2120var displayVersion string
2221
@@ -34,8 +33,7 @@ var RootCmd = &cobra.Command{
3433}
3534
3635func main () {
37- displayVersion = fmt .Sprintf ("%s %s%s" ,
38- filepath .Base (os .Args [0 ]),
36+ displayVersion = fmt .Sprintf ("fast-cli %s%s" ,
3937 version ,
4038 dirty )
4139 Execute (displayVersion )
@@ -45,6 +43,8 @@ func main() {
4543// This is called by main.main(). It only needs to happen once to the rootCmd.
4644func Execute (version string ) {
4745 displayVersion = version
46+ RootCmd .SetHelpTemplate (fmt .Sprintf ("%s\n Version:\n github.com/gesquive/%s\n " ,
47+ RootCmd .HelpTemplate (), displayVersion ))
4848 if err := RootCmd .Execute (); err != nil {
4949 fmt .Println (err )
5050 os .Exit (- 1 )
You can’t perform that action at this time.
0 commit comments