PluralKit/crates/command_definitions/src/switch.rs

30 lines
1.1 KiB
Rust

use super::*;
pub fn cmds() -> impl Iterator<Item = Command> {
let switch = ("switch", ["sw"]);
let edit = ("edit", ["e", "replace"]);
let r#move = ("move", ["m", "shift", "offset"]);
let delete = ("delete", ["remove", "erase", "cancel", "yeet"]);
let copy = ("copy", ["add", "duplicate", "dupe"]);
let out = "out";
let edit_flags = [
("first", ["f"]),
("remove", ["r"]),
("append", ["a"]),
("prepend", ["p"]),
];
[
command!(switch, ("commands", ["help"]) => "switch_commands"),
command!(switch, out => "switch_out"),
command!(switch, delete => "switch_delete").flag(("all", ["clear", "c"])),
command!(switch, r#move, Remainder(OpaqueString) => "switch_move"), // TODO: datetime parsing
command!(switch, edit, out => "switch_edit_out").flag(YES),
command!(switch, edit, Optional(MemberRefs) => "switch_edit").flags(edit_flags),
command!(switch, copy, Optional(MemberRefs) => "switch_copy").flags(edit_flags),
command!(switch, MemberRefs => "switch_do"),
]
.into_iter()
}