-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathflameshot.bash
More file actions
76 lines (69 loc) · 1.72 KB
/
flameshot.bash
File metadata and controls
76 lines (69 loc) · 1.72 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
68
69
70
71
72
73
74
75
76
#compdef flameshot
# Shell completion for flameshot command
# To be installed in "/usr/share/bash-completion/completions/flameshot"
# and "/usr/share/zsh/site-functions/"
_flameshot() {
local prev cur cmd gui_opts full_opts config_opts
COMPREPLY=()
prev="${COMP_WORDS[COMP_CWORD-1]}"
cur="${COMP_WORDS[COMP_CWORD]}"
cmd="gui full config launcher screen"
screen_opts="--number --path --delay --raw --last-region -p -d -r -n"
gui_opts="--path --delay --raw --last-region -p -d -r"
full_opts="--path --delay --clipboard --raw --last-region -p -d -c -r"
config_opts="--contrastcolor --filename --maincolor --showhelp --trayicon --autostart -k -f -m -s -t -a"
case "${prev}" in
launcher)
return 0
;;
screen)
COMPREPLY=( $(compgen -W "$screen_opts --help -h" -- "${cur}") )
return 0
;;
gui)
COMPREPLY=( $(compgen -W "$gui_opts --help -h" -- "${cur}") )
return 0
;;
full)
COMPREPLY=( $(compgen -W "$full_opts --help -h" -- "${cur}") )
return 0
;;
config)
COMPREPLY=( $(compgen -W "$config_opts --help -h" -- "${cur}") )
return 0
;;
-f|--filename|-p|--path)
_filedir -d
return 0
;;
-s|--showhelp|-t|--trayicon)
COMPREPLY=( $(compgen -W "true false" -- "${cur}") )
return 0
;;
-d|--delay|-h|--help|-c|--clipboard|--version|-v|--number|-n)
return 0
;;
*)
;;
esac
# Options
case "${cur}" in
-*)
COMPREPLY=( $( compgen -W "--version --help -v -h" -- "${cur}") )
return 0
;;
--*)
COMPREPLY=( $( compgen -W "--version --help" -- "${cur}") )
return 0
;;
*)
COMPREPLY=( $( compgen -W "${cmd}" -- "${cur}") )
return 0
;;
esac
}
if [[ -n ${ZSH_VERSION} ]]; then
autoload -U bashcompinit
bashcompinit
fi
complete -F _flameshot flameshot