-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_warp
43 lines (36 loc) · 840 Bytes
/
_warp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#compdef warp
typeset -A opt_args
_warp() {
local -a ar
ar+=(
'1: :_warp_cmds'
'2: :_warp_commands'
'*::arg:->args'
)
_arguments -C $ar[@]
return 0
}
_warp_cmds() {
local commands;
commands=(
'add:add a wapoint <name> for the current path'
'dump:dump the config to stdout'
'to:go to wapoint <name>'
'eject:remove waypoint <name>'
'update:update waypoint <name> to use the current path'
'edit:edit the config in $EDITOR'
'ls:list waypoints'
'list:list waypoints'
)
compadd $(warp ls)
_describe -t commands 'warp command' commands "$@"
}
_warp_commands() {
case "${words[CURRENT-1]}" in
(show|edit|eject|to|update)
compadd $(warp ls)
;;
esac
}
_warp "$@"
#compadd $(warp ls)