From 029fc48b53dabb4d4cd47b4c6d4bde56361be4e8 Mon Sep 17 00:00:00 2001 From: ozzy Date: Mon, 31 Aug 2026 14:48:08 -0500 Subject: [PATCH] feat(cli): block out cli blocked out the args and commands that will be implemented later --- src/cli.rs | 31 +++++++++++++++++++++++++++++++ src/main.rs | 7 ++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 src/cli.rs diff --git a/src/cli.rs b/src/cli.rs new file mode 100644 index 0000000..b5474f6 --- /dev/null +++ b/src/cli.rs @@ -0,0 +1,31 @@ +use clap::{Args, Parser, Subcommand}; + +#[derive(Debug, Parser)] +#[command(version, about = "a cli to change git users")] +pub struct Cli { + #[command(subcommand)] + command: Commands, +} + +#[derive(Debug, Subcommand)] +pub enum Commands { + List, + Use(UseArgs), + Add(AddArgs), +} + +#[derive(Debug, Args)] +pub struct UseArgs { + pub profile_name: String, + #[arg(short, long)] + pub global: bool, +} + +#[derive(Debug, Args)] +pub struct AddArgs { + pub profile_name: String, + #[arg(long)] + pub name: String, + #[arg(long)] + pub email: String, +} diff --git a/src/main.rs b/src/main.rs index 7406ad9..ab49348 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,8 @@ +use clap::Parser; + +mod cli; + fn main() { - println!("Hello, git!"); + let args = cli::Cli::parse(); + println!("{:?}", args); }