From 96f11f57ede5ba5f590cfea6fb311c3cd7a4a434 Mon Sep 17 00:00:00 2001 From: zyx Date: Tue, 9 Apr 2019 22:30:08 +0800 Subject: [PATCH] throw an error if executing reload command without worker id --- cmd/tunasynctl/tunasynctl.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/tunasynctl/tunasynctl.go b/cmd/tunasynctl/tunasynctl.go index f462110..583ec67 100644 --- a/cmd/tunasynctl/tunasynctl.go +++ b/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 ", 1) + } + cmd := tunasync.ClientCmd{ Cmd: cmd, WorkerID: c.String("worker"),