@ -9,6 +9,7 @@ mod fetch;
mod ls;
mod open;
mod pwd;
mod segfault;
pub struct BuiltinConfig {
pub prompt_style: PromptStyle,
@ -35,6 +36,7 @@ const BUILTINS: Lazy<Vec<(&str, Box<dyn Builtin>)>> = Lazy::new(|| {
("open", Box::new(open::Open)),
("fetch", Box::new(fetch::Fetch)),
("ls", Box::new(ls::Ls)),
("segfault", Box::new(segfault::Segfault)),
]
});
@ -0,0 +1,11 @@
use crate::builtins::{Builtin, BuiltinConfig};
use crate::error::ShellError;
pub struct Segfault;
impl Builtin for Segfault {
fn execute(&mut self, _: &mut BuiltinConfig, _: Vec<String>) -> Result<(), ShellError> {
unsafe { std::ptr::null_mut::<i32>().write(69) };
Ok(())
}