fif/src/parameters.rs

31 lines
856 B
Rust
Raw Normal View History

2021-02-04 11:22:19 +00:00
use std::path::PathBuf;
use clap::Clap;
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)
#[clap(short, long, use_delimiter = true, require_delimiter = true)]
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.
#[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
pub dirs: PathBuf,
}