mirror of
https://github.com/aykhans/dodo.git
synced 2025-07-02 00:16:20 +00:00
🔨Cobra package replaced with standard flag package
This commit is contained in:
@ -18,7 +18,7 @@ const (
|
||||
DefaultMethod string = "GET"
|
||||
DefaultTimeout uint32 = 10000 // Milliseconds (10 seconds)
|
||||
DefaultDodosCount uint = 1
|
||||
DefaultRequestCount uint = 1000
|
||||
DefaultRequestCount uint = 1
|
||||
MaxDodosCountForProxies uint = 20 // Max dodos count for proxy check
|
||||
)
|
||||
|
||||
@ -209,13 +209,13 @@ func (config *JSONConfig) MergeConfigs(newConfig *JSONConfig) {
|
||||
|
||||
type CLIConfig struct {
|
||||
*Config
|
||||
Yes bool `json:"yes" validate:"omitempty"`
|
||||
Yes Option[bool] `json:"yes" validate:"omitempty"`
|
||||
ConfigFile string `validation_name:"config-file" validate:"omitempty,filepath"`
|
||||
}
|
||||
|
||||
func NewCLIConfig(
|
||||
config *Config,
|
||||
yes bool,
|
||||
yes Option[bool],
|
||||
configFile string,
|
||||
) *CLIConfig {
|
||||
return &CLIConfig{
|
||||
@ -228,4 +228,7 @@ func (config *CLIConfig) MergeConfigs(newConfig *CLIConfig) {
|
||||
if newConfig.ConfigFile != "" {
|
||||
config.ConfigFile = newConfig.ConfigFile
|
||||
}
|
||||
if !newConfig.Yes.IsNone() {
|
||||
config.Yes = newConfig.Yes
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user