diff --git a/cmd/lscp/args.go b/cmd/lscp/args.go index e4f21aeb..d173bc3f 100644 --- a/cmd/lscp/args.go +++ b/cmd/lscp/args.go @@ -143,6 +143,12 @@ USAGE: from_l.MultiFlag = false from_l.View() fromServer = from_l.SelectName + + // Check selected + if len(fromServer) == 0 { + fmt.Fprintln(os.Stderr, "Server config is not set.") + os.Exit(1) + } if fromServer[0] == "ServerName" { fmt.Fprintln(os.Stderr, "Server not selected.") os.Exit(1) @@ -156,6 +162,11 @@ USAGE: to_l.MultiFlag = true to_l.View() toServer = to_l.SelectName + if len(toServer) == 0 { + fmt.Fprintln(os.Stderr, "Server config is not set.") + os.Exit(1) + } + if toServer[0] == "ServerName" { fmt.Fprintln(os.Stderr, "Server not selected.") os.Exit(1) @@ -171,6 +182,11 @@ USAGE: l.View() selected = l.SelectName + // Check selected + if len(selected) == 0 { + fmt.Fprintln(os.Stderr, "Server config is not set.") + os.Exit(1) + } if selected[0] == "ServerName" { fmt.Fprintln(os.Stderr, "Server not selected.") os.Exit(1) diff --git a/cmd/lsftp/args.go b/cmd/lsftp/args.go index 8eb6bf6e..d69dfedf 100644 --- a/cmd/lsftp/args.go +++ b/cmd/lsftp/args.go @@ -87,6 +87,12 @@ USAGE: // selected check selected := l.SelectName + + // Check selected + if len(selected) == 0 { + fmt.Fprintln(os.Stderr, "Server config is not set.") + os.Exit(1) + } if selected[0] == "ServerName" { fmt.Fprintln(os.Stderr, "Server not selected.") os.Exit(1) diff --git a/cmd/lssh/args.go b/cmd/lssh/args.go index 28c5e6fa..e5d4c6f8 100644 --- a/cmd/lssh/args.go +++ b/cmd/lssh/args.go @@ -151,6 +151,12 @@ USAGE: l.View() selected = l.SelectName + + // Check selected + if len(selected) == 0 { + fmt.Fprintln(os.Stderr, "Server config is not set.") + os.Exit(1) + } if selected[0] == "ServerName" { fmt.Fprintln(os.Stderr, "Server not selected.") os.Exit(1) diff --git a/go.mod b/go.mod index b42bc63a..16ed97ce 100644 --- a/go.mod +++ b/go.mod @@ -9,11 +9,10 @@ require ( github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/BurntSushi/toml v0.3.1 github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5 // indirect - github.com/ThalesIgnite/crypto11 v1.2.5 // indirect github.com/VividCortex/ewma v1.2.0 // indirect github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 // indirect - github.com/blacknon/go-sshlib v0.1.12 + github.com/blacknon/go-sshlib v0.1.13 github.com/blacknon/go-x11auth v0.1.0 // indirect github.com/blacknon/textcol v0.0.1 github.com/c-bata/go-prompt v0.2.6 @@ -50,8 +49,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) +require github.com/blacknon/crypto11 v1.2.7 // indirect + // replace -replace ( - github.com/ThalesIgnite/crypto11 v1.2.5 => github.com/blacknon/crypto11 v1.2.6 - github.com/c-bata/go-prompt v0.2.6 => github.com/blacknon/go-prompt v0.2.7 -) +replace github.com/c-bata/go-prompt v0.2.6 => github.com/blacknon/go-prompt v0.2.7 diff --git a/go.sum b/go.sum index 4a3bc4a1..1cfc764b 100644 --- a/go.sum +++ b/go.sum @@ -10,12 +10,12 @@ github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d h1:licZJFw2RwpH github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/blacknon/crypto11 v1.2.6 h1:Mv+Boto0qVR1O2k5lmoCYcyXfiQYY7mQ1P/TcK5Tw5c= -github.com/blacknon/crypto11 v1.2.6/go.mod h1:HThRIRjHpJIJwcExGgNuPCyf26HqcFVTTAnipaXWz7M= +github.com/blacknon/crypto11 v1.2.7 h1:LKrnCeXAk4jQmpJTeg/tVvNjqEgKHIE+tYSNXQj8Fco= +github.com/blacknon/crypto11 v1.2.7/go.mod h1:Z24sFD9pMX3NdUFzX52ggcV7HurAYAGvxud73BrHudA= github.com/blacknon/go-prompt v0.2.7 h1:dVdTqVplKvpT/k4bB9BlbcBYl/k6amYX5tvjYBmuKkI= github.com/blacknon/go-prompt v0.2.7/go.mod h1:zNBmC/BPAyr+3ey1oRhPxuXJS9zz1lEmJpwaoQroe3w= -github.com/blacknon/go-sshlib v0.1.12 h1:K66DzwzF5RhlKQjcda0R7/FbvslXOayVd75UVzCKfZQ= -github.com/blacknon/go-sshlib v0.1.12/go.mod h1:EqEKtFd4DInkF3Ryx+YXnj70u7pJenVr4H3uEGEgoHI= +github.com/blacknon/go-sshlib v0.1.13 h1:QoFoMuGefHWOTr18riHoQux4/lVrrDmsfvBTNuueeNI= +github.com/blacknon/go-sshlib v0.1.13/go.mod h1:Kxbot2GEniRqBduRtw8Tq6E8XtPLrFEKFmAHdlR+ipk= github.com/blacknon/go-x11auth v0.1.0 h1:SnljCPWcvglWeGAlKc1RAPMHnOfMpM9+GrTGEUQ1lqQ= github.com/blacknon/go-x11auth v0.1.0/go.mod h1:SKOCa19LluXHyB+OaLYobquzceE0SWxVW7e/qU5xGBM= github.com/blacknon/textcol v0.0.1 h1:x9h7yLPGyr8Pdz12XJ30h7Iz5mJlKd0CzfGYxhrmnk8= @@ -75,7 +75,6 @@ github.com/sevlyar/go-daemon v0.1.5 h1:Zy/6jLbM8CfqJ4x4RPr7MJlSKt90f00kNM1D401C+ github.com/sevlyar/go-daemon v0.1.5/go.mod h1:6dJpPatBT9eUwM5VCw9Bt6CdX9Tk6UWvhW3MebLDRKE= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= diff --git a/list/list.go b/list/list.go index 8670ba06..9b41b291 100644 --- a/list/list.go +++ b/list/list.go @@ -184,6 +184,11 @@ func (l *ListInfo) getFilterText() { // View is display the list in TUI func (l *ListInfo) View() { + l.getText() + if len(l.DataText) == 1 { + return + } + if err := termbox.Init(); err != nil { panic(err) } @@ -192,7 +197,6 @@ func (l *ListInfo) View() { // enable termbox mouse input termbox.SetInputMode(termbox.InputMouse) - l.getText() l.keyEvent() } diff --git a/vendor/github.com/ThalesIgnite/crypto11/.gitignore b/vendor/github.com/blacknon/crypto11/.gitignore similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/.gitignore rename to vendor/github.com/blacknon/crypto11/.gitignore diff --git a/vendor/github.com/ThalesIgnite/crypto11/.travis.yml b/vendor/github.com/blacknon/crypto11/.travis.yml similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/.travis.yml rename to vendor/github.com/blacknon/crypto11/.travis.yml diff --git a/vendor/github.com/ThalesIgnite/crypto11/LICENCE.txt b/vendor/github.com/blacknon/crypto11/LICENCE.txt similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/LICENCE.txt rename to vendor/github.com/blacknon/crypto11/LICENCE.txt diff --git a/vendor/github.com/ThalesIgnite/crypto11/README.md b/vendor/github.com/blacknon/crypto11/README.md similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/README.md rename to vendor/github.com/blacknon/crypto11/README.md diff --git a/vendor/github.com/ThalesIgnite/crypto11/aead.go b/vendor/github.com/blacknon/crypto11/aead.go similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/aead.go rename to vendor/github.com/blacknon/crypto11/aead.go diff --git a/vendor/github.com/ThalesIgnite/crypto11/attributes.go b/vendor/github.com/blacknon/crypto11/attributes.go similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/attributes.go rename to vendor/github.com/blacknon/crypto11/attributes.go diff --git a/vendor/github.com/ThalesIgnite/crypto11/block.go b/vendor/github.com/blacknon/crypto11/block.go similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/block.go rename to vendor/github.com/blacknon/crypto11/block.go diff --git a/vendor/github.com/ThalesIgnite/crypto11/blockmode.go b/vendor/github.com/blacknon/crypto11/blockmode.go similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/blockmode.go rename to vendor/github.com/blacknon/crypto11/blockmode.go diff --git a/vendor/github.com/ThalesIgnite/crypto11/certificates.go b/vendor/github.com/blacknon/crypto11/certificates.go similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/certificates.go rename to vendor/github.com/blacknon/crypto11/certificates.go diff --git a/vendor/github.com/ThalesIgnite/crypto11/common.go b/vendor/github.com/blacknon/crypto11/common.go similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/common.go rename to vendor/github.com/blacknon/crypto11/common.go diff --git a/vendor/github.com/ThalesIgnite/crypto11/config b/vendor/github.com/blacknon/crypto11/config similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/config rename to vendor/github.com/blacknon/crypto11/config diff --git a/vendor/github.com/ThalesIgnite/crypto11/crypto11.go b/vendor/github.com/blacknon/crypto11/crypto11.go similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/crypto11.go rename to vendor/github.com/blacknon/crypto11/crypto11.go diff --git a/vendor/github.com/ThalesIgnite/crypto11/dsa.go b/vendor/github.com/blacknon/crypto11/dsa.go similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/dsa.go rename to vendor/github.com/blacknon/crypto11/dsa.go diff --git a/vendor/github.com/ThalesIgnite/crypto11/ecdsa.go b/vendor/github.com/blacknon/crypto11/ecdsa.go similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/ecdsa.go rename to vendor/github.com/blacknon/crypto11/ecdsa.go diff --git a/vendor/github.com/ThalesIgnite/crypto11/hmac.go b/vendor/github.com/blacknon/crypto11/hmac.go similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/hmac.go rename to vendor/github.com/blacknon/crypto11/hmac.go diff --git a/vendor/github.com/ThalesIgnite/crypto11/keys.go b/vendor/github.com/blacknon/crypto11/keys.go similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/keys.go rename to vendor/github.com/blacknon/crypto11/keys.go diff --git a/vendor/github.com/ThalesIgnite/crypto11/rand.go b/vendor/github.com/blacknon/crypto11/rand.go similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/rand.go rename to vendor/github.com/blacknon/crypto11/rand.go diff --git a/vendor/github.com/ThalesIgnite/crypto11/rsa.go b/vendor/github.com/blacknon/crypto11/rsa.go similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/rsa.go rename to vendor/github.com/blacknon/crypto11/rsa.go diff --git a/vendor/github.com/ThalesIgnite/crypto11/sessions.go b/vendor/github.com/blacknon/crypto11/sessions.go similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/sessions.go rename to vendor/github.com/blacknon/crypto11/sessions.go diff --git a/vendor/github.com/ThalesIgnite/crypto11/symmetric.go b/vendor/github.com/blacknon/crypto11/symmetric.go similarity index 100% rename from vendor/github.com/ThalesIgnite/crypto11/symmetric.go rename to vendor/github.com/blacknon/crypto11/symmetric.go diff --git a/vendor/github.com/blacknon/go-sshlib/pkcs11.go b/vendor/github.com/blacknon/go-sshlib/pkcs11.go index fd566100..9409aed4 100644 --- a/vendor/github.com/blacknon/go-sshlib/pkcs11.go +++ b/vendor/github.com/blacknon/go-sshlib/pkcs11.go @@ -7,7 +7,7 @@ package sshlib import ( - "github.com/ThalesIgnite/crypto11" + "github.com/blacknon/crypto11" "github.com/miekg/pkcs11" ) diff --git a/vendor/modules.txt b/vendor/modules.txt index d071f187..17e82c74 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -8,9 +8,6 @@ github.com/BurntSushi/toml # github.com/ScaleFT/sshkeys v0.0.0-20200327173127-6142f742bca5 ## explicit; go 1.13 github.com/ScaleFT/sshkeys -# github.com/ThalesIgnite/crypto11 v1.2.5 => github.com/blacknon/crypto11 v1.2.6 -## explicit; go 1.13 -github.com/ThalesIgnite/crypto11 # github.com/VividCortex/ewma v1.2.0 ## explicit; go 1.12 github.com/VividCortex/ewma @@ -20,7 +17,10 @@ github.com/acarl005/stripansi # github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 ## explicit github.com/armon/go-socks5 -# github.com/blacknon/go-sshlib v0.1.12 +# github.com/blacknon/crypto11 v1.2.7 +## explicit; go 1.22 +github.com/blacknon/crypto11 +# github.com/blacknon/go-sshlib v0.1.13 ## explicit; go 1.22.4 github.com/blacknon/go-sshlib # github.com/blacknon/go-x11auth v0.1.0