Browse Source

feat: add sus command

main
fdai7374 2 years ago
parent
commit
7d3e8f741e
  1. 2
      src/builtins/mod.rs
  2. 30
      src/builtins/sus.rs

2
src/builtins/mod.rs

@ -10,6 +10,7 @@ mod ls;
mod open; mod open;
mod pwd; mod pwd;
mod segfault; mod segfault;
mod sus;
pub struct BuiltinConfig { pub struct BuiltinConfig {
pub prompt_style: PromptStyle, pub prompt_style: PromptStyle,
@ -37,6 +38,7 @@ const BUILTINS: Lazy<Vec<(&str, Box<dyn Builtin>)>> = Lazy::new(|| {
("open", Box::new(open::Open)), ("open", Box::new(open::Open)),
("pwd", Box::new(pwd::Pwd)), ("pwd", Box::new(pwd::Pwd)),
("segfault", Box::new(segfault::Segfault)), ("segfault", Box::new(segfault::Segfault)),
("sus",Box::new(sus::sus)),
] ]
}); });

30
src/builtins/sus.rs

@ -0,0 +1,30 @@
use crate::error::ShellError;
use crate::builtins::{Builtin, BuiltinConfig};
pub struct sus;
impl Builtin for sus {
fn execute(&mut self, _: &mut BuiltinConfig, _: Vec<String>) -> Result<(), ShellError> {
println!("
");
Ok(())
}
}
Loading…
Cancel
Save