mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-07 22:37:54 +00:00
feat: implement switch commands
This commit is contained in:
parent
15191171f5
commit
10dd499835
9 changed files with 85 additions and 45 deletions
|
|
@ -26,8 +26,8 @@ pub fn all() -> impl Iterator<Item = Command> {
|
|||
.chain(member::cmds())
|
||||
.chain(config::cmds())
|
||||
.chain(fun::cmds())
|
||||
.map(|cmd| cmd.flag(("plaintext", ["pt"])))
|
||||
.map(|cmd| cmd.flag(("raw", ["r"])))
|
||||
.chain(switch::cmds())
|
||||
.map(|cmd| cmd.flag(("plaintext", ["pt"])).flag(("raw", ["r"])))
|
||||
}
|
||||
|
||||
pub const RESET: (&str, [&str; 2]) = ("reset", ["clear", "default"]);
|
||||
|
|
|
|||
|
|
@ -1 +1,31 @@
|
|||
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";
|
||||
|
||||
[
|
||||
command!(switch, out => "switch_out"),
|
||||
command!(switch, r#move, OpaqueString => "switch_move"), // TODO: datetime parsing
|
||||
command!(switch, delete => "switch_delete").flag(("all", ["clear", "c"])),
|
||||
command!(switch, edit, out => "switch_edit_out"),
|
||||
command!(switch, edit, MemberRefs => "switch_edit")
|
||||
.flag(("first", ["f"]))
|
||||
.flag(("remove", ["r"]))
|
||||
.flag(("append", ["a"]))
|
||||
.flag(("prepend", ["p"])),
|
||||
command!(switch, copy, MemberRefs => "switch_copy")
|
||||
.flag(("first", ["f"]))
|
||||
.flag(("remove", ["r"]))
|
||||
.flag(("append", ["a"]))
|
||||
.flag(("prepend", ["p"])),
|
||||
command!(switch, ("commands", ["help"]) => "switch_commands"),
|
||||
command!(switch, MemberRefs => "switch_do"),
|
||||
]
|
||||
.into_iter()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue