|
@ -0,0 +1,27 @@ |
|
|
|
|
|
use crate::error::ShellError;
|
|
|
|
|
|
use crate::builtins::{Builtin, BuiltinConfig};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub struct Help;
|
|
|
|
|
|
|
|
|
|
|
|
impl Builtin for Help {
|
|
|
|
|
|
|
|
|
|
|
|
fn execute(&mut self, _: &mut BuiltinConfig, _: Vec<String>) -> Result<(), ShellError> {
|
|
|
|
|
|
let commands =
|
|
|
|
|
|
"cd changes current working directory
|
|
|
|
|
|
change-prompt changes prompt style (default, bashlike, simpledirectory)
|
|
|
|
|
|
exit exits the shell
|
|
|
|
|
|
fetch prints out system information
|
|
|
|
|
|
help displays this command
|
|
|
|
|
|
ls lists contents of directory
|
|
|
|
|
|
open shows content of files
|
|
|
|
|
|
pwd shows path to current working directory
|
|
|
|
|
|
segfault exit but through segfault
|
|
|
|
|
|
sus shows amogus";
|
|
|
|
|
|
|
|
|
|
|
|
for line in commands.lines(){
|
|
|
|
|
|
println!("{}",line.trim_start());
|
|
|
|
|
|
}
|
|
|
|
|
|
Ok(())
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|