Browse Source

refactoring: format help command

main
fdai7374 2 years ago
committed by fdai7451
parent
commit
6569478c33
  1. 4
      src/builtins/help.rs
  2. 2
      src/builtins/mod.rs

4
src/builtins/help.rs

@ -1,11 +1,9 @@
use crate::error::ShellError;
use crate::builtins::{Builtin, BuiltinConfig}; use crate::builtins::{Builtin, BuiltinConfig};
use crate::error::ShellError;
pub struct Help; pub struct Help;
impl Builtin for Help { impl Builtin for Help {
fn execute(&mut self, _: &mut BuiltinConfig, _: Vec<String>) -> Result<(), ShellError> { fn execute(&mut self, _: &mut BuiltinConfig, _: Vec<String>) -> Result<(), ShellError> {
let commands = let commands =
"cd changes current working directory "cd changes current working directory

2
src/builtins/mod.rs

@ -35,12 +35,12 @@ 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)),
("fetch", Box::new(fetch::Fetch)), ("fetch", Box::new(fetch::Fetch)),
("help", Box::new(help::Help)),
("ls", Box::new(ls::Ls)), ("ls", Box::new(ls::Ls)),
("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)), ("sus", Box::new(sus::Sus)),
("help", Box::new(help::Help)),
] ]
}); });

Loading…
Cancel
Save