Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for feature dependencies. #136

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

hoolioh
Copy link

@hoolioh hoolioh commented Apr 25, 2024

From a Slack discussion:

I've recently come across rust-license-tool project because I'm involved in some Rust projects. I wanted to use it in my projects but I noticed that I couldn't get the optional dependencies behind feature flags. I did some tweaks to the tool in order to get them.

@@ -4,7 +4,7 @@ description = "A tool for creating the `LICENSE-3rdparty.csv` file for DataDog o
homepage = "https://github.com/DataDog/rust-license-tool"
repository = "https://github.com/DataDog/rust-license-tool"
readme = "README.md"
version = "1.0.3"
version = "1.1.0"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd prefer to handle the version bump in a separate PR.

Additionally you can pass the the following arguments to get the licenses for optional dependencies
behind features:

* `--features []`, `-f []`: comma separated list of features.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we put a meta-var in place of [] here? For example:

Suggested change
* `--features []`, `-f []`: comma separated list of features.
* `--features`, `-f FEATURE[,FEATURE...]`: comma separated list of features.

Comment on lines +68 to +72
#[arg(short, long)]
features: Vec<String>,

#[arg(long)]
all_features: bool,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would there be value in also having a --no-default-features the same as other cargo commands with features?

Should these should go before config above, or does that produce an unnatural ordering in the command-line help? They could use a short doc comment for that in any case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants