implement autoproxy commands

This commit is contained in:
dusk 2025-10-01 14:44:56 +00:00
parent c42385f01c
commit 2b304457cc
No known key found for this signature in database
4 changed files with 66 additions and 34 deletions

View file

@ -1 +1,21 @@
use super::*;
pub fn autoproxy() -> (&'static str, [&'static str; 2]) {
("autoproxy", ["ap", "auto"])
}
pub fn cmds() -> impl Iterator<Item = Command> {
let ap = autoproxy();
[
command!(ap => "autoproxy_show").help("Shows your current autoproxy settings"),
command!(ap, ("off", ["stop", "cancel", "no", "disable", "remove"]) => "autoproxy_off")
.help("Disables autoproxy"),
command!(ap, ("latch", ["last", "proxy", "stick", "sticky", "l"]) => "autoproxy_latch")
.help("Sets autoproxy to latch mode"),
command!(ap, ("front", ["fronter", "switch", "f"]) => "autoproxy_front")
.help("Sets autoproxy to front mode"),
command!(ap, MemberRef => "autoproxy_member").help("Sets autoproxy to a specific member"),
]
.into_iter()
}

View file

@ -32,6 +32,7 @@ pub fn all() -> impl Iterator<Item = Command> {
.chain(switch::cmds())
.chain(random::cmds())
.chain(api::cmds())
.chain(autoproxy::cmds())
.map(|cmd| {
cmd.hidden_flag(("plaintext", ["pt"]))
.hidden_flag(("raw", ["r"]))