repo-flatten 0.2.0

A utility to flatten all files in the repository into a single file, consumed by LLMs. Will ignore .gitignore and hidden files.
//! Command line interface module for the flatten tool.

use clap::Parser;
use std::path::PathBuf;

#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
pub struct Args {
    /// The path to start searching for the git repository.
    #[arg(short, long, value_name = "REPO_PATH", default_value = ".")]
    pub repo: PathBuf,

    /// The path for the output file.
    #[arg(
        short,
        long,
        value_name = "OUTPUT_FILE",
        default_value = "flattened_files.txt"
    )]
    pub output: PathBuf,

    /// Only flatten files under these paths.
    /// Relative paths are resolved from current working directory.
    /// If not provided, flattens current directory if inside a repository.
    #[arg(short, long, value_name = "PATH")]
    pub path: Vec<PathBuf>,
}

/// Parse command line arguments.
pub fn parse_args() -> Args {
    Args::parse()
}