aboutsummaryrefslogtreecommitdiffstats
path: root/src/bash_completion/firemon.bash_completion
diff options
context:
space:
mode:
Diffstat (limited to 'src/bash_completion/firemon.bash_completion')
-rw-r--r--src/bash_completion/firemon.bash_completion39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/bash_completion/firemon.bash_completion b/src/bash_completion/firemon.bash_completion
new file mode 100644
index 000000000..befbf2388
--- /dev/null
+++ b/src/bash_completion/firemon.bash_completion
@@ -0,0 +1,39 @@
1# bash completion for firemon -*- shell-script -*-
2#********************************************************************
3# Script based on completions/configure script in bash-completion package in
4# Debian. The original package is release under GPL v2 license, the webpage is
5# http://bash-completion.alioth.debian.org
6#*******************************************************************
7
8_firemon()
9{
10 local cur prev words cword split
11 _init_completion -s || return
12
13 case $prev in
14 --help|--version)
15 return
16 ;;
17 esac
18
19 $split && return 0
20
21 # if $COMP_CONFIGURE_HINTS is not null, then completions of the form
22 # --option=SETTING will include 'SETTING' as a contextual hint
23 [[ "$cur" != -* ]] && return 0
24
25 if [[ -n $COMP_CONFIGURE_HINTS ]]; then
26 COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \
27 awk '/^ --[A-Za-z]/ { print $1; \
28 if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,].*//g' )" \
29 -- "$cur" ) )
30 [[ $COMPREPLY == *=* ]] && compopt -o nospace
31 else
32 COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
33 [[ $COMPREPLY == *= ]] && compopt -o nospace
34 fi
35} &&
36complete -F _firemon firemon
37
38
39