|
|
@ -14,13 +14,24 @@ impl Prompt {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn print(&self) -> Result<()> {
|
|
|
|
pub fn print(&self) -> Result<()> {
|
|
|
|
unsafe {
|
|
|
|
match std::env::current_dir() {
|
|
|
|
|
|
|
|
Ok(d) => unsafe {
|
|
|
|
|
|
|
|
let text = d.to_str().unwrap().to_owned() + " " + &self.s;
|
|
|
|
|
|
|
|
Error::check(Console::WriteConsoleA(
|
|
|
|
|
|
|
|
stdout_handle()?,
|
|
|
|
|
|
|
|
text.as_bytes(),
|
|
|
|
|
|
|
|
None,
|
|
|
|
|
|
|
|
None,
|
|
|
|
|
|
|
|
))?;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Err(_) => unsafe {
|
|
|
|
Error::check(Console::WriteConsoleA(
|
|
|
|
Error::check(Console::WriteConsoleA(
|
|
|
|
stdout_handle()?,
|
|
|
|
stdout_handle()?,
|
|
|
|
self.s.as_bytes(),
|
|
|
|
self.s.as_bytes(),
|
|
|
|
None,
|
|
|
|
None,
|
|
|
|
None,
|
|
|
|
None,
|
|
|
|
))?;
|
|
|
|
))?;
|
|
|
|
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Ok(())
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
}
|
|
|
|