Skip to content

Commit cf1aad9

Browse files
committed
Add ssh_config.GetCanonicalCase to print correct key case
TODO: Remove reference to github.com/StephenBrown2/ssh_config when kevinburke/ssh_config#39 or xwjdsh/ssh_config#1 get merged
1 parent 35e2595 commit cf1aad9

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

cmd/manssh/print.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77

88
"github.com/xwjdsh/manssh"
99
"github.com/xwjdsh/manssh/utils"
10+
"github.com/StephenBrown2/ssh_config"
1011

1112
"github.com/fatih/color"
1213
"github.com/urfave/cli"
@@ -68,13 +69,15 @@ func printHost(showPath bool, host *manssh.HostConfig) {
6869
if value == "" {
6970
continue
7071
}
72+
key = ssh_config.GetCanonicalCase(key)
7173
color.Cyan("\t %s = %s\n", key, value)
7274
}
7375
for _, key := range utils.SortKeys(host.ImplicitConfig) {
7476
value := host.ImplicitConfig[key]
7577
if value == "" {
7678
continue
7779
}
80+
key = ssh_config.GetCanonicalCase(key)
7881
fmt.Printf("\t %s = %s\n", key, value)
7982
}
8083
fmt.Println()

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module github.com/xwjdsh/manssh
33
go 1.17
44

55
require (
6+
github.com/StephenBrown2/ssh_config v0.0.0-20220210203636-036f61b9d304
67
github.com/fatih/color v1.6.0
78
github.com/stretchr/testify v1.2.2
89
github.com/urfave/cli v1.20.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
github.com/StephenBrown2/ssh_config v0.0.0-20220210203636-036f61b9d304 h1:8hAMVQVab9hnIUPWdC9EpjQ4hQZ2cFA1IWTcVK6OFlc=
2+
github.com/StephenBrown2/ssh_config v0.0.0-20220210203636-036f61b9d304/go.mod h1:+xBtisLP9jShhZEbtomFsY6e/rvCwloqPf1qbA1HCaU=
13
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
24
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
35
github.com/fatih/color v1.6.0 h1:66qjqZk8kalYAvDRtM1AdAJQI0tj4Wrue3Eq3B3pmFU=

0 commit comments

Comments
 (0)