ssh-chat icon indicating copy to clipboard operation
ssh-chat copied to clipboard

Format multiline command results consistently

Open shazow opened this issue 7 years ago • 2 comments

Right now we have at least three variants:

[Guest3293] /help
-> Available commands:
/exit               - Exit the chat.
/ignore [USER]      - Hide messages from USER, /unignore USER to stop hiding.
/msg USER MESSAGE   - Send MESSAGE to USER.
/names              - List users who are connected.
/nick NAME          - Rename yourself.
/quiet              - Silence room announcements.
/reply MESSAGE      - Reply with MESSAGE to the previous private message.
/theme [colors|...] - Set your color theme.
/timestamp          - Timestamps after 30min of inactivity.
/whois USER         - Information about USER.
[Guest3293] /whois steve
-> name: steve
 > fingerprint: SHA256:stevedidntwanthisfingerprintincludedsoiediteditout=
 > client: SSH-2.0-OpenSSH_7.7
 > joined: 7 hours ago
[Guest3293] /theme
-> Current theme: colors
   Themes available: colors, solarized, hacker, mono

Open to debate for which format is best. Kinda leaning on what /theme is doing, just because /help would be confusing with > prefixes?

shazow avatar Aug 31 '18 19:08 shazow

I think I like the three leading spaces the most, it would be easy to implement across the board.

/help

[Guest3293] /help
-> Available commands:
   /exit               - Exit the chat.
   /ignore [USER]      - Hide messages from USER, /unignore USER to stop hiding.
   /msg USER MESSAGE   - Send MESSAGE to USER.
   /names              - List users who are connected.
   /nick NAME          - Rename yourself.
   /quiet              - Silence room announcements.
   /reply MESSAGE      - Reply with MESSAGE to the previous private message.
   /theme [colors|...] - Set your color theme.
   /timestamp          - Timestamps after 30min of inactivity.
   /whois USER         - Information about USER.

Maybe we could also change /whois since it seems a little redundant to include name: user? Would something like the following look better?

[Guest3293] /whois steve
-> WHOIS for "steve":
   fingerprint: SHA256:stevedidntwanthisfingerprintincludedsoiediteditout=
   client: SSH-2.0-OpenSSH_7.7
   joined: 7 hours ago

sleibrock avatar Aug 31 '18 19:08 sleibrock

@sleibrock Eh I wouldn't mess with the whois output. key: value format is more consistent, in case someone like yourself had to parse that output.

shazow avatar Aug 31 '18 19:08 shazow