Skip to content

Commit

Permalink
fix(kldunload): remove unused -X option
Browse files Browse the repository at this point in the history
The option `-X arg` for `compgen` is specified twice, but only the
latter takes effect.  Also, `-X kernel` excludes the word `kernel` but
the latter `-X '!*.ko'` also excludes the word `kernel` because it
only leaves the words matches the pattern `*.ko`.  Thus, we can just
filter the words by `-X '!*.ko'`.
  • Loading branch information
akinomyoga committed May 28, 2023
1 parent 0cd3bce commit 35017d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion completions/kldunload
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ _comp_cmd_kldunload()
local cur prev words cword comp_args
_comp_initialize -- "$@" || return

COMPREPLY=($(compgen -W '$(kldstat)' -X 'kernel' -X '!*.ko' -- "$cur"))
COMPREPLY=($(compgen -W '$(kldstat)' -X '!*.ko' -- "$cur"))
COMPREPLY=(${COMPREPLY[@]%.ko})
} &&
complete -F _comp_cmd_kldunload kldunload
Expand Down

0 comments on commit 35017d2

Please sign in to comment.