sysctl: Try parsing options from help before usage

master
Ville Skyttä 2015-06-27 10:41:00 +03:00
parent 1d9e705639
commit e9fe2d9f7b
1 changed files with 3 additions and 1 deletions

View File

@ -13,7 +13,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==