diff options
author | netblue30 <netblue30@yahoo.com> | 2016-03-25 08:47:17 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-03-25 08:47:17 -0400 |
commit | e7d1fd9965b42ea8b17a38821140daeac1373d9a (patch) | |
tree | f9937355433349542f87ef92e6160eee1c8cc120 /src/bash_completion/firecfg.bash_completion | |
parent | fix netfilter problem (diff) | |
download | firejail-e7d1fd9965b42ea8b17a38821140daeac1373d9a.tar.gz firejail-e7d1fd9965b42ea8b17a38821140daeac1373d9a.tar.zst firejail-e7d1fd9965b42ea8b17a38821140daeac1373d9a.zip |
added firecfg utility
Diffstat (limited to 'src/bash_completion/firecfg.bash_completion')
-rw-r--r-- | src/bash_completion/firecfg.bash_completion | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/bash_completion/firecfg.bash_completion b/src/bash_completion/firecfg.bash_completion new file mode 100644 index 000000000..79b74e49d --- /dev/null +++ b/src/bash_completion/firecfg.bash_completion | |||
@@ -0,0 +1,39 @@ | |||
1 | # bash completion for firecfg -*- 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 | _firecfg() | ||
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 _firecfg firecfg | ||
37 | |||
38 | |||
39 | |||