Improve argument handling
This commit is contained in:
parent
038787903e
commit
0aab5270c8
10
hell.sh
10
hell.sh
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue