|
Lines 271-276
_koha-indexer()
Link Here
|
| 271 |
} |
271 |
} |
| 272 |
complete -F _koha-indexer koha-indexer |
272 |
complete -F _koha-indexer koha-indexer |
| 273 |
|
273 |
|
|
|
274 |
_koha-zebra() |
| 275 |
{ |
| 276 |
local cur opts substract |
| 277 |
|
| 278 |
COMPREPLY=() |
| 279 |
_get_comp_words_by_ref cur |
| 280 |
opts="--start --stop --restart --status --quiet -q --help -h" |
| 281 |
|
| 282 |
# Build a list of the already used option switches |
| 283 |
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do |
| 284 |
if [[ ${COMP_WORDS[i]} == -* ]]; then |
| 285 |
case ${COMP_WORDS[i]} in |
| 286 |
--start) _koha_list_cmd ; return 0 ;; |
| 287 |
--stop) _koha_list_cmd ; return 0 ;; |
| 288 |
--restart) _koha_list_cmd ; return 0 ;; |
| 289 |
--status) _koha_list_cmd ; return 0 ;; |
| 290 |
--help) COMPREPLY=() ; return 0 ;; # no more completions |
| 291 |
-h) COMPREPLY=() ; return 0 ;; # no more completions |
| 292 |
--quiet) # filter the other quiet switches and go on |
| 293 |
substract="$substract -e -q"; ;; |
| 294 |
-q) # filter the other quiet switches and go on |
| 295 |
substract="$substract -e --quiet"; ;; |
| 296 |
esac |
| 297 |
substract="$substract -e ${COMP_WORDS[i]}" |
| 298 |
fi |
| 299 |
done |
| 300 |
|
| 301 |
if [[ "$substract" != "" ]]; then |
| 302 |
opts=$( echo $opts | sed -e 's/ /\n/g' | grep -v -x $substract ) |
| 303 |
fi |
| 304 |
|
| 305 |
COMPREPLY=( $(compgen -W "$opts" -- $cur ) ) |
| 306 |
|
| 307 |
return 0 |
| 308 |
} |
| 309 |
complete -F _koha-zebra koha-zebra |
| 310 |
|
| 274 |
# Local variables: |
311 |
# Local variables: |
| 275 |
# mode: shell-script |
312 |
# mode: shell-script |
| 276 |
# sh-basic-offset: 4 |
313 |
# sh-basic-offset: 4 |
| 277 |
- |
|
|