diff options
author | 2015-08-08 19:12:30 -0400 | |
---|---|---|
committer | 2015-08-08 19:12:30 -0400 | |
commit | 1379851360349d6617ad32944a25ee5e2bb74fc2 (patch) | |
tree | f69b48e90708bfa3c2723d5a27ed3e024c827b43 /etc/firemon.bash_completion | |
parent | delete files (diff) | |
download | firejail-1379851360349d6617ad32944a25ee5e2bb74fc2.tar.gz firejail-1379851360349d6617ad32944a25ee5e2bb74fc2.tar.zst firejail-1379851360349d6617ad32944a25ee5e2bb74fc2.zip |
Baseline firejail 0.9.28
Diffstat (limited to 'etc/firemon.bash_completion')
-rw-r--r-- | etc/firemon.bash_completion | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/etc/firemon.bash_completion b/etc/firemon.bash_completion new file mode 100644 index 000000000..befbf2388 --- /dev/null +++ b/etc/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 | } && | ||
36 | complete -F _firemon firemon | ||
37 | |||
38 | |||
39 | |||