use crate::prelude::*;
use clap::Parser;
const ABOUT: &str = "RSVIM - The VIM editor reinvented in Rust+TypeScript";
#[derive(Debug, Clone, Parser)]
#[command(
disable_version_flag = true,
about = ABOUT,
)]
pub struct CliOptions {
#[arg(short = 'V', long = "version", help = "Print version")]
version: bool,
#[arg(help = "Edit file(s)")]
file: Vec<PathBuf>,
}
impl CliOptions {
pub fn version(&self) -> bool {
self.version
}
pub fn file(&self) -> &Vec<PathBuf> {
&self.file
}
#[cfg(test)]
pub fn new(version: bool, file: Vec<PathBuf>) -> Self {
Self { version, file }
}
#[cfg(test)]
pub fn empty() -> Self {
Self {
version: false,
file: vec![],
}
}
}