summaryrefslogtreecommitdiff
path: root/complete.go
diff options
context:
space:
mode:
Diffstat (limited to 'complete.go')
-rw-r--r--complete.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/complete.go b/complete.go
index 3647c28..185d1e8 100644
--- a/complete.go
+++ b/complete.go
@@ -10,7 +10,6 @@ import (
"fmt"
"io"
"os"
- "strings"
"github.com/posener/complete/cmd"
"github.com/posener/complete/match"
@@ -64,6 +63,7 @@ func (c *Complete) Complete() bool {
}
Log("Completing line: %s", line)
a := newArgs(line)
+ Log("Completing last field: %s", a.Last)
options := c.Command.Predict(a)
Log("Options: %s", options)
@@ -79,12 +79,12 @@ func (c *Complete) Complete() bool {
return true
}
-func getLine() ([]string, bool) {
+func getLine() (string, bool) {
line := os.Getenv(envComplete)
if line == "" {
- return nil, false
+ return "", false
}
- return strings.Split(line, " "), true
+ return line, true
}
func (c *Complete) output(options []string) {