Skip to content

Commit 66cba32

Browse files
committed
update promptui use HideSelected
1 parent 28f7038 commit 66cba32

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

cmd/sshw/main.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ func main() {
9595

9696
func choose(parent, trees []*sshw.Node) *sshw.Node {
9797
prompt := promptui.Select{
98-
Label: "select host",
99-
Items: trees,
100-
Templates: templates,
101-
Size: 20,
98+
Label: "select host",
99+
Items: trees,
100+
Templates: templates,
101+
Size: 20,
102+
HideSelected: true,
102103
Searcher: func(input string, index int) bool {
103104
node := trees[index]
104105
content := fmt.Sprintf("%s %s %s", node.Name, node.User, node.Host)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
github.com/atrox/homedir v1.0.0
77
github.com/kevinburke/ssh_config v0.0.0-20180830205328-81db2a75821e
88
github.com/magefile/mage v1.8.0
9-
github.com/manifoldco/promptui v0.3.2
9+
github.com/manifoldco/promptui v0.3.3-0.20190221150523-ae9f05e7444d
1010
github.com/nicksnyder/go-i18n v1.10.0 // indirect
1111
github.com/pelletier/go-buffruneio v0.2.0 // indirect
1212
github.com/pelletier/go-toml v1.2.0 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ github.com/magefile/mage v1.8.0 h1:mzL+xIopvPURVBwHG9A50JcjBO+xV3b5iZ7khFRI+5E=
3737
github.com/magefile/mage v1.8.0/go.mod h1:IUDi13rsHje59lecXokTfGX0QIzO45uVPlXnJYsXepA=
3838
github.com/manifoldco/promptui v0.3.2 h1:rir7oByTERac6jhpHUPErHuopoRDvO3jxS+FdadEns8=
3939
github.com/manifoldco/promptui v0.3.2/go.mod h1:8JU+igZ+eeiiRku4T5BjtKh2ms8sziGpSYl1gN8Bazw=
40+
github.com/manifoldco/promptui v0.3.3-0.20190221150523-ae9f05e7444d h1:Vt/4aRLLXdhHC+JD+laJi3CyzEdGna+EcocJYAfG2ZI=
41+
github.com/manifoldco/promptui v0.3.3-0.20190221150523-ae9f05e7444d/go.mod h1:8JU+igZ+eeiiRku4T5BjtKh2ms8sziGpSYl1gN8Bazw=
4042
github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
4143
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
4244
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=

0 commit comments

Comments
 (0)