use std::path::PathBuf; use colored::*; use clap::{Parser, Subcommand}; /// Repotool is a tool to manage multiple code repositories #[derive(Parser, Debug)] #[command(version, about)] struct Args { #[command(subcommand)] command: Command, } #[derive(Subcommand, Debug)] enum Command { ///List all repositories found in the directory tree List { /// Directory to start from #[arg(short, long)] directory: PathBuf, }, } fn main() -> Result<(), std::io::Error> { let args = Args::parse(); match args.command { Command::List { directory } => list_repos(directory)?, } Ok(()) } fn list_repos(directory: PathBuf) -> Result<(), std::io::Error> { let canonicalized = std::fs::canonicalize(directory)?; println!("Listing repositories under: {}", canonicalized.display().to_string().yellow()); Ok(()) }