feat(dirlist): Add listing of directory
This commit is contained in:
parent
d09c1d60f9
commit
2b47cf5321
4 changed files with 56 additions and 1 deletions
15
src/main.rs
15
src/main.rs
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue