use std::collections::{BTreeMap, HashSet};
+use termcolor::Color::{self, Cyan, Green, Red};
+
use core::PackageId;
use core::registry::PackageRegistry;
use core::{Resolve, SourceId, Workspace};
true)?;
// Summarize what is changing for the user.
- let print_change = |status: &str, msg: String| {
- opts.config.shell().status(status, msg)
+ let print_change = |status: &str, msg: String, color: Color| {
+ opts.config.shell().status_with_color(status, msg, color)
};
for (removed, added) in compare_dependency_graphs(&previous_resolve, &resolve) {
if removed.len() == 1 && added.len() == 1 {
} else {
format!("{} -> v{}", removed[0], added[0].version())
};
- print_change("Updating", msg)?;
+ print_change("Updating", msg, Cyan)?;
} else {
for package in removed.iter() {
- print_change("Removing", format!("{}", package))?;
+ print_change("Removing", format!("{}", package), Red)?;
}
for package in added.iter() {
- print_change("Adding", format!("{}", package))?;
+ print_change("Adding", format!("{}", package), Green)?;
}
}
}