You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.
Sorry for the title... essentially when [-a... | --long-a=<val>] the value is only deserialised for the one specified in the struct. Contrast [-b | --bee] as Boolean flags, when the value of whichever is given is available as e.g. flag_bee; flag_b need not be specified.
Here's a reproduction:
[dependencies]
docopt = { version = "1.0.1"}
log = {version = "0.4.5"}
serde = { version = "1.0.76" }
serde_derive = { version = "1.0.76" }
stderrlog = { version = "0.4.1"}
Sorry for the title... essentially when
[-a... | --long-a=<val>]
the value is only deserialised for the one specified in the struct. Contrast[-b | --bee]
as Boolean flags, when the value of whichever is given is available as e.g.flag_bee
;flag_b
need not be specified.Here's a reproduction:
Then:
so far so good.
Not so good. I thought maybe the issue was using the short while deserialising the long name, but:
so it does appear to be the interaction between
...
and=<v>
.Less-than-ideal workaround with particular respect to integer flags, just in case someone stumbles here with a similar use case:
Options
flag_v: usize,
toArgs
.verbosity(args.flag_verbosity + args.flag_v)
(since docopt takes care of at most one being non-zero)The text was updated successfully, but these errors were encountered: