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

Use fewer subprocesses and return newline-delimited, not space-delimited.
pull/1933/head
John D Pell 2021-09-08 15:58:32 -07:00
parent bf96d01b11
commit 91b4d5a0a4
1 changed files with 2 additions and 2 deletions

View File

@ -118,8 +118,8 @@ _bash-it-clean-component-cache() {
# Returns an array of items within each compoenent. # Returns an array of items within each compoenent.
_bash-it-component-list() { _bash-it-component-list() {
local component="$1" local IFS=$'\n' component="$1"
_bash-it-component-help "${component}" | awk '{print $1}' | uniq | sort | tr '\n' ' ' _bash-it-component-help "${component}" | awk '{print $1}' | sort -u
} }
_bash-it-component-list-matching() { _bash-it-component-list-matching() {