31 lines
859 B
Rust
31 lines
859 B
Rust
use std::path::PathBuf;
|
|
|
|
use clap::Clap;
|
|
use smartstring::{LazyCompact, SmartString};
|
|
|
|
#[derive(Clap, PartialEq, Debug)]
|
|
pub enum OutputFormat {
|
|
Script,
|
|
Text,
|
|
}
|
|
|
|
#[derive(Clap, Debug)]
|
|
pub struct Parameters {
|
|
/// Only examine files with these extensions (Comma-separated list)
|
|
#[clap(short, long, use_delimiter = true, require_delimiter = true)]
|
|
pub extensions: Option<Vec<SmartString<LazyCompact>>>,
|
|
|
|
/// Don't skip hidden files and directories
|
|
#[clap(short, long)]
|
|
pub scan_hidden: bool,
|
|
|
|
/// Output format to use. See "--help formats" for more information.
|
|
#[clap(short, long, default_value = "script", arg_enum)]
|
|
pub output_format: OutputFormat,
|
|
|
|
/// Directory to process
|
|
// TODO: right now this can only take a single directory - should this be improved?
|
|
#[clap(name = "DIR", default_value = ".", parse(from_os_str))]
|
|
pub dirs: PathBuf,
|
|
}
|