added getting ENV vars from Vault

This commit is contained in:
2023-05-12 00:42:14 -05:00
parent f7676e73ba
commit 5e7c52997c
10 changed files with 387 additions and 61 deletions

View File

@ -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()

View File

@ -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)