Skip to content

Commit b66f3c7

Browse files
committed
update
1 parent abc27b2 commit b66f3c7

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

myssh/keymg.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -211,17 +211,17 @@ func createDefaultSSHKey(env *Environment) error {
211211
sp.Template = customTemplate
212212
sp.ResultTemplate = resultTemplate
213213
sp.SelectedChoiceStyle = func(c *selection.Choice) string {
214-
a, _ := c.Value.(article)
214+
a, _ := c.Value.(KeyType)
215215

216-
return blue.Bold().Styled(a.Name) + " " + termenv.String("("+a.ID+")").Faint().String()
216+
return blue.Bold().Styled(a.Name) + " " + termenv.String("("+a.KeyBaseName+")").Faint().String()
217217
}
218218
sp.UnselectedChoiceStyle = func(c *selection.Choice) string {
219-
a, _ := c.Value.(article)
219+
a, _ := c.Value.(KeyType)
220220

221-
return a.Name + " " + termenv.String("("+a.ID+")").Faint().String()
221+
return a.Name + " " + termenv.String("("+a.KeyBaseName+")").Faint().String()
222222
}
223223
sp.ExtendedTemplateFuncs = map[string]interface{}{
224-
"name": func(c *selection.Choice) string { return c.Value.(article).Name },
224+
"name": func(c *selection.Choice) string { return c.Value.(KeyType).Name },
225225
}
226226

227227
choice, err := sp.RunPrompt()
@@ -797,4 +797,4 @@ func getDefaultKey(sshPath string) (error, string) {
797797
}
798798

799799
return nil, keyfile
800-
}
800+
}

selection/choice.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,11 @@ func Choices(sliceChoices interface{}) []*Choice {
4949
choices := make([]*Choice, 0, slice.Len())
5050
for i := 0; i < slice.Len(); i++ {
5151
value := slice.Index(i).Interface()
52-
//fmt.Println(value)
5352
choices = append(choices, NewChoice(value))
5453
}
5554

5655
return choices
5756
default:
5857
panic("SliceChoices argument is not a slice")
5958
}
60-
}
59+
}

0 commit comments

Comments
 (0)