Skip to content

Commit

Permalink
useradd, usermod: Support comma separated -G/--groups arg completion.
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Oct 25, 2012
1 parent 09d24da commit 8ec4846
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion completions/useradd
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ _useradd()
return 0
;;
-G|--groups)
COMPREPLY=( $( compgen -g -- "$cur" ) )
local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*},"
COMPREPLY=( $( compgen -P "$prefix" -g -- "${cur##*,}" ) )
return 0
;;
-s|--shell)
Expand Down
3 changes: 2 additions & 1 deletion completions/usermod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ _usermod()
return 0
;;
-G|--groups)
COMPREPLY=( $( compgen -g -- "$cur" ) )
local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*},"
COMPREPLY=( $( compgen -P "$prefix" -g -- "${cur##*,}" ) )
return 0
;;
-s|--shell)
Expand Down

0 comments on commit 8ec4846

Please sign in to comment.