Skip to content

Commit

Permalink
Merge pull request #10 from StephenBrown2/get-canonical-case
Browse files Browse the repository at this point in the history
Add ssh_config.GetCanonicalCase to print correct key case
  • Loading branch information
xwjdsh committed Feb 11, 2022
2 parents 35e2595 + 5b860c5 commit cfb8a4b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 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/xwjdsh/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
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ require (
github.com/fatih/color v1.6.0
github.com/stretchr/testify v1.2.2
github.com/urfave/cli v1.20.0
github.com/xwjdsh/ssh_config v0.0.0-20180621174215-55799930d02f
github.com/xwjdsh/ssh_config v0.0.0-20220211060505-936c636e637e
)

require (
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/kevinburke/ssh_config v1.1.0 // indirect
github.com/mattn/go-colorable v0.0.9 // indirect
github.com/mattn/go-isatty v0.0.3 // indirect
github.com/pelletier/go-buffruneio v0.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sys v0.0.0-20180202135801-37707fdb30a5 // indirect
)
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRU
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/pelletier/go-buffruneio v0.2.0 h1:U4t4R6YkofJ5xHm3dJzuRpPZ0mr5MMCoAWooScCR7aA=
github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/xwjdsh/ssh_config v0.0.0-20180621174215-55799930d02f h1:EFg9tPfTWezWokNgPhIuuygLG+OgJQGlsBUPzgB6g64=
github.com/xwjdsh/ssh_config v0.0.0-20180621174215-55799930d02f/go.mod h1:6xndeVlkEiRvT4jjfb0b8yhU6M8+Mkh5dmvSUILKy/I=
github.com/xwjdsh/ssh_config v0.0.0-20220211060505-936c636e637e h1:WO3MRhEvVnOPqXs97VpmnEqHksO7BMdhhOt/hfONBYM=
github.com/xwjdsh/ssh_config v0.0.0-20220211060505-936c636e637e/go.mod h1:NuVEthmy5UVVrQFoZDXmf5lGTZMQ0IF0vHTzh21y6vs=
golang.org/x/sys v0.0.0-20180202135801-37707fdb30a5 h1:MF92a0wJ3gzSUVBpjcwdrDr5+klMFRNEEu6Mev4n00I=
golang.org/x/sys v0.0.0-20180202135801-37707fdb30a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=

0 comments on commit cfb8a4b

Please sign in to comment.