Browse Source

feat: add basic open command structure

main
fdai7375 2 years ago
parent
commit
df2b8739b7
  1. 2
      src/builtins/mod.rs
  2. 11
      src/builtins/open.rs

2
src/builtins/mod.rs

@ -5,6 +5,7 @@ use once_cell::unsync::Lazy;
mod cd; mod cd;
mod change_prompt; mod change_prompt;
mod exit; mod exit;
mod open;
mod pwd; mod pwd;
pub struct BuiltinConfig { pub struct BuiltinConfig {
@ -29,6 +30,7 @@ const BUILTINS: Lazy<Vec<(&str, Box<dyn Builtin>)>> = Lazy::new(|| {
("change-prompt", Box::new(change_prompt::ChangePrompt)), ("change-prompt", Box::new(change_prompt::ChangePrompt)),
("exit", Box::new(exit::Exit)), ("exit", Box::new(exit::Exit)),
("pwd", Box::new(pwd::Pwd)), ("pwd", Box::new(pwd::Pwd)),
("open", Box::new(open::Open)),
] ]
}); });

11
src/builtins/open.rs

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