#  bash completion support
#
#  Copyright (C) 2008 Neil Williams <codehelp@debian.org>
#
#  This package is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 3 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

_pilotqof()
{
	local cur prev opts cmds help machine arch quiet
	COMPREPLY=()
	cur="${COMP_WORDS[COMP_CWORD]}"
	prev="${COMP_WORDS[COMP_CWORD-1]}"
	help="-? --help --usage --version "
	cmds="-l --list -x --xml-file -i --input-file -w --write "
	filt="-t --date --d --database -e --exclude -c --category "
	opts="-p --port --compress --debug -a --host-query "
	quiet="--verbose --quiet -v -q "
	query="-s --sql -f --sql-file --invoice-vendor --invoice-city --use-locale "
	case "$prev" in
		-@(-compress))
		COMPREPLY=( $( echo "0 1 2 3 4 5 6 7 8 9" $cur ) )
		;;
		*)
		COMPREPLY=( $(compgen -W "${help}${opts}${filt}${quiet}${query}${cmds}" -- ${cur}) )
		;;
	esac
}
complete -F _pilotqof -o default pilot-qof
