Closed canadaduane closed 2 years ago
Yea, you seem to have figured it out, but I can see how one would expect the help
example to be a program that actually only printed help when --help
was passed. I might try to make this a little more clear later today if I get the time. PRs are always welcome if I don't get around to it.
Cool, thanks for the feedback. BTW is what I did in that code snippet "standard"? I couldn't find the pattern anywhere in the examples--but it seems like the "obvious" thing one would want to do when writing both an argument parser and its corresponding help documentation.
Cool, thanks for the feedback. BTW is what I did in that code snippet "standard"? I couldn't find the pattern anywhere in the examples--but it seems like the "obvious" thing one would want to do when writing both an argument parser and its corresponding help documentation.
Yep, this is the "standard" way (aka the way I do it)
Can you have a look here to see if this is a good enough improvement? https://github.com/Hejsil/zig-clap/pull/59
OMG that is PERFECT! Thank you :)
I'm trying to learn how zig-clap works, and I hoped the
help
example would be more illustrative:Maybe this example should also show a simple version string output?
What I'm really looking for is an example where the args are parsed and then re-used as help output. i.e. I don't want to write out the arguments and their instructions only to re-write those arguments and their instructions in the "usage" block or "help" text.
Edit: I think I figured out what I was looking for: