mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
Initial implementation of config file
This commit is contained in:
parent
1db4349eb0
commit
2baae37f5f
9 changed files with 672 additions and 19 deletions
|
|
@ -5,6 +5,7 @@ import (
|
|||
"github.com/bikeshack/magellan/internal/log"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
@ -78,5 +79,18 @@ func init() {
|
|||
updateCmd.Flags().StringVar(&component, "component", "", "set the component to upgrade")
|
||||
updateCmd.Flags().BoolVar(&withSecureTLS, "secure-tls", false, "enable secure TLS")
|
||||
updateCmd.Flags().BoolVar(&status, "status", false, "get the status of the update")
|
||||
|
||||
viper.BindPFlag("bmc-host", updateCmd.Flags().Lookup("bmc-host"))
|
||||
viper.BindPFlag("bmc-port", updateCmd.Flags().Lookup("bmc-port"))
|
||||
viper.BindPFlag("user", updateCmd.Flags().Lookup("user"))
|
||||
viper.BindPFlag("pass", updateCmd.Flags().Lookup("pass"))
|
||||
viper.BindPFlag("transfer-protocol", updateCmd.Flags().Lookup("transfer-protocol"))
|
||||
viper.BindPFlag("protocol", updateCmd.Flags().Lookup("protocol"))
|
||||
viper.BindPFlag("firmware-url", updateCmd.Flags().Lookup("firmware-url"))
|
||||
viper.BindPFlag("firmware-version", updateCmd.Flags().Lookup("firmware-version"))
|
||||
viper.BindPFlag("component", updateCmd.Flags().Lookup("component"))
|
||||
viper.BindPFlag("secure-tls", updateCmd.Flags().Lookup("secure-tls"))
|
||||
viper.BindPFlag("status", updateCmd.Flags().Lookup("status"))
|
||||
|
||||
rootCmd.AddCommand(updateCmd)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue