shitbox/corebox/commands/true/mod.rs

24 lines
552 B
Rust
Raw Permalink Normal View History

2022-12-25 18:29:09 -05:00
use super::Cmd;
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
#[derive(Debug)]
pub struct True;
2022-12-25 18:29:09 -05:00
impl Cmd for True {
fn cli(&self) -> clap::Command {
Command::new("true")
2022-12-25 18:29:09 -05:00
.about("Does nothing successfully")
.long_about("Exit with a status code indicating success")
.author("Nathan Fisher")
}
fn run(&self, _matches: &clap::ArgMatches) -> Result<(), Box<dyn Error>> {
2022-12-25 18:29:09 -05:00
process::exit(0);
}
fn path(&self) -> Option<shitbox::Path> {
Some(shitbox::Path::Bin)
2022-12-25 18:29:09 -05:00
}
2022-12-20 12:05:21 -05:00
}