mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-17 08:53:56 +02:00
Wrap options for yabridgectl sync/set in a struct
To prevent having to pass a bunch of confusing boolean values or an entire ArgMatch object.
This commit is contained in:
@@ -124,11 +124,21 @@ fn main() -> Result<()> {
|
||||
}
|
||||
("list", _) => actions::list_directories(&config),
|
||||
("status", _) => actions::show_status(&config),
|
||||
("set", Some(options)) => actions::set_settings(&mut config, options),
|
||||
("set", Some(options)) => actions::set_settings(
|
||||
&mut config,
|
||||
&actions::SetOptions {
|
||||
method: options.value_of("method"),
|
||||
// We've already verified that the path is valid, so we should only be getting
|
||||
// errors for missing arguments
|
||||
path: options.value_of_t("path").ok(),
|
||||
},
|
||||
),
|
||||
("sync", Some(options)) => actions::do_sync(
|
||||
&config,
|
||||
options.is_present("prune"),
|
||||
options.is_present("verbose"),
|
||||
&actions::SyncOptions {
|
||||
prune: options.is_present("prune"),
|
||||
verbose: options.is_present("verbose"),
|
||||
},
|
||||
),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user