flatten-directory 1.0.0

move all files from sub-directories to target directory, then remove all directories recursively
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use anyhow::Result;
use clap::Parser;
use flatten_directory::FlattenDirectory;
use std::path::PathBuf;

#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
struct Args {
    #[arg(required = true)]
    path: PathBuf,
}

fn main() -> Result<()> {
    let args: Args = Args::parse();
    FlattenDirectory::new(args.path).execute()?;
    Ok(())
}