36 lines
1.0 KiB
Rust
36 lines
1.0 KiB
Rust
use std::path::PathBuf;
|
|
|
|
use clap::Clap;
|
|
use smartstring::{LazyCompact, SmartString};
|
|
use crate::extensionset::ExtensionSet;
|
|
|
|
#[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, required_unless_present = "ext-set")]
|
|
pub exts: Option<Vec<SmartString<LazyCompact>>>,
|
|
|
|
/// write good docs 0uo
|
|
#[clap(short = 'E', long, arg_enum, required_unless_present = "exts")]
|
|
pub ext_set: Option<ExtensionSet>,
|
|
|
|
/// 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,
|
|
}
|