commands: Adding "disconnect" command to force socket shutdown (#1057)
* commands: Adding "disconnect" command to force socket shutdown * Rename to `reconnect` * Add documentation to README Related to: #628 #1033 --------- Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
This commit is contained in:
@@ -157,6 +157,7 @@ pub enum Command {
|
||||
ShowRecommendations(TargetMode),
|
||||
Redraw,
|
||||
Execute(String),
|
||||
Reconnect,
|
||||
}
|
||||
|
||||
impl fmt::Display for Command {
|
||||
@@ -216,6 +217,7 @@ impl fmt::Display for Command {
|
||||
| Command::ReloadConfig
|
||||
| Command::Noop
|
||||
| Command::Logout
|
||||
| Command::Reconnect
|
||||
| Command::Redraw => vec![],
|
||||
};
|
||||
repr_tokens.append(&mut extras_args);
|
||||
@@ -266,6 +268,7 @@ impl Command {
|
||||
Command::ShowRecommendations(_) => "similar",
|
||||
Command::Redraw => "redraw",
|
||||
Command::Execute(_) => "exec",
|
||||
Command::Reconnect => "reconnect",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -721,6 +724,7 @@ pub fn parse(input: &str) -> Result<Vec<Command>, CommandParseError> {
|
||||
}
|
||||
"redraw" => Command::Redraw,
|
||||
"exec" => Command::Execute(args.join(" ")),
|
||||
"reconnect" => Command::Reconnect,
|
||||
_ => {
|
||||
return Err(NoSuchCommand {
|
||||
cmd: command.into(),
|
||||
|
||||
Reference in New Issue
Block a user