File: bash_completion.sh

package info (click to toggle)
libargs 6.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 956 kB
  • sloc: cpp: 10,576; makefile: 56; sh: 19; python: 12
file content (13 lines) | stat: -rw-r--r-- 329 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
_args() {
    _init_completion -n 2> /dev/null
    local program comparg

    program="${COMP_WORDS[0]}"
    comparg="--complete" # replace this with your flag

    COMPREPLY=($("$program" "$comparg" bash "$COMP_CWORD" "${COMP_WORDS[@]}" 2> /dev/null))
    [[ $COMPREPLY ]] && return
    _filedir
}

complete -F _args completion