TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Clap 3.0, a Rust CLI argument parser

38 pointsby arusahniover 3 years ago

3 comments

alkonautover 3 years ago
How much overhead does Clap add to a small console app now? Both in terms of compile time and binary size.<p>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?<p>I think I remember trying an early version and it was painfully large then but maybe it has changed.
vlmutoloover 3 years ago
Clap (+structopt) is such an amazing tool that it&#x27;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&#x2F;structopt, and the consistency wins are also great.<p>I&#x27;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&#x27;ll just use the new macro features in clap itself.
评论 #29758837 未加载
johnisgoodover 3 years ago
The output of &quot;cargo run -- --help&quot; does not make much sense to me. &quot;-h&quot; is an option? What about &quot;-v&quot;? Why is it not called an option? Or it is an option that belongs to &quot;DEBUG&quot;? What is &quot;--config&quot; exactly, a mandatory option? Based on &quot;test-clap [OPTIONS] --config &lt;CONFIG&gt;&quot;, it seems to be the case, otherwise it would belong to &quot;[OPTIONS]&quot;, right? I would rather just read the manual page of &quot;test-clap&quot;, hoping that they are sticking to conventions and whatnot.<p>We need consistency. I try to stick to <a href="https:&#x2F;&#x2F;pubs.opengroup.org&#x2F;onlinepubs&#x2F;9699919799&#x2F;basedefs&#x2F;V1_chap12.html" rel="nofollow">https:&#x2F;&#x2F;pubs.opengroup.org&#x2F;onlinepubs&#x2F;9699919799&#x2F;basedefs&#x2F;V1...</a>. Sometimes I do have &quot;commands&quot; or &quot;sub-commands&quot;.