@@ -23,9 +23,9 @@ var VersionCmd = &cmds.Command{
23
23
},
24
24
25
25
Options : []cmds.Option {
26
- cmds .BoolOption ("number" , "n" , "Only show the version number." ),
27
- cmds .BoolOption ("commit" , "Show the commit hash." ),
28
- cmds .BoolOption ("repo" , "Show repo version." ),
26
+ cmds .BoolOption ("number" , "n" , "Only show the version number." ). Default ( false ) ,
27
+ cmds .BoolOption ("commit" , "Show the commit hash." ). Default ( false ) ,
28
+ cmds .BoolOption ("repo" , "Show repo version." ). Default ( false ) ,
29
29
},
30
30
Run : func (req cmds.Request , res cmds.Response ) {
31
31
res .SetOutput (& VersionOutput {
@@ -47,20 +47,20 @@ var VersionCmd = &cmds.Command{
47
47
return strings .NewReader (v .Repo + "\n " ), nil
48
48
}
49
49
50
- commit , found , err := res .Request ().Option ("commit" ).Bool ()
50
+ commit , _ , err := res .Request ().Option ("commit" ).Bool ()
51
51
commitTxt := ""
52
52
if err != nil {
53
53
return nil , err
54
54
}
55
- if found && commit {
55
+ if commit {
56
56
commitTxt = "-" + v .Commit
57
57
}
58
58
59
- number , found , err := res .Request ().Option ("number" ).Bool ()
59
+ number , _ , err := res .Request ().Option ("number" ).Bool ()
60
60
if err != nil {
61
61
return nil , err
62
62
}
63
- if found && number {
63
+ if number {
64
64
return strings .NewReader (fmt .Sprintln (v .Version + commitTxt )), nil
65
65
}
66
66
0 commit comments