Add containers-only option to configtest (#411)

This commit is contained in:
Teppei Fukuda
2017-04-04 14:34:56 +09:00
committed by Kota Kanbe
parent 9ab0622886
commit 33b2aa2d52
3 changed files with 15 additions and 0 deletions

View File

@@ -668,6 +668,7 @@ configtest:
[-log-dir=/path/to/log]
[-ask-key-password]
[-ssh-external]
[-containers-only]
[-timeout=300]
[-http-proxy=http://192.168.0.1:8080]
[-debug]
@@ -677,6 +678,8 @@ configtest:
Ask ssh privatekey password before scanning
-config string
/path/to/toml (default "/Users/kotakanbe/go/src/github.com/future-architect/vuls/config.toml")
-containers-only
Test containers only. Default: Test both of hosts and containers
-debug
debug mode
-http-proxy string

View File

@@ -676,6 +676,7 @@ configtest:
[-log-dir=/path/to/log]
[-ask-key-password]
[-ssh-external]
[-containers-only]
[-timeout=300]
[-debug]
@@ -684,6 +685,8 @@ configtest:
Ask ssh privatekey password before scanning
-config string
/path/to/toml (default "/Users/kotakanbe/go/src/github.com/future-architect/vuls/config.toml")
-containers-only
Test containers only. Default: Test both of hosts and containers
-debug
debug mode
-http-proxy string

View File

@@ -35,6 +35,7 @@ type ConfigtestCmd struct {
configPath string
logDir string
askKeyPassword bool
containersOnly bool
sshExternal bool
httpProxy string
timeoutSec int
@@ -57,6 +58,7 @@ func (*ConfigtestCmd) Usage() string {
[-ask-key-password]
[-timeout=300]
[-ssh-external]
[-containers-only]
[-http-proxy=http://192.168.0.1:8080]
[-debug]
@@ -96,6 +98,12 @@ func (p *ConfigtestCmd) SetFlags(f *flag.FlagSet) {
"ssh-external",
false,
"Use external ssh command. Default: Use the Go native implementation")
f.BoolVar(
&p.containersOnly,
"containers-only",
false,
"Test containers only. Default: Test both of hosts and containers")
}
// Execute execute
@@ -124,6 +132,7 @@ func (p *ConfigtestCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interfa
}
c.Conf.SSHExternal = p.sshExternal
c.Conf.HTTPProxy = p.httpProxy
c.Conf.ContainersOnly = p.containersOnly
var servernames []string
if 0 < len(f.Args()) {