Skip to content

Commit

Permalink
update-rc.d: remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed Nov 25, 2019
1 parent fb46fed commit 845be11
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions completions/update-rc.d
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ _update_rc_d()
local cur prev words cword
_init_completion || return

local sysvdir services options valid_options
local sysvdir services options

[[ -d /etc/rc.d/init.d ]] && sysvdir=/etc/rc.d/init.d \
|| sysvdir=/etc/init.d
Expand All @@ -17,11 +17,6 @@ _update_rc_d()
options=( -f -n )

if [[ $cword -eq 1 || "$prev" == -* ]]; then
valid_options=( $(\
tr " " "\n" <<<"${words[*]} ${options[*]}" \
| command sed -ne "/$(command sed "s/ /\\|/g" <<<"${options[*]}")/p" \
| sort | uniq -u \
) )
COMPREPLY=( $(compgen -W '${options[@]} ${services[@]}' \
-X '$(tr " " "|" <<<${words[@]})' -- "$cur") )
elif [[ "$prev" == ?($(tr " " "|" <<<"${services[*]}")) ]]; then
Expand Down

0 comments on commit 845be11

Please sign in to comment.