lib/utilities: fix `_bash-it-component-list-enabled()`

Use fewer subprocesses, return newline-delimited instead of space-delimited, and use `sort -u` instead of `uniq | sort`
pull/1933/head
John D Pell 2021-09-08 16:02:18 -07:00
parent e599a9561c
commit 2391ac77c4
1 changed files with 2 additions and 2 deletions

View File

@ -129,8 +129,8 @@ _bash-it-component-list-matching() {
}
_bash-it-component-list-enabled() {
local component="$1"
_bash-it-component-help "${component}" | $(_bash-it-grep) -E '\[x\]' | awk '{print $1}' | uniq | sort | tr '\n' ' '
local IFS=$'\n' component="$1"
_bash-it-component-help "${component}" | $(_bash-it-grep) -E '\[x\]' | awk '{print $1}' | sort -u
}
_bash-it-component-list-disabled() {