"build" | "bench" | "check" | "clean" | "doc" | "fetch" | "generate-lockfile" |
"git-checkout" | "init" | "install" | "locate-project" | "login" | "metadata" |
"new" | "owner" | "package" | "pkgid" | "publish" | "read-manifest" | "run" |
- "rustc" | "rustdoc" | "search" | "test" => true,
+ "rustc" | "rustdoc" | "search" | "test" | "uninstall" => true,
_ => false
});
// $mac!(rustdoc);
// $mac!(search);
// $mac!(test);
- $mac!(uninstall);
+// $mac!(uninstall);
$mac!(update);
$mac!(verify_project);
$mac!(version);
}
};
}
+ ("uninstall", Some(args)) => {
+ let root = args.value_of("root");
+ let specs = args.values_of("spec").unwrap_or_default().collect();
+ ops::uninstall(root, specs, values(args, "bin"), config)?;
+ return Ok(());
+ }
_ => return Ok(())
}
}
rustdoc::cli(),
search::cli(),
test::cli(),
+ uninstall::cli(),
])
;
app
mod rustdoc;
mod search;
mod test;
+mod uninstall;
mod utils {
use clap::{self, SubCommand, AppSettings};
--- /dev/null
+use super::utils::*;
+
+pub fn cli() -> App {
+ subcommand("uninstall")
+ .about("Remove a Rust binary")
+ .arg(Arg::with_name("spec").multiple(true))
+ .arg(
+ opt("bin", "Only uninstall the binary NAME")
+ .value_name("NAME").multiple(true)
+ )
+ .arg(
+ opt("root", "Directory to uninstall packages from")
+ .value_name("DIR")
+ )
+ .after_help("\
+The argument SPEC is a package id specification (see `cargo help pkgid`) to
+specify which crate should be uninstalled. By default all binaries are
+uninstalled for a crate but the `--bin` and `--example` flags can be used to
+only uninstall particular binaries.
+")
+}