aboutsummaryrefslogtreecommitdiffstats
path: root/commands/cd.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/cd.go')
-rw-r--r--commands/cd.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/commands/cd.go b/commands/cd.go
index 6620e732..d2dc5310 100644
--- a/commands/cd.go
+++ b/commands/cd.go
@@ -12,7 +12,7 @@ import (
var previousDir string
type ChangeDirectory struct {
- Target string `opt:"directory" default:"~"`
+ Target string `opt:"directory" default:"~" complete:"CompleteTarget"`
}
func init() {
@@ -23,9 +23,8 @@ func (ChangeDirectory) Aliases() []string {
return []string{"cd"}
}
-func (ChangeDirectory) Complete(args []string) []string {
- path := strings.Join(args, " ")
- completions := CompletePath(path)
+func (*ChangeDirectory) CompleteTarget(arg string) []string {
+ completions := CompletePath(arg)
var dirs []string
for _, c := range completions {