[yabridgectl] Use relative paths in verbose output

This should make the output look much less cluttered since most of the
output would consist of the same path prefix being repeated over and
over again.

The plugin location now also always ends with a trailing slash for
consistency's sake. I don't think Rust's Path has a way to normalize the
paths without also resolving symlinks.
This commit is contained in:
Robbert van der Helm
2021-02-26 14:33:12 +01:00
parent 9483c11ee0
commit e6ec8819cb
2 changed files with 18 additions and 4 deletions
+3
View File
@@ -29,6 +29,9 @@ Versioning](https://semver.org/spec/v2.0.0.html).
- Changed the wording in `yabridgectl status` for plugins that have not been
setup yet to look less dramatic and hopefully cause less confusion.
- Plugin paths printed during `yabridgectl status` and
`yabridgectl sync --verbose` are now always shown relative to the plugin
location instead of repeating the same path prefix for every plugin.
## [3.0.0] - 2021-02-14
+15 -4
View File
@@ -117,7 +117,9 @@ pub fn show_status(config: &Config) -> Result<()> {
println!("installation method: {}", config.method);
for (path, search_results) in results {
println!("\n{}:", path.display());
// Always print these paths with trailing slashes for consistency's sake because paths can
// be added both with and without a trailing slash
println!("\n{}", path.join("").display());
for (plugin, status) in search_results.installation_status() {
let status_str = match status {
@@ -127,7 +129,11 @@ pub fn show_status(config: &Config) -> Result<()> {
None => "not yet installed".into(),
};
println!(" {} :: {}", plugin.display(), status_str);
println!(
" {} :: {}",
plugin.strip_prefix(path).unwrap_or(&plugin).display(),
status_str
);
}
}
@@ -217,7 +223,9 @@ pub fn do_sync(config: &mut Config, options: &SyncOptions) -> Result<()> {
skipped_dll_files.extend(search_results.skipped_files);
if options.verbose {
println!("{}:", path.display());
// Always print these paths with trailing slashes for consistency's sake because paths
// can be added both with and without a trailing slash
println!("{}", path.join("").display());
}
// We'll set up the copies or symlinks for VST2 plugins
@@ -237,7 +245,10 @@ pub fn do_sync(config: &mut Config, options: &SyncOptions) -> Result<()> {
}
if options.verbose {
println!(" {}", plugin.display());
println!(
" {}",
plugin.strip_prefix(path).unwrap_or(&plugin).display()
);
}
}