added getting ENV vars from Vault
This commit is contained in:
@ -16,15 +16,20 @@ var (
|
||||
Run: version,
|
||||
}
|
||||
numOnly bool
|
||||
vPre bool
|
||||
)
|
||||
|
||||
func version(cmd *cobra.Command, args []string) {
|
||||
|
||||
cmd.PersistentFlags().BoolVarP(&numOnly, "num", "n", true, "Output the version number only.")
|
||||
if numOnly {
|
||||
cmd.PersistentFlags().BoolVarP(&vPre, "vpre", "V", false, "Output the version with v prefixed.")
|
||||
|
||||
if numOnly && !vPre {
|
||||
fmt.Printf("%s\n", versionStr)
|
||||
} else if vPre {
|
||||
fmt.Printf("v%s", versionStr)
|
||||
} else {
|
||||
fmt.Printf("Version: %s", versionStr)
|
||||
fmt.Printf("Backy version: %s", versionStr)
|
||||
}
|
||||
|
||||
os.Exit(0)
|
||||
|
Reference in New Issue
Block a user