|
@ -1,16 +1,15 @@ |
|
|
use system_shutdown::logout;
|
|
|
|
|
|
use crate::builtins::{Builtin, BuiltinConfig};
|
|
|
use crate::builtins::{Builtin, BuiltinConfig};
|
|
|
use crate::error::ShellError;
|
|
|
use crate::error::ShellError;
|
|
|
|
|
|
use system_shutdown::logout;
|
|
|
|
|
|
|
|
|
pub struct Logout;
|
|
|
pub struct Logout;
|
|
|
|
|
|
|
|
|
impl Builtin for Logout {
|
|
|
impl Builtin for Logout {
|
|
|
fn execute(&mut self, _: &mut BuiltinConfig, _: Vec<String>) -> Result<(), ShellError> {
|
|
|
fn execute(&mut self, _: &mut BuiltinConfig, _: Vec<String>) -> Result<(), ShellError> {
|
|
|
match logout() {
|
|
|
match logout() {
|
|
|
Ok(_)=>println!("Logging out"),
|
|
|
|
|
|
|
|
|
Ok(_) => println!("Logging out"),
|
|
|
Err(error) => eprintln!("Failed to log out: {}", error),
|
|
|
Err(error) => eprintln!("Failed to log out: {}", error),
|
|
|
}
|
|
|
}
|
|
|
Ok(())
|
|
|
Ok(())
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|