Improve argument handling

This commit is contained in:
Case Duckworth 2020-02-26 08:24:12 -06:00
parent 038787903e
commit 0aab5270c8
1 changed files with 6 additions and 4 deletions

10
hell.sh
View File

@ -123,27 +123,29 @@ tag()
case "$1" in
-i) # inline
tagstack="$INLINES"
shift
;;
-b) # block
tagstack="$BLOCKS"
shift
;;
*) # other -- default to block
tagstack="$BLOCKS"
;;
esac
case "$2" in
case "$1" in
*/) # set this tag to auto-close. don't push it onto the stack.
autoclose=true
tag="${2%/}"
tag="${1%/}"
;;
*) # begin a tag and push it onto the stack.
tag="$2"
tag="$1"
push "$tagstack" "$tag"
;;
esac
shift 2
shift
parseterms "$@" # parse the rest of the arguments
if "$autoclose" && [ -z "$text" ]; then