Skip to content

Commit 5707ca6

Browse files
committed
Fix hostname normalisation in fancy table, fix missing SSH in client version
1 parent 6f13488 commit 5707ca6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/client/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func Run(addr, fingerprint, proxyAddr string) {
123123

124124
return nil
125125
},
126-
ClientVersion: internal.Version,
126+
ClientVersion: "SSH-" + internal.Version,
127127
}
128128

129129
for { // My take on a golang do {} while loop :P

internal/server/commands/list.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ type displayItem struct {
2323

2424
func fancyTable(tty io.ReadWriter, applicable []displayItem) {
2525

26-
t, _ := table.NewTable("Targets", "ID", "Hostname", "IP Address")
26+
t, _ := table.NewTable("Targets", "ID", "Hostname", "IP Address", "Version")
2727
for _, a := range applicable {
28-
t.AddValues(a.id, a.sc.User(), a.sc.RemoteAddr().String())
28+
t.AddValues(a.id, clients.NormaliseHostname(a.sc.User()), a.sc.RemoteAddr().String(), string(a.sc.ClientVersion()))
2929
}
3030

3131
t.Fprint(tty)
@@ -83,7 +83,7 @@ func (l *list) Run(tty io.ReadWriter, line terminal.ParsedLine) error {
8383

8484
for i, tr := range toReturn {
8585

86-
fmt.Fprintf(tty, "%s %s %s", tr.id, clients.NormaliseHostname(tr.sc.User()), tr.sc.RemoteAddr().String())
86+
fmt.Fprintf(tty, "%s %s %s, version: %s", tr.id, clients.NormaliseHostname(tr.sc.User()), tr.sc.RemoteAddr().String(), tr.sc.ClientVersion())
8787

8888
if i != len(toReturn)-1 {
8989
fmt.Fprint(tty, sep)

0 commit comments

Comments
 (0)