From 02286b0c5973a567c4c0f6cb4c01d405bb7beb1d Mon Sep 17 00:00:00 2001 From: Kota Kanbe Date: Wed, 3 Mar 2021 12:30:30 +0900 Subject: [PATCH] fix(scan): scan all servers in the config if no args #1184 (#1188) --- subcmds/scan.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/subcmds/scan.go b/subcmds/scan.go index ff6345dc..fbc0dbf9 100644 --- a/subcmds/scan.go +++ b/subcmds/scan.go @@ -167,9 +167,12 @@ func (p *ScanCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) return subcommands.ExitUsageError } } - // if scan target servers are specified by args, set to the config if 0 < len(servernames) { + // if scan target servers are specified by args, set to the config c.Conf.Servers = target + } else { + // if not specified by args, scan all servers in the config + target = c.Conf.Servers } logging.Log.Debugf("%s", pp.Sprintf("%v", target))