mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-10 04:30:12 +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(())
|
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")
|
App::new("list")
|
||||||
.about("List the blacklisted paths")
|
.about("List the blacklisted paths")
|
||||||
.display_order(3),
|
.display_order(3),
|
||||||
|
)
|
||||||
|
.subcommand(
|
||||||
|
App::new("clear")
|
||||||
|
.about("Clear the entire blacklist")
|
||||||
|
.display_order(4),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.get_matches();
|
.get_matches();
|
||||||
@@ -272,6 +277,7 @@ fn main() -> Result<()> {
|
|||||||
&options.value_of_t_or_exit::<PathBuf>("path"),
|
&options.value_of_t_or_exit::<PathBuf>("path"),
|
||||||
),
|
),
|
||||||
Some(("list", _)) => actions::blacklist::list_paths(&config),
|
Some(("list", _)) => actions::blacklist::list_paths(&config),
|
||||||
|
Some(("clear", _)) => actions::blacklist::clear(&mut config),
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
},
|
},
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
|
|||||||
Reference in New Issue
Block a user