feat(dirlist): Add listing of directory

This commit is contained in:
Andreas Mieke 2023-11-02 19:25:54 +01:00
parent d09c1d60f9
commit 2b47cf5321
4 changed files with 56 additions and 1 deletions

View file

@ -1,8 +1,9 @@
mod config;
mod directory;
use log::*;
use clap::Parser;
use std::path::PathBuf;
use std::{path::PathBuf, env};
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None)]
@ -55,4 +56,16 @@ fn main() {
info!("Found config: {:#?}", cfg);
let search_path = if args.path.is_none() {
env::current_dir().unwrap()
} else {
args.path.unwrap()
};
let files = directory::list_files(search_path);
for file in files {
info!("Found: {}", file.to_str().unwrap());
}
}