From 8698a8fd0b59b5cd24b09ce377f9164437dd7899 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Thu, 16 Jul 2020 19:07:20 +0200 Subject: [PATCH] Update messages in yabridgectl --- tools/yabridgectl/src/actions.rs | 13 +++++++------ tools/yabridgectl/src/config.rs | 2 +- tools/yabridgectl/src/main.rs | 32 ++++++++++++++++++-------------- tools/yabridgectl/src/utils.rs | 8 ++++---- 4 files changed, 30 insertions(+), 25 deletions(-) diff --git a/tools/yabridgectl/src/actions.rs b/tools/yabridgectl/src/actions.rs index f9b36f7c..e3dd9421 100644 --- a/tools/yabridgectl/src/actions.rs +++ b/tools/yabridgectl/src/actions.rs @@ -65,7 +65,7 @@ pub fn remove_directory(config: &mut Config, path: &Path) -> Result<()> { .with_context(|| format!("Could not remove '{}'", file.path().display()))?; } - println!("\nRemoved {} files.", orphan_files.len()); + println!("\nRemoved {} files", orphan_files.len()); } _ => {} } @@ -243,9 +243,9 @@ pub fn do_sync(config: &Config, prune: bool, verbose: bool) -> Result<()> { } println!( - "Finished setting up {} plugins using {}, skipped {} non-plugin '.dll' files.", + "Finished setting up {} plugins using {}, skipped {} non-plugin '.dll' files", num_installed, - config.method.plural(), + config.method.plural_name(), num_skipped_files ); @@ -255,11 +255,12 @@ pub fn do_sync(config: &Config, prune: bool, verbose: bool) -> Result<()> { "\n{}", wrap(&format!( "Warning: 'yabridge-host.exe' is not present in your login shell's search \ - path. Yabridge won't be able to run using the copy-based installatin method \ + path. Yabridge won't be able to run using the copy-based installation method \ until this is fixed.\n\ - Add '{}' to {}'s login shell {} environment variable. See the \ + Add '{}' to {}'s login shell {} environment variables. See the \ troubleshooting section of the readme for more details. Rerun this command to \ - verify that this has been set up correctly, and then reboot your system.\n\ + verify that the variable has been set correctly, and then reboot your system \ + to complete the setup.\n\ \n\ https://github.com/robbert-vdh/yabridge#troubleshooting-common-issues", libyabridge_path.parent().unwrap().display(), diff --git a/tools/yabridgectl/src/config.rs b/tools/yabridgectl/src/config.rs index 38e2b2bd..7cf2c4db 100644 --- a/tools/yabridgectl/src/config.rs +++ b/tools/yabridgectl/src/config.rs @@ -71,7 +71,7 @@ pub enum InstallationMethod { impl InstallationMethod { /// The plural term for this installation methodd, using in string formatting. - pub fn plural(&self) -> &str { + pub fn plural_name(&self) -> &str { match &self { InstallationMethod::Copy => "copies", InstallationMethod::Symlink => "symlinks", diff --git a/tools/yabridgectl/src/main.rs b/tools/yabridgectl/src/main.rs index a478794a..f15082d6 100644 --- a/tools/yabridgectl/src/main.rs +++ b/tools/yabridgectl/src/main.rs @@ -26,7 +26,6 @@ mod config; mod files; mod utils; -// TODO: Naming and descriptions could be made clearer // TODO: Reward parts of the readme fn main() -> Result<()> { @@ -55,7 +54,7 @@ fn main() -> Result<()> { .about("Remove a plugin install location") .arg( Arg::with_name("path") - .about("Path to a directory") + .about("Path to a previously added directory") .possible_values(&plugin_directories) .takes_value(true) .required(true), @@ -71,17 +70,18 @@ fn main() -> Result<()> { Arg::with_name("method") .long("method") .about("The installation method to use") - .long_about(&format!("The installation method to use. \ - '{}' works in every situation but it requires you to rerun \ - 'yabridgectl sync' whenever you update yabridge. You'll also \ - have to modify your PATH environment variable so yabridge is \ - able to find 'yabridge-host.exe'.\ - '{}' only works for hosts that support individually \ - sandboxed plugins such as Bitwig Studio, but it does not \ - require you to set environment variables or to manually \ - update your plugins.", - "copy".bright_white(), - "symlink".bright_white())) + .long_about(&format!( + "The installation method to use. \ + '{}' works in every situation but it requires you to modify your PATH \ + environment variable so yabridge is able to find 'yabridge-host.exe'. \ + 'yabridgectl sync' whenever you update yabridge. You'll also have to \ + rerun 'yabridgectl sync' whenever you update yabridge. \ + '{}' only works for hosts that support individually sandboxed plugins \ + such as Bitwig Studio, but it does not require setting environment \ + variables or to manual updates.", + "copy".bright_white(), + "symlink".bright_white() + )) .setting(clap::ArgSettings::NextLineHelp) .possible_values(&["copy", "symlink"]) .takes_value(true), @@ -90,7 +90,11 @@ fn main() -> Result<()> { Arg::with_name("path") .long("path") .about("Path to the directory containing 'libyabridge.so'") - .long_about("Path to the directory containing 'libyabridge.so'. If this is not set, then yabridgectl will look in both '/usr/lib' and '~/.local/share/yabridge' by default.") + .long_about( + "Path to the directory containing 'libyabridge.so'. If this is \ + not set, then yabridgectl will look in both '/usr/lib' and \ + '~/.local/share/yabridge' by default.", + ) .validator(validate_path) .takes_value(true), ), diff --git a/tools/yabridgectl/src/utils.rs b/tools/yabridgectl/src/utils.rs index 894fdcb8..e5724581 100644 --- a/tools/yabridgectl/src/utils.rs +++ b/tools/yabridgectl/src/utils.rs @@ -62,11 +62,11 @@ pub fn verify_path_setup() -> Result<(), String> { "nu" => command.arg("-c").arg("which yabridge-host.exe"), shell => { eprintln!( - "{}", + "\n{}", wrap(&format!( - "WARNING: Yabridgectl does not know how to handle your login shell, \ - '{}', skipping PATH setup check. Feel free to open a bug report to \ - get yabridgectl to support your shell.\n\ + "WARNING: Yabridgectl does not know how to handle your login shell \ + '{}', skipping PATH setup check. Feel free to open a feature request \ + in order to get yabridgectl to support your shell.\n\ \n\ https://github.com/robbert-vdh/yabridge/issues", shell.bright_white(),