-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_getquotes
More file actions
53 lines (47 loc) · 2.03 KB
/
Copy path_getquotes
File metadata and controls
53 lines (47 loc) · 2.03 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
#compdef getquotes
autoload -U is-at-least
_getquotes() {
typeset -A opt_args
typeset -a _arguments_options
local ret=1
if is-at-least 5.2; then
_arguments_options=(-s -S -C)
else
_arguments_options=(-s -C)
fi
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" : \
'-a+[Specify a list of authors to fetch quotes from]:AUTHORS:_default' \
'--authors=[Specify a list of authors to fetch quotes from]:AUTHORS:_default' \
'-t+[Set the theme color for the displayed quotes]:THEME_COLOR:_default' \
'--theme-color=[Set the theme color for the displayed quotes]:THEME_COLOR:_default' \
'-m+[Set the maximum number of tries to fetch a quote]:MAX_TRIES:_default' \
'--max-tries=[Set the maximum number of tries to fetch a quote]:MAX_TRIES:_default' \
'-l+[Specify the log file path]:LOG_FILE:_default' \
'--log-file=[Specify the log file path]:LOG_FILE:_default' \
'-r+[Enable rainbow mode for gradient rainbow quote colors]::RAINBOW_MODE:(true false)' \
'--rainbow-mode=[Enable rainbow mode for gradient rainbow quote colors]::RAINBOW_MODE:(true false)' \
'-C+[Use a custom TOML configuration file]:CONFIG:_default' \
'--config=[Use a custom TOML configuration file]:CONFIG:_default' \
'-c+[Generate shell completion script]:COMPLETION:(bash elvish fish powershell zsh nushell)' \
'--completion=[Generate shell completion script]:COMPLETION:(bash elvish fish powershell zsh nushell)' \
'-i[Initialize the quote cache for offline mode]' \
'--init-cache[Initialize the quote cache for offline mode]' \
'-o[Run in offline mode, using cached quotes]' \
'--offline[Run in offline mode, using cached quotes]' \
'-v[Print version information]' \
'--version[Print version information]' \
'-h[Print help]' \
'--help[Print help]' \
&& ret=0
}
(( $+functions[_getquotes_commands] )) ||
_getquotes_commands() {
local commands; commands=()
_describe -t commands 'getquotes commands' commands "$@"
}
if [ "$funcstack[1]" = "_getquotes" ]; then
_getquotes "$@"
else
compdef _getquotes getquotes
fi