Explorar el Código

throw an error if executing reload command without worker id

zyx hace 6 años
padre
commit
96f11f57ed
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      cmd/tunasynctl/tunasynctl.go

+ 5 - 0
cmd/tunasynctl/tunasynctl.go

@@ -375,6 +375,11 @@ func cmdJob(cmd tunasync.CmdVerb) cli.ActionFunc {
 
 func cmdWorker(cmd tunasync.CmdVerb) cli.ActionFunc {
 	return func(c *cli.Context) error {
+
+		if c.String("worker") == "" {
+			return cli.NewExitError("Please specify the worker with -w <worker-id>", 1)
+		}
+
 		cmd := tunasync.ClientCmd{
 			Cmd:      cmd,
 			WorkerID: c.String("worker"),