Skip to content

Commit 190bbba

Browse files
authored
Merge pull request #138 from blacknon/develop
Version 0.6.9
2 parents 26d1df0 + f3d28a3 commit 190bbba

28 files changed

+46
-17
lines changed

cmd/lscp/args.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ USAGE:
143143
from_l.MultiFlag = false
144144
from_l.View()
145145
fromServer = from_l.SelectName
146+
147+
// Check selected
148+
if len(fromServer) == 0 {
149+
fmt.Fprintln(os.Stderr, "Server config is not set.")
150+
os.Exit(1)
151+
}
146152
if fromServer[0] == "ServerName" {
147153
fmt.Fprintln(os.Stderr, "Server not selected.")
148154
os.Exit(1)
@@ -156,6 +162,11 @@ USAGE:
156162
to_l.MultiFlag = true
157163
to_l.View()
158164
toServer = to_l.SelectName
165+
if len(toServer) == 0 {
166+
fmt.Fprintln(os.Stderr, "Server config is not set.")
167+
os.Exit(1)
168+
}
169+
159170
if toServer[0] == "ServerName" {
160171
fmt.Fprintln(os.Stderr, "Server not selected.")
161172
os.Exit(1)
@@ -171,6 +182,11 @@ USAGE:
171182
l.View()
172183

173184
selected = l.SelectName
185+
// Check selected
186+
if len(selected) == 0 {
187+
fmt.Fprintln(os.Stderr, "Server config is not set.")
188+
os.Exit(1)
189+
}
174190
if selected[0] == "ServerName" {
175191
fmt.Fprintln(os.Stderr, "Server not selected.")
176192
os.Exit(1)

cmd/lsftp/args.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ USAGE:
8787

8888
// selected check
8989
selected := l.SelectName
90+
91+
// Check selected
92+
if len(selected) == 0 {
93+
fmt.Fprintln(os.Stderr, "Server config is not set.")
94+
os.Exit(1)
95+
}
9096
if selected[0] == "ServerName" {
9197
fmt.Fprintln(os.Stderr, "Server not selected.")
9298
os.Exit(1)

cmd/lssh/args.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ USAGE:
151151

152152
l.View()
153153
selected = l.SelectName
154+
155+
// Check selected
156+
if len(selected) == 0 {
157+
fmt.Fprintln(os.Stderr, "Server config is not set.")
158+
os.Exit(1)
159+
}
154160
if selected[0] == "ServerName" {
155161
fmt.Fprintln(os.Stderr, "Server not selected.")
156162
os.Exit(1)

go.mod

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ require (
99
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
1010
github.com/BurntSushi/toml v0.3.1
1111
github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5 // indirect
12-
github.com/ThalesIgnite/crypto11 v1.2.5 // indirect
1312
github.com/VividCortex/ewma v1.2.0 // indirect
1413
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
1514
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 // indirect
16-
github.com/blacknon/go-sshlib v0.1.12
15+
github.com/blacknon/go-sshlib v0.1.13
1716
github.com/blacknon/go-x11auth v0.1.0 // indirect
1817
github.com/blacknon/textcol v0.0.1
1918
github.com/c-bata/go-prompt v0.2.6
@@ -50,8 +49,7 @@ require (
5049
gopkg.in/yaml.v3 v3.0.1 // indirect
5150
)
5251

52+
require github.com/blacknon/crypto11 v1.2.7 // indirect
53+
5354
// replace
54-
replace (
55-
github.com/ThalesIgnite/crypto11 v1.2.5 => github.com/blacknon/crypto11 v1.2.6
56-
github.com/c-bata/go-prompt v0.2.6 => github.com/blacknon/go-prompt v0.2.7
57-
)
55+
replace github.com/c-bata/go-prompt v0.2.6 => github.com/blacknon/go-prompt v0.2.7

go.sum

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpH
1010
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo=
1111
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
1212
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
13-
github.com/blacknon/crypto11 v1.2.6 h1:Mv+Boto0qVR1O2k5lmoCYcyXfiQYY7mQ1P/TcK5Tw5c=
14-
github.com/blacknon/crypto11 v1.2.6/go.mod h1:HThRIRjHpJIJwcExGgNuPCyf26HqcFVTTAnipaXWz7M=
13+
github.com/blacknon/crypto11 v1.2.7 h1:LKrnCeXAk4jQmpJTeg/tVvNjqEgKHIE+tYSNXQj8Fco=
14+
github.com/blacknon/crypto11 v1.2.7/go.mod h1:Z24sFD9pMX3NdUFzX52ggcV7HurAYAGvxud73BrHudA=
1515
github.com/blacknon/go-prompt v0.2.7 h1:dVdTqVplKvpT/k4bB9BlbcBYl/k6amYX5tvjYBmuKkI=
1616
github.com/blacknon/go-prompt v0.2.7/go.mod h1:zNBmC/BPAyr+3ey1oRhPxuXJS9zz1lEmJpwaoQroe3w=
17-
github.com/blacknon/go-sshlib v0.1.12 h1:K66DzwzF5RhlKQjcda0R7/FbvslXOayVd75UVzCKfZQ=
18-
github.com/blacknon/go-sshlib v0.1.12/go.mod h1:EqEKtFd4DInkF3Ryx+YXnj70u7pJenVr4H3uEGEgoHI=
17+
github.com/blacknon/go-sshlib v0.1.13 h1:QoFoMuGefHWOTr18riHoQux4/lVrrDmsfvBTNuueeNI=
18+
github.com/blacknon/go-sshlib v0.1.13/go.mod h1:Kxbot2GEniRqBduRtw8Tq6E8XtPLrFEKFmAHdlR+ipk=
1919
github.com/blacknon/go-x11auth v0.1.0 h1:SnljCPWcvglWeGAlKc1RAPMHnOfMpM9+GrTGEUQ1lqQ=
2020
github.com/blacknon/go-x11auth v0.1.0/go.mod h1:SKOCa19LluXHyB+OaLYobquzceE0SWxVW7e/qU5xGBM=
2121
github.com/blacknon/textcol v0.0.1 h1:x9h7yLPGyr8Pdz12XJ30h7Iz5mJlKd0CzfGYxhrmnk8=
@@ -75,7 +75,6 @@ github.com/sevlyar/go-daemon v0.1.5 h1:Zy/6jLbM8CfqJ4x4RPr7MJlSKt90f00kNM1D401C+
7575
github.com/sevlyar/go-daemon v0.1.5/go.mod h1:6dJpPatBT9eUwM5VCw9Bt6CdX9Tk6UWvhW3MebLDRKE=
7676
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
7777
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
78-
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
7978
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
8079
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
8180
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=

list/list.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ func (l *ListInfo) getFilterText() {
184184

185185
// View is display the list in TUI
186186
func (l *ListInfo) View() {
187+
l.getText()
188+
if len(l.DataText) == 1 {
189+
return
190+
}
191+
187192
if err := termbox.Init(); err != nil {
188193
panic(err)
189194
}
@@ -192,7 +197,6 @@ func (l *ListInfo) View() {
192197
// enable termbox mouse input
193198
termbox.SetInputMode(termbox.InputMouse)
194199

195-
l.getText()
196200
l.keyEvent()
197201
}
198202

0 commit comments

Comments
 (0)