mirror of
https://gitlab.com/psuapp/psu.git
synced 2024-08-30 18:12:34 +00:00
Format code
This commit is contained in:
parent
d770da7414
commit
a22aaa20f5
@ -12,8 +12,8 @@ import (
|
||||
|
||||
// configCmd represents the config command
|
||||
var configCmd = &cobra.Command{
|
||||
Use: "config KEY [VALUE]",
|
||||
Short: "Get and set configuration options",
|
||||
Use: "config KEY [VALUE]",
|
||||
Short: "Get and set configuration options",
|
||||
Example: "psu config user admin",
|
||||
Args: cobra.MinimumNArgs(1),
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
@ -46,7 +46,7 @@ func init() {
|
||||
rootCmd.AddCommand(configCmd)
|
||||
}
|
||||
|
||||
func loadCofig () (*viper.Viper, error) {
|
||||
func loadCofig() (*viper.Viper, error) {
|
||||
// Set config file name
|
||||
var configFile string
|
||||
if viper.ConfigFileUsed() != "" {
|
||||
@ -74,7 +74,7 @@ func loadCofig () (*viper.Viper, error) {
|
||||
}
|
||||
|
||||
func getConfig(key string) (interface{}, error) {
|
||||
newViper, configLoadingErr := loadCofig ()
|
||||
newViper, configLoadingErr := loadCofig()
|
||||
if configLoadingErr != nil {
|
||||
return nil, configLoadingErr
|
||||
}
|
||||
@ -83,7 +83,7 @@ func getConfig(key string) (interface{}, error) {
|
||||
}
|
||||
|
||||
func setConfig(key string, value string) error {
|
||||
newViper, configLoadingErr := loadCofig ()
|
||||
newViper, configLoadingErr := loadCofig()
|
||||
if configLoadingErr != nil {
|
||||
return configLoadingErr
|
||||
}
|
||||
|
@ -10,8 +10,8 @@ import (
|
||||
|
||||
// configListCmd represents the list command
|
||||
var configListCmd = &cobra.Command{
|
||||
Use: "list",
|
||||
Short: "List configs",
|
||||
Use: "list",
|
||||
Short: "List configs",
|
||||
Aliases: []string{"ls"},
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
// Get alphabetically ordered list of config keys
|
||||
|
@ -16,7 +16,7 @@ var cfgFile string
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "psu",
|
||||
Short: "A CLI client for Portainer",
|
||||
Version: "is set on common/version.CurrentVersion",
|
||||
Version: "is set on common/version.CurrentVersion",
|
||||
}
|
||||
|
||||
// Execute adds all child commands to the root command and sets flags appropriately.
|
||||
|
Loading…
Reference in New Issue
Block a user