fix(cli): --features and --no-default-features should not be exclusive (#1846)

This commit is contained in:
LongYinan 2023-12-07 22:57:36 +08:00 committed by GitHub
parent 8d3d60c356
commit f43d483090
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -518,11 +518,17 @@ class Builder {
private setFeatures() {
const args = []
if (this.options.allFeatures && this.options.allFeatures) {
throw new Error(
'Cannot specify --all-features and --no-default-features together',
)
}
if (this.options.allFeatures) {
args.push('--all-features')
} else if (this.options.noDefaultFeatures) {
args.push('--no-default-features')
} else if (this.options.features) {
}
if (this.options.features) {
args.push('--features', ...this.options.features)
}