diff --git a/src/main.rs b/src/main.rs index e356e80..ec2971b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,6 +20,7 @@ struct Cli{ #[derive(Subcommand)] enum Commands{ + Info(InfoSubcommand), DownloadHistory(DownloadHistorySubcommand), Download(DownloadSubcommand), DownloadDecompile(DownloadDecompileSubcommand), @@ -34,6 +35,11 @@ enum Commands{ DecompileHistoryIntoGit(DecompileHistoryIntoGitSubcommand), DownloadAndDecompileHistoryIntoGit(DownloadAndDecompileHistoryIntoGitSubcommand), } +#[derive(Args)] +struct InfoSubcommand{ + #[arg(long)] + path:PathBuf, +} #[derive(Args)] struct DownloadHistorySubcommand{ @@ -271,10 +277,22 @@ impl Style{ } } +async fn info(path:PathBuf)->AResult<()>{ + let dir=std::env::current_dir().unwrap(); + println!("pwd={:?}",dir); + println!("path={path:?}"); + let mut read_dir=tokio::fs::read_dir(path).await?; + while let Some(entry)=read_dir.next_entry().await?{ + println!("{:?}",entry); + } + Ok(()) +} + #[tokio::main] async fn main()->AResult<()>{ let cli=Cli::parse(); match cli.command{ + Commands::Info(subcommand)=>info(subcommand.path).await, Commands::DownloadHistory(subcommand)=>download_history(DownloadHistoryConfig{ continue_from_versions:subcommand.continue_from_versions.unwrap_or(false), end_version:subcommand.end_version,