Skip to content

Commit

Permalink
su: Fix long option handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Feb 18, 2012
1 parent f41d7e2 commit e4fe946
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions completions/su
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ fi

_su() # linux-specific completion
{
local cur prev words cword
_init_completion || return
local cur prev words cword split
_init_completion -s || return

case "$prev" in
-s|--shell)
Expand All @@ -23,6 +23,8 @@ _su() # linux-specific completion
;;
esac

$split && return

if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
Expand Down

0 comments on commit e4fe946

Please sign in to comment.