2025-01-21 12:36:54 +09:00
|
|
|
use command_parser::parameter;
|
|
|
|
|
|
2025-01-07 23:15:18 +09:00
|
|
|
use super::*;
|
2025-01-04 07:35:04 +09:00
|
|
|
|
2025-01-07 23:15:18 +09:00
|
|
|
pub fn cmds() -> impl Iterator<Item = Command> {
|
2025-01-24 04:08:59 +09:00
|
|
|
let cfg = ("config", ["cfg"]);
|
|
|
|
|
let ap = tokens!(cfg, ("autoproxy", ["ap"]));
|
2025-01-21 12:36:54 +09:00
|
|
|
|
2025-01-24 04:08:59 +09:00
|
|
|
let ap_account = tokens!(ap, ("account", ["ac"]));
|
|
|
|
|
let ap_timeout = tokens!(ap, ("timeout", ["tm"]));
|
2025-01-07 23:15:18 +09:00
|
|
|
|
|
|
|
|
[
|
2025-01-21 12:36:54 +09:00
|
|
|
command!(ap_account => "cfg_ap_account_show")
|
2025-01-20 22:50:45 +09:00
|
|
|
.help("Shows autoproxy status for the account"),
|
2025-01-21 12:36:54 +09:00
|
|
|
command!(ap_account, Toggle => "cfg_ap_account_update")
|
|
|
|
|
.help("Toggles autoproxy for the account"),
|
|
|
|
|
command!(ap_timeout => "cfg_ap_timeout_show").help("Shows the autoproxy timeout"),
|
2025-01-24 05:25:46 +09:00
|
|
|
command!(ap_timeout, RESET => "cfg_ap_timeout_reset").help("Resets the autoproxy timeout"),
|
2025-01-24 04:08:59 +09:00
|
|
|
command!(ap_timeout, parameter::Toggle::Off => "cfg_ap_timeout_off")
|
2025-01-21 12:36:54 +09:00
|
|
|
.help("Disables the autoproxy timeout"),
|
|
|
|
|
command!(ap_timeout, ("timeout", OpaqueString) => "cfg_ap_timeout_update")
|
|
|
|
|
.help("Sets the autoproxy timeout"),
|
2025-01-07 23:15:18 +09:00
|
|
|
]
|
|
|
|
|
.into_iter()
|
|
|
|
|
}
|