Skip to content

Add support for automatic numeric ranges #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kbknapp opened this issue Apr 14, 2015 · 4 comments
Closed

Add support for automatic numeric ranges #73

kbknapp opened this issue Apr 14, 2015 · 4 comments
Labels
A-parsing Area: Parser's logic and needs it changed somehow.

Comments

@kbknapp
Copy link
Member

kbknapp commented Apr 14, 2015

In addition to #72 something akin to validating numeric ranges goes along nicely with Specific Value Sets. Perhaps a type of Range? Thinking out loud...

@kbknapp kbknapp added C-enhancement Category: Raise on the bar on expectations feature request labels Apr 14, 2015
@kbknapp
Copy link
Member Author

kbknapp commented Apr 14, 2015

This is going to be postponed until a better solution to #72 is determined. For this issue in particular (Ranges), I'm envisioning going along with an ArgType:

// Defined in clap:
enum ArgType {
    Int,
    Float,
    Range(i64, i64)  // high,low
}

// user code:
let arg = Arg::with_name("some-range").index(1).type(ArgType::Range(0,5));

But we'll see...

@kbknapp kbknapp removed the C-enhancement Category: Raise on the bar on expectations label Apr 25, 2015
@kbknapp kbknapp changed the title Add support for numeric ranges Add support for automatic numeric ranges Apr 25, 2015
@kbknapp
Copy link
Member Author

kbknapp commented Apr 30, 2015

Closed for now...

@kbknapp kbknapp closed this as completed Apr 30, 2015
@kbknapp kbknapp reopened this May 11, 2015
@kbknapp kbknapp added P4: nice to have A-parsing Area: Parser's logic and needs it changed somehow. labels Jul 15, 2015
@kbknapp
Copy link
Member Author

kbknapp commented Aug 17, 2015

This is somewhat possible now with #174 being merged, but its still mostly manual. Once we add some generic preconceived arg validations this may be closed.

@kbknapp
Copy link
Member Author

kbknapp commented Jan 30, 2017

validators serve this purpose fine. Closing.

@kbknapp kbknapp closed this as completed Jan 30, 2017
Marwes added a commit to Marwes/clap-rs that referenced this issue Jul 7, 2017
All the other features are either irrelevant, for nightly or already included by default so this should build with all features.

https://github.com/onur/docs.rs/pull/73

Fixes clap-rs#73
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parsing Area: Parser's logic and needs it changed somehow.
Projects
None yet
Development

No branches or pull requests

1 participant