Skip to content

Commit

Permalink
bash-completion/rc-service: don't set or unset extglob
Browse files Browse the repository at this point in the history
It breaks bash-completion.
It's not necessary to set extglob as patterns in '[[' after '=='
are always matched as if extglob were set.

Closes: #636
Signed-off-by: Jernej Jakob <[email protected]>
  • Loading branch information
jjakob authored and dwfreed committed Jul 27, 2023
1 parent 92662dd commit cd53239
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions bash-completion/rc-service
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,11 @@ _rc_service()
return 0
elif [[ ${COMP_CWORD} -eq 2 ]] && [[ ${prev} != -* ]]; then # if second word typed and we didn't type in a function
rc-service --exists "$prev" || return
shopt -s extglob
while read -r _ line; do
if [[ $line == +([[:alnum:]_]):* ]]; then
opts+="${line%%:*} "
fi
done < <(rc-service "$prev" describe 2>&1)
shopt -u extglob
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
fi
Expand Down

0 comments on commit cd53239

Please sign in to comment.