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

(-)a/debian/koha-common.bash-completion (-3 / +38 lines)
Lines 217-225 _koha-plack() Link Here
217
                 --help) COMPREPLY=() ; return 0 ;; # no more completions
217
                 --help) COMPREPLY=() ; return 0 ;; # no more completions
218
                     -h) COMPREPLY=() ; return 0 ;; # no more completions
218
                     -h) COMPREPLY=() ; return 0 ;; # no more completions
219
                --quiet) # filter the other quiet switches and go on
219
                --quiet) # filter the other quiet switches and go on
220
                    substract="$substract -e '--quiet' -e '-q'"; ;;
220
                    substract="$substract -e -q"; ;;
221
                -q)      # filter the other quiet switches and go on
221
                -q)      # filter the other quiet switches and go on
222
                    substract="$substract -e '--quiet' -e '-q'"; ;;
222
                    substract="$substract -e --quiet"; ;;
223
            esac
223
            esac
224
            substract="$substract -e ${COMP_WORDS[i]}"
224
            substract="$substract -e ${COMP_WORDS[i]}"
225
        fi
225
        fi
Lines 235-240 _koha-plack() Link Here
235
}
235
}
236
complete -F _koha-plack koha-plack
236
complete -F _koha-plack koha-plack
237
237
238
_koha-indexer()
239
{
240
    local cur opts substract
241
242
    COMPREPLY=()
243
    _get_comp_words_by_ref cur
244
    opts="--start --stop --restart --quiet -q --help -h"
245
246
    # Build a list of the already used option switches
247
    for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
248
        if [[ ${COMP_WORDS[i]} == -* ]]; then
249
            case ${COMP_WORDS[i]} in
250
                --start) _koha_list_cmd ; return 0 ;;
251
                 --stop) _koha_list_cmd ; return 0 ;;
252
              --restart) _koha_list_cmd ; return 0 ;;
253
                 --help) COMPREPLY=() ; return 0 ;; # no more completions
254
                     -h) COMPREPLY=() ; return 0 ;; # no more completions
255
                --quiet) # filter the other quiet switches and go on
256
                    substract="$substract -e -q"; ;;
257
                -q)      # filter the other quiet switches and go on
258
                    substract="$substract -e --quiet"; ;;
259
            esac
260
            substract="$substract -e ${COMP_WORDS[i]}"
261
        fi
262
    done
263
264
    if [[ "$substract" != "" ]]; then
265
        opts=$( echo $opts | sed -e 's/ /\n/g'  | grep -v -x $substract )
266
    fi
267
268
    COMPREPLY=( $(compgen -W "$opts" -- $cur ) )
269
270
    return 0
271
}
272
complete -F _koha-indexer koha-indexer
273
238
# Local variables:
274
# Local variables:
239
# mode: shell-script
275
# mode: shell-script
240
# sh-basic-offset: 4
276
# sh-basic-offset: 4
241
- 

Return to bug 14727