Add offline option to scan and configtest (#588)

Add offline option to scan and configtest
This commit is contained in:
Kota Kanbe
2018-01-19 01:07:44 +09:00
committed by GitHub
parent a0e0ee6c1e
commit c00404793a
6 changed files with 89 additions and 13 deletions

View File

@@ -103,6 +103,8 @@ type Config struct {
SSHNative bool
ContainersOnly bool
Fast bool
Offline bool
Deep bool
SkipBroken bool
@@ -198,6 +200,16 @@ func (c Config) ValidateOnScan() bool {
}
}
numTrue := 0
for _, b := range []bool{c.Fast, c.Offline, c.Deep} {
if b {
numTrue++
}
}
if numTrue != 1 {
errs = append(errs, fmt.Errorf("Specify only one of -fast, -fast-offline, -deep"))
}
_, err := valid.ValidateStruct(c)
if err != nil {
errs = append(errs, err)