use crate::command_prelude::*;
use cargo::ops::{self, CleanOptions};
+use cargo::util::print_available_packages;
pub fn cli() -> App {
subcommand("clean")
pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
let ws = args.workspace(config)?;
+
+ if args.is_present_with_zero_values("package") {
+ print_available_packages(&ws)?;
+ }
+
let opts = CleanOptions {
config,
spec: values(args, "package"),
use cargo::core::dependency::DepKind;
use cargo::ops::tree::{self, EdgeKind};
use cargo::ops::Packages;
+use cargo::util::print_available_packages;
use cargo::util::CargoResult;
use std::collections::HashSet;
use std::str::FromStr;
}
let ws = args.workspace(config)?;
+
+ if args.is_present_with_zero_values("package") {
+ print_available_packages(&ws)?;
+ }
+
let charset = tree::Charset::from_str(args.value_of("charset").unwrap())
.map_err(|e| anyhow::anyhow!("{}", e))?;
let opts = tree::TreeOptions {
use crate::command_prelude::*;
use cargo::ops::{self, UpdateOptions};
+use cargo::util::print_available_packages;
pub fn cli() -> App {
subcommand("update")
pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
let ws = args.workspace(config)?;
+ if args.is_present_with_zero_values("package") {
+ print_available_packages(&ws)?;
+ }
+
let update_opts = UpdateOptions {
aggressive: args.is_present("aggressive"),
precise: args.value_of("precise"),