added getting ENV vars from Vault
This commit is contained in:
@ -31,8 +31,10 @@ func init() {
|
||||
func Backup(cmd *cobra.Command, args []string) {
|
||||
backyConfOpts := backy.NewOpts(cfgFile, backy.AddCommandLists(cmdLists))
|
||||
backyConfOpts.InitConfig()
|
||||
|
||||
config := backy.ReadConfig(backyConfOpts)
|
||||
config.RunBackyConfig("")
|
||||
|
||||
config.RunBackyConfig("", backyConfOpts)
|
||||
for _, host := range config.Hosts {
|
||||
if host.SshClient != nil {
|
||||
host.SshClient.Close()
|
||||
|
@ -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