Skip to content

Commit

Permalink
sysctl: Try parsing options from help before usage
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Jun 27, 2015
1 parent 1d9e705 commit e9fe2d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion completions/sysctl
Original file line number Diff line number Diff line change
Expand Up @@ -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==
Expand Down

0 comments on commit e9fe2d9

Please sign in to comment.