Skip to content

Commit

Permalink
Fix a bug which didn't let you call commands with arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
yamnikov-oleg committed Feb 4, 2017
1 parent 2abb05d commit 916ceeb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cmd_entries.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,17 @@ import (
var PathEntries = strings.Split(os.Getenv("PATH"), string(os.PathListSeparator))

func SearchCmdEntries(query string) (list LaunchEntriesList) {
if query != "" && !IsInHistory(query) && IsCommand(query) {
query = strings.TrimSpace(query)
if query == "" {
return nil
}

cmd := SplitCommandline(query)
if len(cmd) == 0 {
return nil
}

if !IsInHistory(query) && IsCommand(cmd[0]) {
return LaunchEntriesList{NewEntryFromCommand(query)}
}
return nil
Expand Down

0 comments on commit 916ceeb

Please sign in to comment.