diff options
Diffstat (limited to 'commands/cd.go')
-rw-r--r-- | commands/cd.go | 7 |
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 { |