From 39f47ef716a9dba025f1e8ec0ae6e0f28d55e0f1 Mon Sep 17 00:00:00 2001 From: Adam French Date: Wed, 18 Feb 2026 13:44:30 +0000 Subject: [PATCH] Add commands and options --- src/main.rs | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index d67ebfe..9e19aca 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,48 @@ -use clap::Parser; +use clap::{Parser, Subcommand}; +use std::error::Error; +use std::path::PathBuf; -fn main() { - println!("Hello, world!"); +#[derive(Parser)] +#[command(author, version, about, long_about = None)] +struct Args { + #[command(subcommand)] + command: Option, +} + +#[derive(Subcommand)] +enum Commands { + // Create a new tour + Init { + #[arg(short, long, value_name = "MESSAGE")] + message: Option, + }, + // Add steps to the tour + Commit { + files: Vec, + + #[arg(short, long, value_name = "MESSAGE")] + message: Option, + }, + // Finish the tour + End { + #[arg(short, long, value_name = "MESSAGE")] + message: Option, + }, + + // Go to next step of tour + Next { + #[arg(short, value_name = "NUM STEPS")] + n: Option, + }, + // Go to previous step of tour + Prev { + #[arg(short, value_name = "NUM STEPS")] + n: Option, + }, +} + +fn main() -> Result<(), Box> { + let args = Args::parse(); + + Ok(()) }