Skip to content

Commit 8edade6

Browse files
committed
remove some old kshell built in cmds
1 parent 2332400 commit 8edade6

File tree

1 file changed

+10
-31
lines changed

1 file changed

+10
-31
lines changed

crates/kshell/src/shell.rs

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ use hyperion_scheduler::{
2323
spawn,
2424
task::{processes, Pid, TASKS_READY, TASKS_RUNNING, TASKS_SLEEPING},
2525
};
26-
use hyperion_vfs::{
27-
self,
28-
path::{Path, PathBuf},
29-
};
26+
use hyperion_vfs::{self, path::PathBuf};
3027
use spin::Mutex;
3128

3229
use super::{term::Term, *};
@@ -106,7 +103,11 @@ impl Shell {
106103
}
107104

108105
pub fn init(&mut self) {
109-
_ = self.splash_cmd(None);
106+
use hyperion_kernel_info::{BUILD_REV, BUILD_TIME, NAME, VERSION};
107+
_ = writeln!(
108+
self.term,
109+
"Welcome to {NAME} - {VERSION} (built {BUILD_TIME} build [{BUILD_REV}])"
110+
);
110111
self.prompt();
111112
self.term.flush();
112113
}
@@ -201,9 +202,6 @@ impl Shell {
201202
.unwrap_or((line, None));
202203

203204
match cmd {
204-
"splash" => self.splash_cmd(args)?,
205-
"pwd" => self.pwd_cmd(args)?,
206-
"cd" => self.cd_cmd(args)?,
207205
"kbl" => self.kbl_cmd(args)?,
208206
"help" => self.help_cmd(args)?,
209207
"ps" => self.ps_cmd(args)?,
@@ -372,28 +370,6 @@ impl Shell {
372370
Ok(())
373371
}
374372

375-
fn splash_cmd(&mut self, _: Option<&str>) -> Result<()> {
376-
use hyperion_kernel_info::{BUILD_REV, BUILD_TIME, NAME, VERSION};
377-
// _ = writeln!(self.term, "{SPLASH}");
378-
_ = writeln!(
379-
self.term,
380-
"Welcome to {NAME} - {VERSION} (built {BUILD_TIME} build [{BUILD_REV}])"
381-
);
382-
Ok(())
383-
}
384-
385-
fn pwd_cmd(&mut self, _: Option<&str>) -> Result<()> {
386-
_ = writeln!(self.term, "{}", self.current_dir.as_str());
387-
Ok(())
388-
}
389-
390-
fn cd_cmd(&mut self, args: Option<&str>) -> Result<()> {
391-
let resource = Path::from_str(args.unwrap_or("/")).to_absolute(&self.current_dir);
392-
self.current_dir = resource.into_owned();
393-
394-
Ok(())
395-
}
396-
397373
fn kbl_cmd(&mut self, args: Option<&str>) -> Result<()> {
398374
let name = args.unwrap_or("us");
399375
if set_layout(name).is_none() {
@@ -405,7 +381,10 @@ impl Shell {
405381
}
406382

407383
fn help_cmd(&mut self, _: Option<&str>) -> Result<()> {
408-
_ = writeln!(self.term, "available built-in shell commands:\nsplash, pwd, cd, kbl, snake, help, ps, top, kill, exit, clear, lspci");
384+
_ = writeln!(
385+
self.term,
386+
"available built-in shell commands:\nkbl, help, ps, top, kill, exit, clear, lspci"
387+
);
409388

410389
Ok(())
411390
}

0 commit comments

Comments
 (0)