sysctl: Try parsing options from help before usage

This commit is contained in:
Ville Skyttä 2015-06-27 10:41:00 +03:00
parent 1d9e705639
commit e9fe2d9f7b

View File

@ -13,7 +13,9 @@ _sysctl()
esac esac
if [[ $cur == -* ]]; then 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 else
local suffix= local suffix=
[[ $prev == -w ]] && suffix== [[ $prev == -w ]] && suffix==