提交 a4038fd6 编写于 作者: LinuxSuRen's avatar LinuxSuRen

Add validation for config args

上级 b051bdef
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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册