Debian Codegraph @

bash-completion/fincore

raw
1 _fincore_module()
2 {
3 local cur prev OPTS
4 COMPREPLY=()
5 cur="${COMP_WORDS[COMP_CWORD]}"
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
7 case $prev in
8 '-o'|'--output')
9 local prefix realcur OUTPUT_ALL OUTPUT
10 realcur="${cur##*,}"
11 prefix="${cur%$realcur}"
12 OUTPUT_ALL='PAGES SIZE FILE RES'
13 for WORD in $OUTPUT_ALL; do
14 if ! [[ $prefix == *"$WORD"* ]]; then
15 OUTPUT="$WORD ${OUTPUT:-""}"
16 fi
17 done
18 compopt -o nospace
19 COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- "$realcur") )
20 return 0
21 ;;
22 '-h'|'--help'|'-V'|'--version')
23 return 0
24 ;;
25 esac
26 case $cur in
27 -*)
28 OPTS="
29 --json
30 --bytes
31 --noheadings
32 --output
33 --output-all
34 --total
35 --raw
36 --recursive
37 --cachestat
38 --help
39 --version
40 "
41 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
42 return 0
43 ;;
44 esac
45 local IFS=$'\n'
46 compopt -o filenames
47 COMPREPLY=( $(compgen -f -- ${cur:-"/"}) )
48 return 0
49 }
50 complete -F _fincore_module fincore