clap icon indicating copy to clipboard operation
clap copied to clipboard

feat(mangen): clap/env is itself a feature of mangen

Open AndreasBackx opened this issue 2 years ago • 2 comments

This adds env as a feature to clap_mangen and enables it by default to keep the default behaviour. I wish there was a way to make it automatically enable the feature if it detects the used library/binary uses clap/env, though I'm unsure of how to exactly do that. I found this StackOverflow post, though it would be somewhat non-trivial and I would appreciate some input.

Fixes #3355.

AndreasBackx avatar May 14 '22 19:05 AndreasBackx

I wish there was a way to make it automatically enable the feature if it detects the used library/binary uses clap/env

It's (kinda) possible with a build script, see cargo:rustc-cfg

It doesn't make it possible to enable a cargo feature, but you can still achieve conditional compilation with that. Not sure if adding a build script is worth though.

thalesfragoso avatar Jun 14 '22 21:06 thalesfragoso

Build scripts bring in their own build-time performance issues so I lean towards keeping things simple until the next MSRV bump where we get the new feature features.

epage avatar Jun 14 '22 21:06 epage