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"
32
32
33
33
_ASSERT_FN=" "
34
34
_FILTER=" "
35
+ _RAW_ARGS=()
35
36
_ARGS=()
36
37
_BENCH_MODE=false
37
38
@@ -105,16 +106,23 @@ while [[ $# -gt 0 ]]; do
105
106
trap ' ' EXIT && exit 0
106
107
;;
107
108
* )
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 " )
113
110
;;
114
111
esac
115
112
shift
116
113
done
117
114
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
+
118
126
# Optional bootstrap
119
127
# shellcheck disable=SC1090
120
128
[[ -f " ${BASHUNIT_BOOTSTRAP:- } " ]] && source " $BASHUNIT_BOOTSTRAP "
You can’t perform that action at this time.
0 commit comments