feat(scan): add -ssh-config option #417 (#660)

This commit is contained in:
Kota Kanbe
2018-05-31 12:39:46 +09:00
committed by GitHub
parent 92f36ca558
commit 399a08775e
4 changed files with 42 additions and 18 deletions

View File

@@ -37,6 +37,7 @@ type ConfigtestCmd struct {
askKeyPassword bool
containersOnly bool
sshNative bool
sshConfig bool
httpProxy string
timeoutSec int
@@ -122,6 +123,12 @@ func (p *ConfigtestCmd) SetFlags(f *flag.FlagSet) {
false,
"Use Native Go implementation of SSH. Default: Use the external command")
f.BoolVar(
&p.sshConfig,
"ssh-config",
false,
"Use SSH options specified in ssh_config preferentially")
f.BoolVar(
&p.containersOnly,
"containers-only",
@@ -161,6 +168,8 @@ func (p *ConfigtestCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interfa
return subcommands.ExitUsageError
}
c.Conf.SSHNative = p.sshNative
c.Conf.SSHConfig = p.sshConfig
c.Conf.HTTPProxy = p.httpProxy
c.Conf.ContainersOnly = p.containersOnly