Format code

This commit is contained in:
Juan Carlos Mejías Rodríguez 2019-07-24 18:23:44 -04:00
parent d770da7414
commit a22aaa20f5
3 changed files with 8 additions and 8 deletions

View File

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

View File

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

View File

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