mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-06 19:40:10 +02:00
[yabridgectl] Let rustfmt handle string wrapping
This commit is contained in:
@@ -0,0 +1 @@
|
||||
format_strings = true
|
||||
@@ -272,8 +272,9 @@ pub fn do_sync(config: &mut Config, options: &SyncOptions) -> Result<()> {
|
||||
if let Ok(canonical_plugin_dir) = fs::canonicalize(&plugin_dir) {
|
||||
if canonical_plugin_dir.starts_with(&canonical_vst2_home) {
|
||||
anyhow::bail!(
|
||||
"'~/.vst/yabridge' is a symlink to '{}'. \
|
||||
This conflicts with '{}' from your plugin directories, so the syncing process will now be aborted.",
|
||||
"'~/.vst/yabridge' is a symlink to '{}'. This conflicts with '{}' \
|
||||
from your plugin directories, so the syncing process will now be \
|
||||
aborted.",
|
||||
canonical_vst2_home.display(),
|
||||
plugin_dir.display(),
|
||||
);
|
||||
@@ -288,8 +289,9 @@ pub fn do_sync(config: &mut Config, options: &SyncOptions) -> Result<()> {
|
||||
if let Ok(canonical_plugin_dir) = fs::canonicalize(&plugin_dir) {
|
||||
if canonical_plugin_dir.starts_with(&canonical_vst3_home) {
|
||||
anyhow::bail!(
|
||||
"'~/.vst3/yabridge' is a symlink to '{}'. \
|
||||
This conflicts with '{}' from your plugin directories, so the syncing process will now be aborted.",
|
||||
"'~/.vst3/yabridge' is a symlink to '{}'. This conflicts with '{}' \
|
||||
from your plugin directories, so the syncing process will now be \
|
||||
aborted.",
|
||||
canonical_vst3_home.display(),
|
||||
plugin_dir.display(),
|
||||
);
|
||||
@@ -365,7 +367,8 @@ pub fn do_sync(config: &mut Config, options: &SyncOptions) -> Result<()> {
|
||||
eprintln!(
|
||||
"{}",
|
||||
util::wrap(&format!(
|
||||
"{}: '{}' has already been provided by another Wine prefix or plugin directory, skipping it\n",
|
||||
"{}: '{}' has already been provided by another Wine \
|
||||
prefix or plugin directory, skipping it\n",
|
||||
"WARNING".red(),
|
||||
target_windows_plugin_path.display(),
|
||||
))
|
||||
@@ -443,8 +446,8 @@ pub fn do_sync(config: &mut Config, options: &SyncOptions) -> Result<()> {
|
||||
eprintln!(
|
||||
"{}",
|
||||
util::wrap(&format!(
|
||||
"{}: The {} version of '{}' has already been provided by another Wine \
|
||||
prefix or plugin directory, skipping '{}'\n",
|
||||
"{}: The {} version of '{}' has already been provided by another \
|
||||
Wine prefix or plugin directory, skipping '{}'\n",
|
||||
"WARNING".red(),
|
||||
module.architecture,
|
||||
module.target_bundle_home().display(),
|
||||
|
||||
@@ -238,7 +238,7 @@ impl Config {
|
||||
_ => {
|
||||
return Err(anyhow!(
|
||||
"Could not find '{}' in either '{}' or '{}'. You can override the \
|
||||
default search path using 'yabridgectl set --path=<path>'.",
|
||||
default search path using 'yabridgectl set --path=<path>'.",
|
||||
VST2_CHAINLOADER_NAME,
|
||||
system_path.display(),
|
||||
user_path.display()
|
||||
|
||||
@@ -472,8 +472,8 @@ pub fn index(directory: &Path, blacklist: &HashSet<&Path>) -> SearchIndex {
|
||||
// at least tell the user what's happening and that they can safely cancel the scan.
|
||||
if file_idx == 100_000 {
|
||||
eprintln!(
|
||||
"Indexed over 100.000 files, press Ctrl+C to cancel this operation if this was not \
|
||||
intentional."
|
||||
"Indexed over 100.000 files, press Ctrl+C to cancel this operation if this was \
|
||||
not intentional."
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,8 @@ fn main() -> Result<()> {
|
||||
config.blacklist.iter().map(|path| path.as_path()).collect();
|
||||
|
||||
let matches = command!()
|
||||
.subcommand_required(true).arg_required_else_help(true)
|
||||
.subcommand_required(true)
|
||||
.arg_required_else_help(true)
|
||||
.subcommand(
|
||||
Command::new("add")
|
||||
.about("Add a plugin install location")
|
||||
@@ -127,45 +128,56 @@ fn main() -> Result<()> {
|
||||
.arg(
|
||||
Arg::new("path")
|
||||
.long("path")
|
||||
.help("Path to the directory containing 'libyabridge-chainloader-{vst2,vst3}.so'")
|
||||
.help(
|
||||
"Path to the directory containing \
|
||||
'libyabridge-chainloader-{vst2,vst3}.so'",
|
||||
)
|
||||
.long_help(
|
||||
"Path to the directory containing 'libyabridge-chainloader-{vst2,vst3}.so'. \
|
||||
If this is not set, then yabridgectl will look in both '/usr/lib' and \
|
||||
"Path to the directory containing \
|
||||
'libyabridge-chainloader-{vst2,vst3}.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).conflicts_with("path_auto"),
|
||||
.takes_value(true)
|
||||
.conflicts_with("path_auto"),
|
||||
)
|
||||
.arg(
|
||||
Arg::new("path_auto")
|
||||
.long("path-auto")
|
||||
.help("Automatically locate yabridge's files")
|
||||
.long_help(
|
||||
"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.",
|
||||
"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.",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::new("vst2_location")
|
||||
.long("vst2-location")
|
||||
.help("Where to set up VST2 plugins")
|
||||
.long_help(format!(
|
||||
"Where to set up VST2 plugins. \
|
||||
'{}' (the default) causes bridged VST2 plugins to be set up in `~/.vst/yabridge.` \
|
||||
'{}' causes bridged VST2 plugins to be set up next to the original '.dll' file.",
|
||||
"centralized".bright_white(),
|
||||
"inline".bright_white()
|
||||
).as_ref())
|
||||
.long_help(
|
||||
format!(
|
||||
"Where to set up VST2 plugins. '{}' (the default) causes bridged \
|
||||
VST2 plugins to be set up in `~/.vst/yabridge.` '{}' causes \
|
||||
bridged VST2 plugins to be set up next to the original '.dll' \
|
||||
file.",
|
||||
"centralized".bright_white(),
|
||||
"inline".bright_white()
|
||||
)
|
||||
.as_ref(),
|
||||
)
|
||||
.possible_values(["centralized", "inline"])
|
||||
.takes_value(true),
|
||||
).arg(
|
||||
)
|
||||
.arg(
|
||||
Arg::new("no_verify")
|
||||
.long("no-verify")
|
||||
.help("Always skip post-installation setup checks")
|
||||
.long_help(
|
||||
"Always skip post-installation setup checks. This can be set temporarily \
|
||||
by passing the '--no-verify' option to 'yabridgectl sync'.",
|
||||
"Always skip post-installation setup checks. This can be set \
|
||||
temporarily by passing the '--no-verify' option to 'yabridgectl \
|
||||
sync'.",
|
||||
)
|
||||
.possible_values(["true", "false"])
|
||||
.takes_value(true),
|
||||
@@ -175,12 +187,12 @@ fn main() -> Result<()> {
|
||||
Command::new("blacklist")
|
||||
.about("Manage the indexing blacklist (advanced)")
|
||||
.display_order(201)
|
||||
.subcommand_required(true).arg_required_else_help(true)
|
||||
.subcommand_required(true)
|
||||
.arg_required_else_help(true)
|
||||
.long_about(
|
||||
"Manage the indexing blacklist (advanced)\n\
|
||||
\n\
|
||||
This lets you skip over individual files and entire directories in the \
|
||||
indexing process. You most likely won't have to use this feature.",
|
||||
"Manage the indexing blacklist (advanced)\n\nThis lets you skip over \
|
||||
individual files and entire directories in the indexing process. You most \
|
||||
likely won't have to use this feature.",
|
||||
)
|
||||
.subcommand(
|
||||
Command::new("add")
|
||||
@@ -201,7 +213,9 @@ fn main() -> Result<()> {
|
||||
.arg(
|
||||
Arg::new("path")
|
||||
.help("Path to a previously added file or directory")
|
||||
.validator(|path| match_in_path_list(Path::new(path), &blacklist_entries))
|
||||
.validator(|path| {
|
||||
match_in_path_list(Path::new(path), &blacklist_entries)
|
||||
})
|
||||
.validator(validate_path)
|
||||
.takes_value(true)
|
||||
.required(true),
|
||||
|
||||
@@ -72,8 +72,8 @@ fn parse_pe32_winedump<P: AsRef<Path>>(binary: P) -> Result<Pe32Info> {
|
||||
.arg(path)
|
||||
.output()
|
||||
.context(
|
||||
"Could not find 'winedump'. In some distributions this is part of a seperate \
|
||||
Wine tools package.",
|
||||
"Could not find 'winedump'. In some distributions this is part of a seperate Wine \
|
||||
tools package.",
|
||||
)
|
||||
.map(|output| output.stdout)
|
||||
};
|
||||
|
||||
@@ -326,9 +326,10 @@ pub fn verify_path_setup(config: &Config) -> Result<bool> {
|
||||
eprintln!(
|
||||
"\n{}",
|
||||
wrap(&format!(
|
||||
"Warning: could not run {} as a login shell, skipping PATH setup check: \
|
||||
{}",
|
||||
shell.bright_white(), err
|
||||
"Warning: could not run {} as a login shell, skipping PATH setup \
|
||||
check: {}",
|
||||
shell.bright_white(),
|
||||
err
|
||||
))
|
||||
);
|
||||
|
||||
@@ -473,8 +474,8 @@ pub fn verify_external_dependencies() -> Result<()> {
|
||||
wrap(&format!(
|
||||
"Warning: Could not find '{}'. This will not prevent yabridge from working, but \
|
||||
you will also not receive any notifcations when something is wrong. It is \
|
||||
usually part of the libnotify package, but your distro might have moved it into a \
|
||||
separate libnotify-tools package.",
|
||||
usually part of the libnotify package, but your distro might have moved it into \
|
||||
a separate libnotify-tools package.",
|
||||
"notify-send".bright_white(),
|
||||
))
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user