aboutsummaryrefslogtreecommitdiffstats
path: root/commands/z.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/z.go')
-rw-r--r--commands/z.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/commands/z.go b/commands/z.go
index 5aee2a2c..2ea65e0c 100644
--- a/commands/z.go
+++ b/commands/z.go
@@ -8,7 +8,8 @@ import (
)
type Zoxide struct {
- Target string `opt:"..." default:"~" metavar:"<folder> | <query>..."`
+ Target string `opt:"folder" default:"~" complete:"CompleteFolder"`
+ Args []string `opt:"..." required:"false" metavar:"<query>..."`
}
func ZoxideAdd(arg string) error {
@@ -36,8 +37,8 @@ func (Zoxide) Aliases() []string {
return []string{"z"}
}
-func (Zoxide) Complete(args []string) []string {
- return ChangeDirectory{}.Complete(args)
+func (*Zoxide) CompleteFolder(arg string) []string {
+ return GetFolders(arg)
}
// Execute calls zoxide add and query and delegates actually changing the