forked from sonick13/PerlProjects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
completions
34 lines (29 loc) · 1.06 KB
/
completions
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
#!/usr/bin/env bash
#cito M:644 O:0 G:0 T:/usr/share/bash-completion/completions/previewer
#------------------------------------------------------------------------------
# Project Name - PerlProjects/source/previewer/completions
# Started On - Mon 29 Jan 18:47:58 GMT 2018
# Last Change - Fri 27 Nov 02:58:58 GMT 2020
# Author E-Mail - [email protected]
# Author GitHub - https://github.com/terminalforlife
#------------------------------------------------------------------------------
# This is the bash completion script for previewer.
#------------------------------------------------------------------------------
_previewer(){
GetArgs(){
local CurLine Word
while read -a Line; do
[ "${Line[0]:0:1}" == '-' ] || continue
for Field in "${Line[@]}"; {
if [ "$Field" == '-' ]; then
break
elif [[ $Field == -* ]]; then
Field=${Field//\[*\]/}
printf '%s ' "${Field//,/}"
fi
}
done <<< "$(previewer -h)"
}
COMPREPLY=($(compgen -W "$(GetArgs)" -- "$2"))
}
complete -F _previewer -o default previewer