shitbox/utilbox/commands/mod.rs
2023-02-06 18:57:28 -05:00

24 lines
618 B
Rust

use shitbox::Cmd;
mod blkid;
mod clear;
mod mount;
mod mountpoint;
mod umount;
mod utilbox;
///
/// Parses a string into a command to run
#[must_use]
#[allow(clippy::box_default)]
pub fn get(name: &str) -> Option<Box<dyn Cmd>> {
match name {
"clear" => Some(Box::new(clear::Clear::default())),
"mountpoint" => Some(Box::new(mountpoint::Mountpoint::default())),
"umount" => Some(Box::new(umount::Umount::default())),
"utilbox" => Some(Box::new(utilbox::Utilbox::default())),
_ => None,
}
}
pub static COMMANDS: [&str; 4] = ["clear", "mountpoint", "umount", "utilbox"];