config: Make sure Required values are entered
This commit is contained in:
parent
9bdf465c10
commit
d046402d80
1 changed files with 4 additions and 0 deletions
|
@ -813,6 +813,10 @@ func ChooseOption(o *fs.Option, name string) string {
|
|||
in = ReadLine()
|
||||
}
|
||||
if in == "" {
|
||||
if o.Required && fmt.Sprint(o.Default) == "" {
|
||||
fmt.Printf("This value is required and it has no default.\n")
|
||||
continue
|
||||
}
|
||||
break
|
||||
}
|
||||
newIn, err := configstruct.StringToInterface(o.Default, in)
|
||||
|
|
Loading…
Reference in a new issue