use super::Cmd; use crate::Path; use clap::Command; use std::{error::Error, process}; pub struct True { name: &'static str, path: Option, } pub const TRUE: True = True { name: "true", path: Some(Path::Bin), }; impl Cmd for True { fn name(&self) -> &str { self.name } fn cli(&self) -> clap::Command { Command::new(self.name) .about("Does nothing successfully") .long_about("Exit with a status code indicating success") .version(env!("CARGO_PKG_VERSION")) .author("Nathan Fisher") } fn run(&self, _matches: Option<&clap::ArgMatches>) -> Result<(), Box> { process::exit(0); } fn path(&self) -> Option { self.path } }