From e6ec8819cb5d1dfaf622707b3bb6290db82eab16 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Fri, 26 Feb 2021 14:33:12 +0100 Subject: [PATCH] [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. --- CHANGELOG.md | 3 +++ tools/yabridgectl/src/actions.rs | 19 +++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bc6f0b3..cc670669 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/tools/yabridgectl/src/actions.rs b/tools/yabridgectl/src/actions.rs index b2af3090..11cdc199 100644 --- a/tools/yabridgectl/src/actions.rs +++ b/tools/yabridgectl/src/actions.rs @@ -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() + ); } }