mirror of https://github.com/restic/restic.git
Add support for boolean extended options
This commit is contained in:
parent
407843c5f9
commit
4ddcc17135
|
@ -199,6 +199,14 @@ func (o Options) Apply(ns string, dst interface{}) error {
|
||||||
|
|
||||||
v.Field(i).SetUint(vi)
|
v.Field(i).SetUint(vi)
|
||||||
|
|
||||||
|
case "bool":
|
||||||
|
vi, err := strconv.ParseBool(value)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
v.Field(i).SetBool(vi)
|
||||||
|
|
||||||
case "Duration":
|
case "Duration":
|
||||||
d, err := time.ParseDuration(value)
|
d, err := time.ParseDuration(value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue