config: Make sure Required values are entered

This commit is contained in:
Nick Craig-Wood 2018-06-24 11:09:43 +01:00
parent 9bdf465c10
commit d046402d80

View file

@ -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)