Dart CLI tool that flattens a directory structure. Here's a brief explanation of its functionality:
- It uses the
argspackage to parse command-line arguments for input and output directories. - It validates the input directory and creates the output directory.
- The
_processDirectoryfunction recursively processes the input directory, copying all files to the root of the output directory. - It handles potential file name conflicts by appending a numeric suffix to duplicate file names.
To use this tool, you would run it from the command line like this:
dart run flattener -i <input_directory> -o <output_directory>