# Copyright (C) 2008-2009 AG Projects. See LICENSE for details.
#

# xcapclient command-line completion

# This function actually delegates all the work to the program, executing it as
# app [all typed arguments] --print-completions [index of the word cursor points to]
_print_completions()
{
    COMPREPLY=()

    # So that the following "command-output to array" operation splits only at newlines,
    # not at each space, tab or newline.
    local IFS=$'\n'

    COMPREPLY=( $( ${COMP_WORDS[*]} --print-completions ${COMP_CWORD} ) )
    return 0
}

complete -F _print_completions -o default xcapclient

