Skip to content

Commit

Permalink
update promptui use HideSelected
Browse files Browse the repository at this point in the history
  • Loading branch information
yinheli committed Mar 11, 2019
1 parent 28f7038 commit 66cba32
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 5 additions & 4 deletions cmd/sshw/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,11 @@ func main() {

func choose(parent, trees []*sshw.Node) *sshw.Node {
prompt := promptui.Select{
Label: "select host",
Items: trees,
Templates: templates,
Size: 20,
Label: "select host",
Items: trees,
Templates: templates,
Size: 20,
HideSelected: true,
Searcher: func(input string, index int) bool {
node := trees[index]
content := fmt.Sprintf("%s %s %s", node.Name, node.User, node.Host)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/atrox/homedir v1.0.0
github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e
github.com/magefile/mage v1.8.0
github.com/manifoldco/promptui v0.3.2
github.com/manifoldco/promptui v0.3.3-0.20190221150523-ae9f05e7444d
github.com/nicksnyder/go-i18n v1.10.0 // indirect
github.com/pelletier/go-buffruneio v0.2.0 // indirect
github.com/pelletier/go-toml v1.2.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ github.com/magefile/mage v1.8.0 h1:mzL+xIopvPURVBwHG9A50JcjBO+xV3b5iZ7khFRI+5E=
github.com/magefile/mage v1.8.0/go.mod h1:IUDi13rsHje59lecXokTfGX0QIzO45uVPlXnJYsXepA=
github.com/manifoldco/promptui v0.3.2 h1:rir7oByTERac6jhpHUPErHuopoRDvO3jxS+FdadEns8=
github.com/manifoldco/promptui v0.3.2/go.mod h1:8JU+igZ+eeiiRku4T5BjtKh2ms8sziGpSYl1gN8Bazw=
github.com/manifoldco/promptui v0.3.3-0.20190221150523-ae9f05e7444d h1:Vt/4aRLLXdhHC+JD+laJi3CyzEdGna+EcocJYAfG2ZI=
github.com/manifoldco/promptui v0.3.3-0.20190221150523-ae9f05e7444d/go.mod h1:8JU+igZ+eeiiRku4T5BjtKh2ms8sziGpSYl1gN8Bazw=
github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
Expand Down

0 comments on commit 66cba32

Please sign in to comment.