Skip to content

Commit

Permalink
Add ssh_config.GetCanonicalCase to print correct key case
Browse files Browse the repository at this point in the history
TODO: Remove reference to github.com/StephenBrown2/ssh_config when kevinburke/ssh_config#39 or xwjdsh/ssh_config#1 get merged
  • Loading branch information
sbrownjc committed Feb 10, 2022
1 parent 35e2595 commit cf1aad9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/manssh/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/xwjdsh/manssh"
"github.com/xwjdsh/manssh/utils"
"github.com/StephenBrown2/ssh_config"

"github.com/fatih/color"
"github.com/urfave/cli"
Expand Down Expand Up @@ -68,13 +69,15 @@ func printHost(showPath bool, host *manssh.HostConfig) {
if value == "" {
continue
}
key = ssh_config.GetCanonicalCase(key)
color.Cyan("\t %s = %s\n", key, value)
}
for _, key := range utils.SortKeys(host.ImplicitConfig) {
value := host.ImplicitConfig[key]
if value == "" {
continue
}
key = ssh_config.GetCanonicalCase(key)
fmt.Printf("\t %s = %s\n", key, value)
}
fmt.Println()
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module github.com/xwjdsh/manssh
go 1.17

require (
github.com/StephenBrown2/ssh_config v0.0.0-20220210203636-036f61b9d304
github.com/fatih/color v1.6.0
github.com/stretchr/testify v1.2.2
github.com/urfave/cli v1.20.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
github.com/StephenBrown2/ssh_config v0.0.0-20220210203636-036f61b9d304 h1:8hAMVQVab9hnIUPWdC9EpjQ4hQZ2cFA1IWTcVK6OFlc=
github.com/StephenBrown2/ssh_config v0.0.0-20220210203636-036f61b9d304/go.mod h1:+xBtisLP9jShhZEbtomFsY6e/rvCwloqPf1qbA1HCaU=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fatih/color v1.6.0 h1:66qjqZk8kalYAvDRtM1AdAJQI0tj4Wrue3Eq3B3pmFU=
Expand Down

0 comments on commit cf1aad9

Please sign in to comment.