These are chat archives for kbknapp/clap-rs

22nd
Jul 2018
Serentty
@Serentty
Jul 22 2018 18:46
Hello!
I'm curious how I can get the program to quit after printing the default help message.
That is, to stop the program from running if --help is passed.
Denis Lisov
@tanriol
Jul 22 2018 18:49
@Serentty It does that by default, doesn't it?
Serentty
@Serentty
Jul 22 2018 18:51
Oh, I realized my issue. It seems that it doesn't properly print the help message if I parse the arguments within a lazy_static! macro.
I'm not sure how to fix that, though, since I'm assigning the data that I parse into fields in a static struct.
Well, there's the really hacky solution of simply calling the function to parse the arguments twice (once inside the macro and once in main()), and that does seem to work.
Kevin K.
@kbknapp
Jul 22 2018 18:55
Interesting. If you've got a link to your code we might be able to find something better
Serentty
@Serentty
Jul 22 2018 18:56
This is a pull request that I'm working on, so I'll just put this up as a Gist.
This is the relevant part of the code.
Serentty
@Serentty
Jul 22 2018 19:11
Well, my solution is really hacky, but it seems to work perfectly. I might just stick with that in the meantime.