Skip to content

Commit

Permalink
Merge pull request #748 from cassaundra/rm-args
Browse files Browse the repository at this point in the history
Clean up rm arguments
  • Loading branch information
epage authored Jul 21, 2022
2 parents 268c4fe + 7fc0d41 commit 643e925
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
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

0 comments on commit 643e925

Please sign in to comment.