feat: add command for quickly creating an item
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2024-05-15 15:25:55 +02:00
parent 4ad8120cb5
commit 832587b51d
2 changed files with 22 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ pub enum Commands {
WriteQuit,
Archive,
CreateSection { name: String },
CreateItem { name: String },
Edit,
ShowAll,
@@ -40,6 +41,9 @@ impl CommandParser {
"cs" | "create-section" => rest.first().map(|name| Commands::CreateSection {
name: name.to_string(),
}),
"ci" | "create-item" => Some(Commands::CreateItem {
name: rest.join(" ").to_string(),
}),
"e" | "edit" => Some(Commands::Edit),
"show-all" => Some(Commands::ShowAll),
"hide-done" => Some(Commands::HideDone),