aboutsummaryrefslogtreecommitdiffstats
path: root/src/argparser.bash
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/argparser.bash13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/argparser.bash b/src/argparser.bash
index c828360..72567a6 100644
--- a/src/argparser.bash
+++ b/src/argparser.bash
@@ -676,17 +676,20 @@ function args_parse
if [ $argnull = 0 ]; then
arg="${argqueue[$i]}"
fi
+ std="$(head -n 1 < "${args_optmap}/${opt}")"
+ trigger="$(tail -n 1 < "${args_optmap}/${opt}")"
+ if (( ${#argqueue[@]} <= $i )); then
+ "$trigger" "${opt}" "${std}"
+ fi
(( i++ ))
- opt="$(head -n 1 < "${args_optmap}/${opt}")"
+ opt="${std}"
if [ ! -e "${args_opts}/${opt}" ]; then
mkdir -p "${args_opts}/${opt}"
echo -n > "${args_opts}/${opt}/data"
echo -n > "${args_opts}/${opt}/null"
fi
- if (( ${#argqueue[@]} >= $i )); then
- echo "$arg" >> "${args_opts}/${opt}/data"
- echo "$argnull" >> "${args_opts}/${opt}/null"
- fi
+ echo "$arg" >> "${args_opts}/${opt}/data"
+ echo "$argnull" >> "${args_opts}/${opt}/null"
done
i=0