Compare commits
No commits in common. "701643848aa142c0f7d35e62816a52bfb2df6168" and "142d7211bc786502b4d1c5491aef8f46c1ca1e69" have entirely different histories.
701643848a
...
142d7211bc
2 changed files with 3 additions and 10 deletions
|
@ -24,14 +24,9 @@ impl Builtin {
|
|||
let mut args = argv.clone();
|
||||
let program = args.remove(0);
|
||||
|
||||
let function = match program.as_str() {
|
||||
"cd" => Some(builtins::cd),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
if function.is_some() {
|
||||
if program == "cd" {
|
||||
Ok(Self {
|
||||
function: function.unwrap(),
|
||||
function: builtins::cd,
|
||||
args,
|
||||
})
|
||||
} else {
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
use std::env;
|
||||
use std::fmt::{Display, Formatter, Result};
|
||||
use std::path::Path;
|
||||
|
||||
pub fn print_error(message: &str) {
|
||||
let name = env::args().next().unwrap_or(String::from("rash"));
|
||||
let name = std::env::args().next().unwrap();
|
||||
let name = Path::new(&name).file_name().unwrap().to_str().unwrap();
|
||||
|
||||
eprintln!("{}: {}", name, message);
|
||||
|
|
Loading…
Reference in a new issue