summaryrefslogtreecommitdiff
path: root/completions/sysctl
diff options
context:
space:
mode:
Diffstat (limited to 'completions/sysctl')
-rw-r--r--completions/sysctl11
1 files changed, 7 insertions, 4 deletions
diff --git a/completions/sysctl b/completions/sysctl
index 0ab37129..8216f989 100644
--- a/completions/sysctl
+++ b/completions/sysctl
@@ -6,6 +6,9 @@ _sysctl()
_init_completion || return
case $prev in
+ --help|--version)
+ return
+ ;;
-p)
_filedir conf
return
@@ -13,7 +16,9 @@ _sysctl()
esac
if [[ $cur == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ local opts="$( _parse_help "$1" )"
+ [[ $opts ]] || opts="$( _parse_usage "$1" )"
+ COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
else
local suffix=
[[ $prev == -w ]] && suffix==
@@ -21,9 +26,7 @@ _sysctl()
"$( PATH="$PATH:/sbin" sysctl -N -a 2>/dev/null )" -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
fi
-
- return 0
} &&
complete -F _sysctl sysctl
-# ex: ts=4 sw=4 et filetype=sh
+# ex: filetype=sh