diff --git a/src/main.rs b/src/main.rs index c768475..c0d199e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,35 @@ -use std::env; +use clap::{Parser, Subcommand}; + +#[derive(Parser)] +#[command(name = "todo")] +#[command(about = "A simple todo list manager")] +struct Cli { + #[command(subcommand)] + command: Commands, +} + +#[derive(Subcommand)] +enum Commands { + Add { task: String }, + List, + Complete { id: usize }, + Remove { id: usize }, +} fn main() { - let args: Vec = env::args().collect(); - println!("Arguments: {:?}", args); + let cli = Cli::parse(); + match cli.command { + Commands::Add { task } => { + println!("Adding task: {}", task); + } + Commands::List => { + println!("Listing tasks"); + } + Commands::Complete { id } => { + println!("Completing task with id: {}", id); + } + Commands::Remove { id } => { + println!("Removing task with id: {}", id); + } + } }