diff --git a/app/cmd/config.go b/app/cmd/config.go index a042a6d4dfc705e4d94b93cd3b7ebf41eb7ed9a6..5166cc7eaeb7aba0078f427d95d830a7efef60ad 100644 --- a/app/cmd/config.go +++ b/app/cmd/config.go @@ -1,6 +1,7 @@ package cmd import ( + "errors" "fmt" "io/ioutil" "log" @@ -35,6 +36,13 @@ var configCmd = &cobra.Command{ Use: "config", Short: "Manage the config of jcli", Long: `Manage the config of jcli`, + Args: func(cmd *cobra.Command, args []string) (err error) { + if !configOptions.Show && !configOptions.Generate && + !configOptions.List && configOptions.Current == "" { + err = errors.New("need arguments") + } + return + }, Run: func(cmd *cobra.Command, args []string) { current := getCurrentJenkins() if configOptions.Show {