mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
[yabridgectl] Add a way to clear entire blacklist
This commit is contained in:
@@ -43,3 +43,9 @@ pub fn list_paths(config: &Config) -> Result<()> {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Clear the entire blacklist.
|
||||
pub fn clear(config: &mut Config) -> Result<()> {
|
||||
config.blacklist.clear();
|
||||
config.write()
|
||||
}
|
||||
|
||||
@@ -216,6 +216,11 @@ fn main() -> Result<()> {
|
||||
App::new("list")
|
||||
.about("List the blacklisted paths")
|
||||
.display_order(3),
|
||||
)
|
||||
.subcommand(
|
||||
App::new("clear")
|
||||
.about("Clear the entire blacklist")
|
||||
.display_order(4),
|
||||
),
|
||||
)
|
||||
.get_matches();
|
||||
@@ -272,6 +277,7 @@ fn main() -> Result<()> {
|
||||
&options.value_of_t_or_exit::<PathBuf>("path"),
|
||||
),
|
||||
Some(("list", _)) => actions::blacklist::list_paths(&config),
|
||||
Some(("clear", _)) => actions::blacklist::clear(&mut config),
|
||||
_ => unreachable!(),
|
||||
},
|
||||
_ => unreachable!(),
|
||||
|
||||
Reference in New Issue
Block a user