-
Notifications
You must be signed in to change notification settings - Fork 1
/
tagfs-completion.bash
executable file
·84 lines (63 loc) · 2.49 KB
/
tagfs-completion.bash
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/env bash
_tagfs_completions()
{
if [ "${#COMP_WORDS[@]}" == "2" ]; then
COMPREPLY=($(compgen -W "init getboundary lstags addtags renametag linktags addresource tagresource untagresource lsresources rmresource mvresource getresourcetags rmresourcetags help" "${COMP_WORDS[1]}"))
fi
if [ "${#COMP_WORDS[@]}" == "3" ]; then
if [ "${COMP_WORDS[1]}" == "addresource" ]; then
COMPREPLY=($(compgen -f -- "${COMP_WORDS[2]}"))
fi
if [ "${COMP_WORDS[1]}" == "tagresource" ]; then
COMPREPLY=($(compgen -f -- "${COMP_WORDS[2]}"))
fi
if [ "${COMP_WORDS[1]}" == "untagresource" ]; then
COMPREPLY=($(compgen -f -- "${COMP_WORDS[2]}"))
fi
if [ "${COMP_WORDS[1]}" == "mvresource" ]; then
COMPREPLY=($(compgen -f -- "${COMP_WORDS[2]}"))
fi
if [ "${COMP_WORDS[1]}" == "rmresource" ]; then
COMPREPLY=($(compgen -f -- "${COMP_WORDS[2]}"))
fi
if [ "${COMP_WORDS[1]}" == "getresourcetags" ]; then
COMPREPLY=($(compgen -f -- "${COMP_WORDS[2]}"))
fi
if [ "${COMP_WORDS[1]}" == "rmresourcetags" ]; then
COMPREPLY=($(compgen -f -- "${COMP_WORDS[2]}"))
fi
if [ "${COMP_WORDS[1]}" == "lstags" ]; then
COMPREPLY=($(compgen -W "$(tagfs lstags)" "${COMP_WORDS[2]}"))
fi
if [ "${COMP_WORDS[1]}" == "lsresources" ]; then
COMPREPLY=($(compgen -W "$(tagfs lstags)" "${COMP_WORDS[2]}"))
fi
if [ "${COMP_WORDS[1]}" == "renametag" ]; then
COMPREPLY=($(compgen -W "$(tagfs lstags)" "${COMP_WORDS[2]}"))
fi
if [ "${COMP_WORDS[1]}" == "linktags" ]; then
COMPREPLY=($(compgen -W "$(tagfs lstags)" "${COMP_WORDS[2]}"))
fi
fi
if [ "${#COMP_WORDS[@]}" == "4" ]; then
if [ "${COMP_WORDS[1]}" == "tagresource" ]; then
COMPREPLY=($(compgen -W "$(tagfs lstags)" "${COMP_WORDS[3]}"))
fi
if [ "${COMP_WORDS[1]}" == "untagresource" ]; then
COMPREPLY=($(compgen -W "$(tagfs lstags)" "${COMP_WORDS[3]}"))
fi
if [ "${COMP_WORDS[1]}" == "linktags" ]; then
COMPREPLY=($(compgen -W "$(tagfs lstags)" "${COMP_WORDS[3]}"))
fi
fi
if [ ${#COMP_WORDS[@]} -gt 4 ]; then
if [ "${COMP_WORDS[1]}" == "tagresource" ]; then
COMPREPLY=($(compgen -W "$(tagfs lstags)" "${COMP_WORDS[${#COMP_WORDS[@]} - 1]}"))
fi
if [ "${COMP_WORDS[1]}" == "untagresource" ]; then
COMPREPLY=($(compgen -W "$(tagfs lstags)" "${COMP_WORDS[${#COMP_WORDS[@]} - 1]}"))
fi
fi
}
complete -F _tagfs_completions tagfs
complete -F _tagfs_completions tagfs.py