better parameters handling, implement import export

This commit is contained in:
dusk 2025-10-03 15:50:54 +00:00
parent e4f38c76a9
commit 5198f7d83b
No known key found for this signature in database
19 changed files with 250 additions and 174 deletions

View file

@ -9,23 +9,22 @@ pub fn cmds() -> impl Iterator<Item = Command> {
let copy = ("copy", ["add", "duplicate", "dupe"]);
let out = "out";
let edit_flags = [
("first", ["f"]),
("remove", ["r"]),
("append", ["a"]),
("prepend", ["p"]),
];
[
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, edit, Optional(MemberRefs) => "switch_edit").flags(edit_flags),
command!(switch, copy, Optional(MemberRefs) => "switch_copy").flags(edit_flags),
command!(switch, ("commands", ["help"]) => "switch_commands"),
command!(switch, MemberRefs => "switch_do"),
command!(switch, Optional(MemberRefs) => "switch_do"),
]
.into_iter()
}