Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

u64 args doesn't work #40

Closed
bestouff opened this issue Feb 2, 2018 · 2 comments
Closed

u64 args doesn't work #40

bestouff opened this issue Feb 2, 2018 · 2 comments
Labels
invalid This doesn't seem right

Comments

@bestouff
Copy link

bestouff commented Feb 2, 2018

If I put this in the Cli struct:

    #[structopt(long = "timeout", short = "t", default_value = "3")]
    timeout: u64,

then args.timeout's value is 0 by default, and 1 if I pass a --timeout 5 argument.
If I replace u64 with u32 it works as expected.

@killercup killercup added the invalid This doesn't seem right label Feb 2, 2018
@killercup
Copy link
Owner

This is structopt's behavior, so if you think this is a problem, please open an issue at https://github.com/TeXitoi/structopt :)

I think this is by design, though. https://docs.rs/structopt-derive/0.1.6/structopt_derive/ says u64 maps to "number of times the flag is used".

@bestouff
Copy link
Author

bestouff commented Feb 4, 2018

Yep, found the corresponding issue: TeXitoi/structopt#30 - apparently it'll be fixed in structopt 0.2

Please make sure to update to 0.2 when it's available.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants