From ea4806df9dae0293d0ca40a76a3e92ae1630f7d2 Mon Sep 17 00:00:00 2001 From: Narvin Singh Date: Tue, 29 Dec 2020 14:19:54 -0500 Subject: [PATCH] Feat: Module list can be comma or space delimited --- xrsbd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xrsbd b/xrsbd index 13aba19..6d7806c 100755 --- a/xrsbd +++ b/xrsbd @@ -27,7 +27,7 @@ main() { # Since stat_cache is hash ordered, maintain the display order (as defined # by mod_list) of the keys so we can loop over the cache in display order # when generating the full status - local -a stat_cache_ordered_mods + local -a stat_cache_ordered_mods mods local mod mod_file # Map the module file name to the module function @@ -37,7 +37,8 @@ main() { # For each module in the list, if the module file exists then source it, add # its name to the ordered array, and call its function and cache the value - for mod in ${mod_list}; do + IFS=', ' read -r -a mods <<< "${mod_list}" + for mod in ${mods[@]}; do mod_file="${MOD_DIR}/${mod}" if [[ -r "${mod_file}" ]]; then # shellcheck source=/dev/null @@ -47,7 +48,6 @@ main() { fi done - # Construct and display the status by looping over the cached values in order draw_status() { local mod stat