-
Notifications
You must be signed in to change notification settings - Fork 1
/
_diraction
46 lines (43 loc) Β· 1.68 KB
/
_diraction
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
43
44
45
46
#compdef diraction # -*- mode: sh -*-
# Completion for the diraction command suite
local -a _1st_arguments
_1st_arguments=(
'batch-create:Batch create diractions from stdin'
'check-config-dir:Check which dir exist in config'
'check-config-syntax:Check the syntax in config file'
'check:check the config'
'create:Create a new diraction'
'destroy-all:Destroy all diraction'
'destroy:Destroy specified alias'
'disable:Disable specified Diraction'
'enable:Enable the provided alias'
'exist:Chec kif a diraction exist'
'grep:Search in the existing diraction'
'help:Give more details about diraction'
'list-alias:List existing alias'
'la:List existing alias (list-alias alias)'
'ld:List all the directories'
'list-dir:List all the directories (list-dir alias)'
'list:List the existing diraction'
'ls:List the existing diraction (list alias)'
'load-config:Load the configuration'
'reset:Reload all the diraction aliases'
'save: Save current directory add diraction'
'whitelist:Add provided commands to whitelist'
'blacklist:Remove provided commands from whitelist'
)
if (( CURRENT == 2 )); then
_describe -t commands "Diraction subcommands" _1st_arguments
return 0
elif (( CURRENT == 3 )); then
case $words[2] in
create) _message "Diraction Name" && return 0;;
destroy|disable|enable|exist) compadd -x "Existing diractions" ${(ok)DIRACTION_REGISTER} && return 0;;
grep*) _message "Grepping pattern" && return 0;;
*) _message "No args required"
esac
elif (( CURRENT == 4 )); then
case $words[2] in
create) _path_files -/ -x "Diraction Path" && return 0 ;;
esac
fi