back

by JNRowe·6y ago·view on hn ↗
I really like the level of that documentation. Very beginner friendly, with a reasonable level of completeness mingled within. A short diversion for basic std::env::args() access, with a quick switch to using clap for decent common behaviour.

Having worked on a project written in nim today the contrast is huge: The documentation isn't great, the stdlib argument parsing is odd, if you use argparse¹ then nim-using devs expect different behaviour, etc.

1. https://github.com/iffy/nim-argparse

1 comments
For anyone actually building a product for others, please use clap, it's excellent.
For anyone who hasn't seen it, I highly recommend structopt over clap. It is a wrapper around clap which provides type safe parsing of CLI arguments into a struct you define. It is also what TFA uses.
A bit late, but the next major release of clap will include structopt:

https://clap.rs/2019/03/08/clap-v3-update-structopt/

What's TFA?
The Featured Article (I changed the F word)
I always thought it was "The Fine Article".
Wholesome internet people unwilling to say the word "fucking"

It's: The Fucking Article

Are you implying fuck is unwholesome? Why would you think that? I’m intrigued.