Explorar o código

throw an error if executing reload command without worker id

zyx %!s(int64=6) %!d(string=hai) anos
pai
achega
96f11f57ed
Modificáronse 1 ficheiros con 5 adicións e 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"),