Skip to content

Commit

Permalink
update. #137
Browse files Browse the repository at this point in the history
  • Loading branch information
blacknon committed Jul 10, 2024
1 parent 3c601a0 commit f3d28a3
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
16 changes: 16 additions & 0 deletions cmd/lscp/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions cmd/lsftp/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions cmd/lssh/args.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -192,7 +197,6 @@ func (l *ListInfo) View() {
// enable termbox mouse input
termbox.SetInputMode(termbox.InputMouse)

l.getText()
l.keyEvent()
}

Expand Down

0 comments on commit f3d28a3

Please sign in to comment.