@ -53,7 +53,9 @@ func findIdentityName(config Config, prog string, args []string) string {
}
identities := config.Identities
host := extractHost(prog, args)
for match, name := range identities {
for _, identity := range identities {
match := identity.Key.(string)
name := identity.Value.(string)
if strings.Contains(host, match) {
return name
@ -15,7 +15,7 @@ type Config struct {
AgentsDir string
IdentitiesDir string
DefaultIdentity string `yaml:"default_identity"`
Identities map[string]string
Identities yaml.MapSlice
var sshOptions = map[string]map[string]string{