Skip to content

Chained commands and many positional args? #355

Answered by pacak
abey79 asked this question in Q&A
Discussion options

You must be logged in to vote
        #[bpaf(positional("LID"))]
        id: Vec<isize>,

I'm expecting to be able to parse something like layer 1 2 3 print. However this, fails with the following error:

Error: couldn't parse print: invalid digit found in string

For that parser for ids need to be able to recover from parsing failure. having something like #[bpaf(positional("LID"), many, catch)] might help.

https://docs.rs/bpaf/0.9.11/bpaf/parsers/struct.ParseMany.html#method.catch

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@abey79
Comment options

Comment options

You must be logged in to vote
1 reply
@abey79
Comment options

Answer selected by abey79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
parsing Running the parser to get results
2 participants