diff --git a/CHANGELOG.md b/CHANGELOG.md index ded007a5..d65bd24a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,9 @@ TODO: Add an updated screenshot with some fancy VST3-only plugins to the readme `libyabridge-vst2.so` in this version, it's advised to carefully remove the old `libyabridge.so` and `yabridgectl` files before upgrading to avoid confusing situations. +- Added the `yabridgectl set --path-auto` option to revert back to automatically + locating yabridge's files after manually setting a path with + `yabridgectl set --path=<...>`. ## [2.2.1] - 2020-12-12 diff --git a/tools/yabridgectl/src/actions.rs b/tools/yabridgectl/src/actions.rs index f516813e..cdd7f404 100644 --- a/tools/yabridgectl/src/actions.rs +++ b/tools/yabridgectl/src/actions.rs @@ -137,6 +137,7 @@ pub fn show_status(config: &Config) -> Result<()> { pub struct SetOptions<'a> { pub method: Option<&'a str>, pub path: Option, + pub path_auto: bool, } /// Change configuration settings. The actual options are defined in the clap [app](clap::App). @@ -152,6 +153,10 @@ pub fn set_settings(config: &mut Config, options: &SetOptions) -> Result<()> { config.yabridge_home = Some(path.clone()); } + if options.path_auto { + config.yabridge_home = None; + } + config.write() } diff --git a/tools/yabridgectl/src/main.rs b/tools/yabridgectl/src/main.rs index c0c3a478..6cdb3f2f 100644 --- a/tools/yabridgectl/src/main.rs +++ b/tools/yabridgectl/src/main.rs @@ -106,7 +106,17 @@ fn main() -> Result<()> { '~/.local/share/yabridge' by default.", ) .validator(validate_path) - .takes_value(true), + .takes_value(true).conflicts_with("path_auto"), + ) + .arg( + Arg::with_name("path_auto") + .long("path-auto") + .about("Automatically locate yabridge's files") + .long_about( + "Automatically locate yabridge's files. This can be used after manually \ + setting a path with the '--path' option to revert back to the default \ + auto detection behaviour.", + ) ), ) .subcommand( @@ -166,6 +176,7 @@ fn main() -> Result<()> { .value_of_t::("path") .ok() .and_then(|path| path.canonicalize().ok()), + path_auto: options.is_present("path_auto"), }, ), ("sync", Some(options)) => actions::do_sync(