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

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:58 -07:00
parent 2391ac77c4
commit 120dee2569
1 changed files with 2 additions and 2 deletions

View File

@ -134,8 +134,8 @@ _bash-it-component-list-enabled() {
} }
_bash-it-component-list-disabled() { _bash-it-component-list-disabled() {
local component="$1" local IFS=$'\n' component="$1"
_bash-it-component-help "${component}" | $(_bash-it-grep) -E -v '\[x\]' | awk '{print $1}' | uniq | sort | tr '\n' ' ' _bash-it-component-help "${component}" | $(_bash-it-grep) -E -v '\[x\]' | awk '{print $1}' | sort -u
} }
# Checks if a given item is enabled for a particular component/file-type. # Checks if a given item is enabled for a particular component/file-type.