fs: Add Exclusive parameter to Option to choose Examples only #3455

This commit is contained in:
Nick Craig-Wood
2021-05-14 14:07:44 +01:00
parent 99caf79ffe
commit 7ae2891252
4 changed files with 8 additions and 4 deletions
+5 -3
View File
@@ -161,6 +161,7 @@ func ConfigConfirm(state string, Default bool, name string, help string) (*Confi
Value: "false",
Help: "No",
}},
Exclusive: true,
},
}, nil
}
@@ -182,9 +183,10 @@ func ConfigChooseFixed(state string, name string, help string, items []OptionExa
choose := &ConfigOut{
State: state,
Option: &Option{
Name: name,
Help: help,
Examples: items,
Name: name,
Help: help,
Examples: items,
Exclusive: true,
},
}
choose.Option.Default = choose.Option.Examples[0].Value