-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompletes
More file actions
executable file
·67 lines (57 loc) · 1.91 KB
/
completes
File metadata and controls
executable file
·67 lines (57 loc) · 1.91 KB
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
#!/usr/bin/env bash
#export FCS_BASE_PATH="/Users/codezm/.config/dotfile/alfred/Alfred.alfredpreferences/workflows/user.workflow.3E5791A5-1550-4FA1-954C-CBC05252BD2B"
#export FCS_SERVER_CONFIG_FILE_PATH=""
#export FCS_REDIS_SERVER_CONFIG_FILE_PATH=""
#export FCS_EXPECT_SCRIPT_PATH=""
_zssh_completions() {
local cur="${COMP_WORDS[COMP_CWORD]}"
case $COMP_CWORD in
1)
COMPREPLY=($(compgen -W "connect add delete search list" -- $cur))
;;
2)
if [[ ${COMP_WORDS[1]} != "add" && ${COMP_WORDS[1]} != "list" ]]; then
if [[ -n "$cur" ]]; then
COMPREPLY=($(compgen -W "$(zssh -v search $cur)" -- $cur))
else
COMPREPLY=($(compgen -W "$(zssh list -n)" -- $cur))
fi
fi
;;
esac
}
complete -F _zssh_completions zssh
_zscp_completions() {
local cur="${COMP_WORDS[COMP_CWORD]}"
case $COMP_CWORD in
1)
if [[ -n "$cur" ]]; then
COMPREPLY=($(compgen -W "$(zssh -v search $cur)" -- $cur))
else
COMPREPLY=($(compgen -W "$(zssh list -n)" -- $cur))
fi
;;
2)
COMPREPLY=($(compgen -W "download upload" -- $cur))
;;
esac
}
complete -F _zscp_completions zscp
_zredis_completions() {
local cur="${COMP_WORDS[COMP_CWORD]}"
case $COMP_CWORD in
1)
COMPREPLY=($(compgen -W "connect add delete search list" -- $cur))
;;
2)
if [[ ${COMP_WORDS[1]} != "add" && ${COMP_WORDS[1]} != "list" ]]; then
if [[ -n "$cur" ]]; then
COMPREPLY=($(compgen -W "$(zredis -v search $cur)" -- $cur))
else
COMPREPLY=($(compgen -W "$(zredis list -n)" -- $cur))
fi
fi
;;
esac
}
complete -F _zredis_completions zredis