Skip to content

Commit

Permalink
coreutils: invalid commands don't invoke the base command
Browse files Browse the repository at this point in the history
  • Loading branch information
xor-bits committed Feb 13, 2024
1 parent fc3b8ba commit 2e66dc6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion userspace/coreutils/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ fn main() {

let result = match cmd {
"cat" => cat::cmd(args),
"coreutils" => crate::cmd(),
"cp" => cp::cmd(args),
"date" => date::cmd(args),
"echo" => echo::cmd(args),
Expand All @@ -37,7 +38,10 @@ fn main() {
"random" => random::cmd(args),
"sleep" => sleep::cmd(args),
"touch" => touch::cmd(args),
_ => crate::cmd(),
_ => {
eprintln!("`{cmd}` is not part of hyperion coreutils");
exit(-1);
}
};

if let Err(err) = result {
Expand Down

0 comments on commit 2e66dc6

Please sign in to comment.