View | Details | Raw Unified | Return to bug 18562
Collapse All | Expand All

(-)a/debian/koha-common.bash-completion (-1 / +38 lines)
Lines 303-308 _koha-zebra() Link Here
303
}
303
}
304
complete -F _koha-zebra koha-zebra
304
complete -F _koha-zebra koha-zebra
305
305
306
_koha-sip()
307
{
308
    local cur opts substract
309
310
    COMPREPLY=()
311
    _get_comp_words_by_ref cur
312
    opts="--start --stop --restart --status --enable --verbose -v --help -h"
313
314
    # Build a list of the already used option switches
315
    for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
316
        if [[ ${COMP_WORDS[i]} == -* ]]; then
317
            case ${COMP_WORDS[i]} in
318
                --start) _koha_sip_enabled_instances ; return 0 ;;
319
                 --stop) _koha_sip_enabled_instances ; return 0 ;;
320
              --restart) _koha_sip_enabled_instances ; return 0 ;;
321
               --status) _koha_sip_enabled_instances ; return 0 ;;
322
               --enable) _koha_sip_disabled ; return 0 ;;
323
                 --help) COMPREPLY=() ; return 0 ;; # no more completions
324
                     -h) COMPREPLY=() ; return 0 ;; # no more completions
325
              --verbose) # filter the other quiet switches and go on
326
                    substract="$substract -e -q"; ;;
327
                -v)      # filter the other quiet switches and go on
328
                    substract="$substract -e --verbose"; ;;
329
            esac
330
            substract="$substract -e ${COMP_WORDS[i]}"
331
        fi
332
    done
333
334
    if [[ "$substract" != "" ]]; then
335
        opts=$( echo $opts | sed -e 's/ /\n/g'  | grep -v -x $substract )
336
    fi
337
338
    COMPREPLY=( $(compgen -W "$opts" -- $cur ) )
339
340
    return 0
341
}
342
complete -F _koha-sip koha-sip
343
306
# Local variables:
344
# Local variables:
307
# mode: shell-script
345
# mode: shell-script
308
# sh-basic-offset: 4
346
# sh-basic-offset: 4
309
- 

Return to bug 18562