From fe326c8457391a5fd02c1ab514c2eede80a93e81 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 9 Jul 2024 12:56:18 -0700 Subject: [PATCH] investigate podman container from the inside --- src/main.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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,