Compare commits

...

1 Commits

Author SHA1 Message Date
fe326c8457 investigate podman container from the inside 2024-07-09 12:56:18 -07:00

View File

@ -20,6 +20,7 @@ struct Cli{
#[derive(Subcommand)] #[derive(Subcommand)]
enum Commands{ enum Commands{
Info(InfoSubcommand),
DownloadHistory(DownloadHistorySubcommand), DownloadHistory(DownloadHistorySubcommand),
Download(DownloadSubcommand), Download(DownloadSubcommand),
DownloadDecompile(DownloadDecompileSubcommand), DownloadDecompile(DownloadDecompileSubcommand),
@ -34,6 +35,11 @@ enum Commands{
DecompileHistoryIntoGit(DecompileHistoryIntoGitSubcommand), DecompileHistoryIntoGit(DecompileHistoryIntoGitSubcommand),
DownloadAndDecompileHistoryIntoGit(DownloadAndDecompileHistoryIntoGitSubcommand), DownloadAndDecompileHistoryIntoGit(DownloadAndDecompileHistoryIntoGitSubcommand),
} }
#[derive(Args)]
struct InfoSubcommand{
#[arg(long)]
path:PathBuf,
}
#[derive(Args)] #[derive(Args)]
struct DownloadHistorySubcommand{ 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] #[tokio::main]
async fn main()->AResult<()>{ async fn main()->AResult<()>{
let cli=Cli::parse(); let cli=Cli::parse();
match cli.command{ match cli.command{
Commands::Info(subcommand)=>info(subcommand.path).await,
Commands::DownloadHistory(subcommand)=>download_history(DownloadHistoryConfig{ Commands::DownloadHistory(subcommand)=>download_history(DownloadHistoryConfig{
continue_from_versions:subcommand.continue_from_versions.unwrap_or(false), continue_from_versions:subcommand.continue_from_versions.unwrap_or(false),
end_version:subcommand.end_version, end_version:subcommand.end_version,