2017-08-01 23:13:28 +00:00
|
|
|
package zgrab2
|
|
|
|
|
2017-09-29 22:59:37 +00:00
|
|
|
import "errors"
|
2017-08-01 23:13:28 +00:00
|
|
|
|
2017-10-04 03:57:56 +00:00
|
|
|
// MultipleCommand contains the command line options for running
|
2017-08-30 18:53:42 +00:00
|
|
|
type MultipleCommand struct {
|
2017-08-01 23:13:28 +00:00
|
|
|
ConfigFileName string `short:"c" long:"config-file" default:"-" description:"Config filename, use - for stdin"`
|
|
|
|
ContinueOnError bool `long:"continue-on-error" description:"If proceeding protocols error, do not run following protocols (default: true)"`
|
2020-02-04 00:45:08 +00:00
|
|
|
BreakOnSuccess bool `long:"break-on-success" description:"If proceeding protocols succeed, do not run following protocols (default: false)"`
|
2017-08-01 23:13:28 +00:00
|
|
|
}
|
|
|
|
|
2017-10-04 03:57:56 +00:00
|
|
|
// Validate the options sent to MultipleCommand
|
2017-08-30 18:53:42 +00:00
|
|
|
func (x *MultipleCommand) Validate(args []string) error {
|
2017-08-09 18:56:05 +00:00
|
|
|
if x.ConfigFileName == config.InputFileName {
|
|
|
|
return errors.New("cannot receive config file and input file from same source")
|
|
|
|
}
|
|
|
|
|
2017-09-29 22:59:37 +00:00
|
|
|
return nil
|
|
|
|
}
|
2017-08-01 23:13:28 +00:00
|
|
|
|
2017-10-04 03:57:56 +00:00
|
|
|
// Help returns a usage string that will be output at the command line
|
2017-09-29 22:59:37 +00:00
|
|
|
func (x *MultipleCommand) Help() string {
|
|
|
|
return ""
|
2017-08-01 23:13:28 +00:00
|
|
|
}
|