mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-08-10 13:20:33 +02:00
dont allow positional args in start commands
This commit is contained in:
+14
-1
@@ -205,7 +205,13 @@ func initStartCmd() *cobra.Command {
|
|||||||
Long: `Install and start the ctrld service
|
Long: `Install and start the ctrld service
|
||||||
|
|
||||||
NOTE: running "ctrld start" without any arguments will start already installed ctrld service.`,
|
NOTE: running "ctrld start" without any arguments will start already installed ctrld service.`,
|
||||||
Args: cobra.NoArgs,
|
Args: func(cmd *cobra.Command, args []string) error {
|
||||||
|
if len(args) > 0 {
|
||||||
|
return fmt.Errorf("'ctrld start' doesn't accept positional arguments\n" +
|
||||||
|
"Use flags instead (e.g. --cd, --iface) or see 'ctrld start --help' for all options")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
},
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
checkStrFlagEmpty(cmd, cdUidFlagName)
|
checkStrFlagEmpty(cmd, cdUidFlagName)
|
||||||
checkStrFlagEmpty(cmd, cdOrgFlagName)
|
checkStrFlagEmpty(cmd, cdOrgFlagName)
|
||||||
@@ -555,6 +561,13 @@ NOTE: running "ctrld start" without any arguments will start already installed c
|
|||||||
Long: `Quick start service and configure DNS on interface
|
Long: `Quick start service and configure DNS on interface
|
||||||
|
|
||||||
NOTE: running "ctrld start" without any arguments will start already installed ctrld service.`,
|
NOTE: running "ctrld start" without any arguments will start already installed ctrld service.`,
|
||||||
|
Args: func(cmd *cobra.Command, args []string) error {
|
||||||
|
if len(args) > 0 {
|
||||||
|
return fmt.Errorf("'ctrld start' doesn't accept positional arguments\n" +
|
||||||
|
"Use flags instead (e.g. --cd, --iface) or see 'ctrld start --help' for all options")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
},
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
if len(os.Args) == 2 {
|
if len(os.Args) == 2 {
|
||||||
startOnly = true
|
startOnly = true
|
||||||
|
|||||||
Reference in New Issue
Block a user