Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Are you still developing this? #1

Open
svenstaro opened this issue Jan 20, 2018 · 5 comments
Open

Are you still developing this? #1

svenstaro opened this issue Jan 20, 2018 · 5 comments

Comments

@svenstaro
Copy link

Hi, I think this library could be quite useful if it had a few more validators and were generally maintained. Are you planning on developing/maintaining this?

@kbknapp
Copy link
Member

kbknapp commented Feb 5, 2018

@svenstaro sorry for the long reply, I would like to...however I have quite a bit on my plate right now.

Once v3 of clap is out, I want to split off some of the functionality into sub crates, at which point my grand idea is to move this repo over there.

That way there'd be something like:

  • clap
    • clap_derive
    • clap_completions
    • clap_validators

@svenstaro
Copy link
Author

Cool, sounds like a plan.

@chevdor
Copy link

chevdor commented Jul 19, 2018

@kbknapp sent a few PR hoping it revives some love for this repo 😄

@epage
Copy link
Member

epage commented Jun 2, 2022

For anyone finding this crate and this issue, we are looking at moving away from validation to parsing with clap-rs/clap#3732. This introduces a new trait for people to implement, TypedValueParser, to validate and convert the value to the intended type (it is already implemented for Fn(&str) -> Result<T, E> to be compatible with FromStr). We also provide a macro, value_parser! that accepts a type and will find the right value parser for you (see clap-rs/clap#3755 for plugging into this mechanism). So you can just do value_parser!(u64) to ensure only positive numbers.

I can see crates being created to extend this with extra, reusable policy like

I would expect these to be themed by functionality and dependencies (clap_regex, clap_file) rather than one giant crate.

@epage
Copy link
Member

epage commented Jun 2, 2022

I should add this is only in master atm and will be coming with clap 3.2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants