Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Clap 3.0, a Rust CLI argument parser (epage.github.io)
38 points by arusahni on Jan 1, 2022 | hide | past | favorite | 4 comments


How much overhead does Clap add to a small console app now? Both in terms of compile time and binary size.

Or put another way, is there a minimum size an app should be before Clap is added, if you don’t want Clap to be the majority of the binary and compile time?

I think I remember trying an early version and it was painfully large then but maybe it has changed.


Clap (+structopt) is such an amazing tool that it's one of the core reasons I prefer Rust-made CLIs: the help messages and descriptions make sense to me. Basically every Rust CLI project will use clap/structopt, and the consistency wins are also great.

I'm interested to see whether people will continue to use structopt (which is a high-level macro interface on top of clap), or if they'll just use the new macro features in clap itself.


The new macro features in clap are structopt.


The output of "cargo run -- --help" does not make much sense to me. "-h" is an option? What about "-v"? Why is it not called an option? Or it is an option that belongs to "DEBUG"? What is "--config" exactly, a mandatory option? Based on "test-clap [OPTIONS] --config <CONFIG>", it seems to be the case, otherwise it would belong to "[OPTIONS]", right? I would rather just read the manual page of "test-clap", hoping that they are sticking to conventions and whatnot.

We need consistency. I try to stick to https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1.... Sometimes I do have "commands" or "sub-commands".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: