File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ source "$BASHUNIT_ROOT_DIR/src/main.sh"
3232
3333_ASSERT_FN=" "
3434_FILTER=" "
35+ _RAW_ARGS=()
3536_ARGS=()
3637_BENCH_MODE=false
3738
@@ -105,16 +106,23 @@ while [[ $# -gt 0 ]]; do
105106 trap ' ' EXIT && exit 0
106107 ;;
107108 * )
108- pattern=' *[tT]est.sh'
109- [[ " $_BENCH_MODE " == true ]] && pattern=' *[bB]ench.sh'
110- while IFS= read -r file; do
111- _ARGS+=(" $file " )
112- done < <( helper::find_files_recursive " $1 " " $pattern " )
109+ _RAW_ARGS+=(" $1 " )
113110 ;;
114111 esac
115112 shift
116113done
117114
115+ # Expand positional arguments after all options have been processed
116+ if [[ ${# _RAW_ARGS[@]} -gt 0 ]]; then
117+ pattern=' *[tT]est.sh'
118+ [[ " $_BENCH_MODE " == true ]] && pattern=' *[bB]ench.sh'
119+ for arg in " ${_RAW_ARGS[@]} " ; do
120+ while IFS= read -r file; do
121+ _ARGS+=(" $file " )
122+ done < <( helper::find_files_recursive " $arg " " $pattern " )
123+ done
124+ fi
125+
118126# Optional bootstrap
119127# shellcheck disable=SC1090
120128[[ -f " ${BASHUNIT_BOOTSTRAP:- } " ]] && source " $BASHUNIT_BOOTSTRAP "
You can’t perform that action at this time.
0 commit comments