summaryrefslogtreecommitdiffstats
path: root/src/client/ui.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/ui.rs')
-rw-r--r--src/client/ui.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/client/ui.rs b/src/client/ui.rs
index bb5b55f..7439e0f 100644
--- a/src/client/ui.rs
+++ b/src/client/ui.rs
@@ -76,6 +76,11 @@ const COMMANDS: &[CommandHelp] = &[
76 description: "clear trust for one address (credentials stay while the key is in use)", 76 description: "clear trust for one address (credentials stay while the key is in use)",
77 }, 77 },
78 CommandHelp { 78 CommandHelp {
79 name: "forget-login",
80 usage: "forget-login [ip:port]",
81 description: "forget the saved login (trust is kept)",
82 },
83 CommandHelp {
79 name: "hosts", 84 name: "hosts",
80 usage: "hosts", 85 usage: "hosts",
81 description: "list remembered hosts", 86 description: "list remembered hosts",
@@ -272,6 +277,15 @@ pub fn terminal_size_warning(columns: u16, rows: u16) -> Option<String> {
272 )) 277 ))
273} 278}
274 279
280/// List of games for the terminal's `games` command.
281pub fn game_lines(games: &[(String, String)]) -> Vec<String> {
282 let mut lines = vec!["Available games:".to_string()];
283 for (game, name) in games {
284 lines.push(format!(" - {game} ({name})"));
285 }
286 lines
287}
288
275/// One line per settled play, newest first. 289/// One line per settled play, newest first.
276pub fn history_lines(records: &[crate::history::PlayRecord]) -> Vec<String> { 290pub fn history_lines(records: &[crate::history::PlayRecord]) -> Vec<String> {
277 if records.is_empty() { 291 if records.is_empty() {