2022-12-25 18:29:09 -05:00
|
|
|
use super::Cmd;
|
2022-12-20 12:05:21 -05:00
|
|
|
use crate::Path;
|
2022-12-20 18:35:45 -05:00
|
|
|
use clap::Command;
|
2022-12-25 18:29:09 -05:00
|
|
|
use std::{error::Error, process};
|
2022-12-20 12:05:21 -05:00
|
|
|
|
2022-12-25 23:50:37 -05:00
|
|
|
#[derive(Debug)]
|
2022-12-25 18:29:09 -05:00
|
|
|
pub struct False {
|
|
|
|
name: &'static str,
|
|
|
|
path: Option<Path>,
|
2022-12-20 12:05:21 -05:00
|
|
|
}
|
|
|
|
|
2023-01-06 23:41:02 -05:00
|
|
|
impl Default for False {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self {
|
|
|
|
name: "false",
|
|
|
|
path: Some(crate::Path::Bin),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-12-25 18:29:09 -05:00
|
|
|
|
|
|
|
impl Cmd for False {
|
|
|
|
fn name(&self) -> &str {
|
|
|
|
self.name
|
|
|
|
}
|
|
|
|
|
|
|
|
fn cli(&self) -> clap::Command {
|
|
|
|
Command::new(self.name)
|
|
|
|
.about("Does nothing unsuccessfully")
|
|
|
|
.long_about("Exit with a status code indicating failure")
|
|
|
|
.author("Nathan Fisher")
|
|
|
|
}
|
|
|
|
|
|
|
|
fn run(&self, _matches: Option<&clap::ArgMatches>) -> Result<(), Box<dyn Error>> {
|
|
|
|
process::exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn path(&self) -> Option<Path> {
|
|
|
|
self.path
|
|
|
|
}
|
2022-12-20 12:05:21 -05:00
|
|
|
}
|