Skip to content

Commit

Permalink
Add containers-only option to configtest (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
knqyf263 authored and kotakanbe committed Apr 4, 2017
1 parent 9ab0622 commit 33b2aa2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,7 @@ configtest:
[-log-dir=/path/to/log]
[-ask-key-password]
[-ssh-external]
[-containers-only]
[-timeout=300]
[-debug]

Expand All @@ -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
Expand Down
9 changes: 9 additions & 0 deletions commands/configtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type ConfigtestCmd struct {
configPath string
logDir string
askKeyPassword bool
containersOnly bool
sshExternal bool
httpProxy string
timeoutSec int
Expand All @@ -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]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()) {
Expand Down

0 comments on commit 33b2aa2

Please sign in to comment.