2021-02-10 09:20:22 +00:00
|
|
|
use clap::{Clap};
|
2021-02-04 11:22:19 +00:00
|
|
|
use std::path::PathBuf;
|
2021-02-10 09:20:22 +00:00
|
|
|
use smartstring::{LazyCompact, SmartString};
|
|
|
|
|
|
|
|
#[derive(Clap, PartialEq, Debug)]
|
|
|
|
pub enum OutputFormat {
|
|
|
|
Script,
|
|
|
|
Text
|
|
|
|
}
|
2021-02-04 11:22:19 +00:00
|
|
|
|
2021-02-05 09:24:08 +00:00
|
|
|
#[derive(Clap, Debug)]
|
2021-02-04 11:22:19 +00:00
|
|
|
pub struct Parameters {
|
|
|
|
/// Only examine files with these extensions (Comma-separated list)
|
2021-02-05 09:24:08 +00:00
|
|
|
#[clap(short, long, use_delimiter = true)]
|
2021-02-10 09:20:22 +00:00
|
|
|
pub extensions: Option<Vec<SmartString<LazyCompact>>>,
|
2021-02-04 11:22:19 +00:00
|
|
|
|
|
|
|
/// Don't skip hidden files and directories
|
2021-02-05 09:24:08 +00:00
|
|
|
#[clap(short, long)]
|
2021-02-04 11:22:19 +00:00
|
|
|
pub scan_hidden: bool,
|
|
|
|
|
2021-02-06 03:24:13 +00:00
|
|
|
/// Output format to use. See "--help formats" for more information.
|
2021-02-10 09:20:22 +00:00
|
|
|
#[clap(short, long, default_value="script", arg_enum)]
|
|
|
|
pub output_format: OutputFormat,
|
2021-02-06 03:24:13 +00:00
|
|
|
|
|
|
|
/// 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))]
|
2021-02-04 11:22:19 +00:00
|
|
|
// dirs: PathBuf
|
|
|
|
pub dirs: PathBuf,
|
|
|
|
}
|