Added version flag #169
Added version flag #169
Changes from 14 commits
39424d5
1878641
2504baa
0b41a26
9a41bd4
190a114
74bb00f
5d63a9b
eda91b2
5004abf
199074d
1846600
08a4268
75b6ed1
71a299c
da9ca80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,29 @@ | ||||||
package main | ||||||
|
||||||
import ( | ||||||
"flag" | ||||||
"fmt" | ||||||
|
||||||
"go.coder.com/cli" | ||||||
) | ||||||
|
||||||
var version string | ||||||
|
||||||
type versioncmd struct { | ||||||
print bool | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this variable is used There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought that I was going to use it but did not. Will remove it. |
||||||
} | ||||||
|
||||||
func (v *versioncmd) Spec() cli.CommandSpec { | ||||||
return cli.CommandSpec{ | ||||||
Name: "version", | ||||||
Desc: fmt.Sprintf("Retrieve the current version"), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should end with a period |
||||||
} | ||||||
} | ||||||
|
||||||
func (v *versioncmd) RegisterFlags(fl *flag.FlagSet) { | ||||||
fl.BoolVar(&v.print, "print", false, "Print the current version of Sail") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
|
||||||
func (v *versioncmd) Run(fl *flag.FlagSet) { | ||||||
fmt.Printf("Sail version: %s", version) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should just print the version so |
||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this populated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ci/build.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh, duh