/usr/share/bash-completion/completions/bart_completion.sh is in bart 0.4.02-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | # bart parameter-completion
function _bart()
{
local cur=${COMP_WORDS[$COMP_CWORD]}
if [ $COMP_CWORD -eq 1 ] ; then
local CMDS=$(bart | tail -n +2)
COMPREPLY=($(compgen -W "$CMDS" -- "$cur"));
else
local bcmd=${COMP_WORDS[1]}
case $cur in
-*)
COMPREPLY=($(bart ${bcmd} -h | grep -o -E "^${cur}\w*"))
;;
*)
case $bcmd in
twixread)
COMPREPLY=($(compgen -o plusdirs -f -X '!*.dat' -- ${cur}))
;;
*)
local CFLS=$(compgen -o plusdirs -f -X '!*.hdr' -- ${cur})
local COOS=$(compgen -o plusdirs -f -X '!*.coo' -- ${cur});
local RAS=$(compgen -o plusdirs -f -X '!*.ra' -- ${cur});
local suffix=".hdr"
COMPREPLY=($(for i in ${CFLS} ${COOS} ${RAS}; do echo ${i%$suffix} ; done))
;;
esac
;;
esac
fi
return 0
}
complete -o filenames -F _bart bart ./bart
|