Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > e0894f442e68fe82e73465fdc936b6fb > files > 7

munin-1.3.4-4mdv2009.0.src.rpm

# bash completion for munin-node
# $Id: vpnc 341 2007-01-16 10:57:23Z guillomovitch $

_munin-run()
{
	local cur prev

	COMPREPLY=()
	cur=${COMP_WORDS[COMP_CWORD]}
	prev=${COMP_WORDS[COMP_CWORD-1]}

	case $prev in
		--@(config|sconffile))
			_filedir
			return 0
			;;
		--@(service|sconf)dir)
			_filedir -d
			return 0
			;;
	esac

	if [[ "$cur" == -* ]]; then
		COMPREPLY=( $( compgen -W '--config --servicedir --sconfdir \
			--sconffile --help --debug --version' -- $cur ) )
	else
		COMPREPLY=( $( command ls /etc/munin/plugins | grep "^$cur" ) )
	fi
}
complete -F _munin-run munin-run

_munin-update()
{
	local cur prev

	COMPREPLY=()
	cur=${COMP_WORDS[COMP_CWORD]}
	prev=${COMP_WORDS[COMP_CWORD-1]}

	case $prev in
		--config)
			_filedir
			return 0
			;;
		--host)
			_known_hosts
			return 0
			;;
	esac

	if [[ "$cur" == -* ]]; then
		COMPREPLY=( $( compgen -W '--force-root --[no]force-root \
			--service --host --config --help --debug --nodebug \
			--fork --nofork --stdout --nostdout --timeout' \
			-- $cur ) )
	fi
}
complete -F _munin-update munin-update

_munin-node-configure()
{
	local cur prev

	COMPREPLY=()
	cur=${COMP_WORDS[COMP_CWORD]}
	prev=${COMP_WORDS[COMP_CWORD-1]}

	case $prev in
		--config)
			_filedir
			return 0
			;;
		--@(service|lib)dir)
			_filedir -d
			return 0
			;;
		--snmp)
			_known_hosts
			return 0
			;;
		--snmpversion)
			COMPREPLY=( $( compgen -W '1 2c 3' -- $cur ) )
			return 0
			;;
	esac

	if [[ "$cur" == -* ]]; then
		COMPREPLY=( $( compgen -W '--help --version --debug --config \
			--servicedir --libdir --families --suggest --shell \
			--remove-also --snmp --snmpversion --snmpcommunity' \
			-- $cur ) )
	fi
}
complete -F _munin-node-configure munin-node-configure