mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
version: more small tweaks
This commit is contained in:
parent
3aaa7c4f1d
commit
26522ebd12
2 changed files with 11 additions and 10 deletions
|
|
@ -14,16 +14,17 @@ var (
|
|||
)
|
||||
|
||||
var versionCmd = &cobra.Command{
|
||||
Use: "version",
|
||||
Use: "version",
|
||||
Short: "Print version info and exit",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if cmd.Flag("commit").Value.String() == "true" {
|
||||
output = commit
|
||||
if date != "" {
|
||||
output += " built @ " + date
|
||||
output += " built on " + date
|
||||
}
|
||||
fmt.Println(output)
|
||||
} else {
|
||||
fmt.Println(version)
|
||||
fmt.Printf("%s-%s\n", version, commit)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue