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

Clean up rm arguments #748

Merged
merged 2 commits into from
Jul 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ ARGS:
<DEP_ID>... Dependencies to be removed

OPTIONS:
--dry-run Don't actually write the manifest
-h, --help Print help information
--manifest-path <PATH> Path to the manifest to remove a dependency from
-p, --package <PKGID> Package id of the crate to remove this dependency from
-p, --package <PKGID> Package to remove from
-Z <FLAG> Unstable (nightly-only) flags
--dry-run Don't actually write the manifest
-q, --quiet Do not print any output in case of success
-h, --help Print help information
-V, --version Print version information
-Z <FLAG> Unstable (nightly-only) flags

SECTION:
-B, --build Remove crate as build dependency
-D, --dev Remove crate as development dependency
-D, --dev Remove as development dependency
-B, --build Remove as build dependency
--target <TARGET> Remove as dependency from the given target platform

```
Expand Down
15 changes: 8 additions & 7 deletions src/bin/rm/rm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,29 @@ use std::path::PathBuf;
/// Remove a dependency from a Cargo.toml manifest file.
#[derive(Debug, Args)]
#[clap(version)]
#[clap(setting = clap::AppSettings::DeriveDisplayOrder)]
pub struct RmArgs {
/// Dependencies to be removed.
/// Dependencies to be removed
#[clap(value_name = "DEP_ID", required = true)]
crates: Vec<String>,

/// Remove crate as development dependency.
/// Remove as development dependency
#[clap(long, short = 'D', conflicts_with = "build", help_heading = "SECTION")]
dev: bool,

/// Remove crate as build dependency.
/// Remove as build dependency
#[clap(long, short = 'B', conflicts_with = "dev", help_heading = "SECTION")]
build: bool,

/// Remove as dependency from the given target platform.
/// Remove as dependency from the given target platform
#[clap(long, forbid_empty_values = true, help_heading = "SECTION")]
target: Option<String>,

/// Path to the manifest to remove a dependency from.
/// Path to the manifest to remove a dependency from
#[clap(long, value_name = "PATH", parse(from_os_str))]
manifest_path: Option<PathBuf>,

/// Package id of the crate to remove this dependency from.
/// Package to remove from
#[clap(long = "package", short = 'p', value_name = "PKGID")]
pkgid: Option<String>,

Expand All @@ -42,7 +43,7 @@ pub struct RmArgs {
#[clap(long)]
dry_run: bool,

/// Do not print any output in case of success.
/// Do not print any output in case of success
#[clap(long, short)]
quiet: bool,
}
Expand Down