2025-09-24 21:32:42 +03:00
|
|
|
use super::*;
|
2025-01-04 07:35:04 +09:00
|
|
|
|
2025-09-24 21:32:42 +03:00
|
|
|
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";
|
|
|
|
|
|
2025-10-03 15:50:54 +00:00
|
|
|
let edit_flags = [
|
|
|
|
|
("first", ["f"]),
|
|
|
|
|
("remove", ["r"]),
|
|
|
|
|
("append", ["a"]),
|
|
|
|
|
("prepend", ["p"]),
|
|
|
|
|
];
|
|
|
|
|
|
2025-09-24 21:32:42 +03:00
|
|
|
[
|
|
|
|
|
command!(switch, out => "switch_out"),
|
|
|
|
|
command!(switch, r#move, OpaqueString => "switch_move"), // TODO: datetime parsing
|
|
|
|
|
command!(switch, delete => "switch_delete").flag(("all", ["clear", "c"])),
|
2025-10-08 04:29:48 +00:00
|
|
|
command!(switch, edit, out => "switch_edit_out").flag(YES),
|
2025-10-03 15:50:54 +00:00
|
|
|
command!(switch, edit, Optional(MemberRefs) => "switch_edit").flags(edit_flags),
|
|
|
|
|
command!(switch, copy, Optional(MemberRefs) => "switch_copy").flags(edit_flags),
|
2025-09-24 21:32:42 +03:00
|
|
|
command!(switch, ("commands", ["help"]) => "switch_commands"),
|
2025-10-03 15:50:54 +00:00
|
|
|
command!(switch, Optional(MemberRefs) => "switch_do"),
|
2025-09-24 21:32:42 +03:00
|
|
|
]
|
|
|
|
|
.into_iter()
|
|
|
|
|
}
|