These are chat archives for kbknapp/clap-rs

23rd
Apr 2015
Andres Vahter
@andresv
Apr 23 2015 23:26
I am using clap-rs for argument parsing and I would like to make a function that returns ArgMatches to main application, however I am not familiar with lifetime syntax that is used with ArgMatches.
I put all relevant info here: http://is.gd/zSDDtA
Could someone take a look and suggest a hint how it should be done in rust.
Kevin K.
@kbknapp
Apr 23 2015 23:27
Looking now :)
Andres Vahter
@andresv
Apr 23 2015 23:29

tried with

pub fn args() -> ArgMatches<'static>

and it gave:

src/usage.rs:27:5: 27:39 error: struct `ArgMatches` is private
src/usage.rs:27 use clap::args::argmatches::ArgMatches;
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
Could not compile `doppler`.
It's cause clap::ArgMatches is re-exported as public. I need to go though and update the docs soon. It's on my to-do list :)
Andres Vahter
@andresv
Apr 23 2015 23:40
thanks
Kevin K.
@kbknapp
Apr 23 2015 23:42
no problem!