summaryrefslogtreecommitdiff
path: root/completions/sysctl
diff options
context:
space:
mode:
Diffstat (limited to 'completions/sysctl')
-rw-r--r--completions/sysctl15
1 files changed, 7 insertions, 8 deletions
diff --git a/completions/sysctl b/completions/sysctl
index 8216f989..e683977b 100644
--- a/completions/sysctl
+++ b/completions/sysctl
@@ -6,24 +6,23 @@ _sysctl()
_init_completion || return
case $prev in
- --help|--version)
+ --help|--version|--pattern|-!(-*)[hVr])
return
;;
- -p)
+ --load|-!(-*)[pf])
_filedir conf
return
;;
esac
if [[ $cur == -* ]]; then
- local opts="$( _parse_help "$1" )"
- [[ $opts ]] || opts="$( _parse_usage "$1" )"
- COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
+ local opts="$(_parse_help "$1")"
+ COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") )
else
local suffix=
- [[ $prev == -w ]] && suffix==
- COMPREPLY=( $( compgen -S "$suffix" -W \
- "$( PATH="$PATH:/sbin" sysctl -N -a 2>/dev/null )" -- "$cur" ) )
+ [[ $prev == -w ]] && suffix="="
+ COMPREPLY=( $(compgen -S "$suffix" -W \
+ "$(PATH="$PATH:/sbin" sysctl -N -a 2>/dev/null)" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
fi
} &&