| 1 |
# shellcheck shell=bash |
| 2 |
# -------------------------------------------------------------------------- |
| 3 |
# |
| 4 |
# //===// //===== //===// // // //===// |
| 5 |
# // // // // // // // // // |
| 6 |
# //===// //===== //===// // // //===<< |
| 7 |
# // \\ // // // // // // |
| 8 |
# // \\ =====// // //===== // //===// Version III |
| 9 |
# |
| 10 |
# ------------- An Efficient RSerPool Prototype Implementation ------------- |
| 11 |
# |
| 12 |
# Copyright (C) 2002-2026 by Thomas Dreibholz |
| 13 |
# |
| 14 |
# This program is free software: you can redistribute it and/or modify |
| 15 |
# it under the terms of the GNU General Public License as published by |
| 16 |
# the Free Software Foundation, either version 3 of the License, or |
| 17 |
# (at your option) any later version. |
| 18 |
# |
| 19 |
# This program is distributed in the hope that it will be useful, |
| 20 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 |
# GNU General Public License for more details. |
| 23 |
# |
| 24 |
# You should have received a copy of the GNU General Public License |
| 25 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 26 |
# |
| 27 |
# Contact: [email protected] |
| 28 |
|
| 29 |
|
| 30 |
# ###### Bash completion for fractalpooluser #################################### |
| 31 |
_fractalpooluser() |
| 32 |
{ |
| 33 |
# Based on: https://www.benningtons.net/index.php/bash-completion/ |
| 34 |
local cur prev words cword |
| 35 |
if type -t _comp_initialize >/dev/null; then |
| 36 |
_comp_initialize -n = || return |
| 37 |
elif type -t _init_completion >/dev/null; then |
| 38 |
_init_completion -n = || return |
| 39 |
else |
| 40 |
# Manual initialization for older bash completion versions: |
| 41 |
COMPREPLY=() |
| 42 |
cur="${COMP_WORDS[COMP_CWORD]}" |
| 43 |
# shellcheck disable=SC2034 |
| 44 |
prev="${COMP_WORDS[COMP_CWORD-1]}" |
| 45 |
# shellcheck disable=SC2034,SC2124 |
| 46 |
words="${COMP_WORDS[@]}" |
| 47 |
# shellcheck disable=SC2034 |
| 48 |
cword="${COMP_CWORD}" |
| 49 |
fi |
| 50 |
|
| 51 |
# ====== Parameters ====================================================== |
| 52 |
case "${cur}" in |
| 53 |
# ====== Generic value =============================================== |
| 54 |
-identifier* | \ |
| 55 |
-poolhandle=* | \ |
| 56 |
-caption=* | \ |
| 57 |
-width=* | \ |
| 58 |
-height=* | \ |
| 59 |
-threads=* | \ |
| 60 |
-sendtimeout=* | \ |
| 61 |
-recvtimeout=* | \ |
| 62 |
-interimagetime=* | \ |
| 63 |
-imagestorageprefix=* | \ |
| 64 |
-cspinterval=* | \ |
| 65 |
-cspserver=* | \ |
| 66 |
-loglevel=*) |
| 67 |
cur="${cur#*=}" |
| 68 |
return |
| 69 |
;; |
| 70 |
# ====== Special case: directory ====================================== |
| 71 |
-configdir=*) |
| 72 |
cur="${cur#*=}" |
| 73 |
_filedir -d |
| 74 |
return |
| 75 |
;; |
| 76 |
# ====== Special case: log file ======================================= |
| 77 |
-logappend=* | \ |
| 78 |
-logfile=*) |
| 79 |
cur="${cur#*=}" |
| 80 |
_filedir '@(log)' |
| 81 |
return |
| 82 |
;; |
| 83 |
# ====== Special case: on/off ========================================= |
| 84 |
-logcolor=*) |
| 85 |
cur="${cur#*=}" |
| 86 |
mapfile -t COMPREPLY < <(compgen -W "on off" -- "${cur}") |
| 87 |
return |
| 88 |
;; |
| 89 |
esac |
| 90 |
|
| 91 |
# ====== All options ===================================================== |
| 92 |
# Simple options without parameter(s) |
| 93 |
local opts1=" |
| 94 |
-colormarks |
| 95 |
-nocolormarks |
| 96 |
-sessions |
| 97 |
-nosessions |
| 98 |
" |
| 99 |
# Options with "=" and parameter(s) |
| 100 |
local opts2=" |
| 101 |
-identifier |
| 102 |
-poolhandle |
| 103 |
-configdir |
| 104 |
-caption |
| 105 |
-width |
| 106 |
-height |
| 107 |
-threads |
| 108 |
-sendtimeout |
| 109 |
-recvtimeout |
| 110 |
-interimagetime |
| 111 |
-imagestorageprefix |
| 112 |
-cspinterval |
| 113 |
-cspserver |
| 114 |
-logappend |
| 115 |
-logcolor |
| 116 |
-logfile |
| 117 |
-loglevel |
| 118 |
" |
| 119 |
COMPREPLY=( $( compgen -W "${opts1}" -- "${cur}" ) |
| 120 |
$( compgen -W "${opts2}" -S "=" -- "${cur}" ) ) |
| 121 |
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace |
| 122 |
|
| 123 |
return 0 |
| 124 |
} |
| 125 |
|
| 126 |
complete -F _fractalpooluser fractalpooluser |