From ec8147f806ba13adc1980140befcd74e2e8469a4 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 6 Feb 2024 00:16:09 -0600 Subject: Add documentation --- subtext.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/subtext.sh b/subtext.sh index a60f0d6..f384468 100755 --- a/subtext.sh +++ b/subtext.sh @@ -12,8 +12,10 @@ Usage: subtext [OPTIONS] FILE... Options: -h Show this help and exit. -n Don't run the resulting script; just print it. + -x Trace sh execution (sh -x). -m FILE Use macrofile FILE. -I DIRECTORY Add DIRECTORY to the search path. + -o FILE Output to FILE instead of stdout. EOF exit $1 } @@ -25,15 +27,16 @@ configure() { : "${ST_PIPE_SH:=true}" : "${ST_TRACE=+x}" ## Process options - while getopts :hm:I:no:x OPT + while getopts :hnxm:I:o: OPT do case "$OPT" in (h) usage ;; + (n) ST_PIPE_SH=false ;; + (x) ST_TRACE=-x ;; (m) ST_MACROFILE="$OPTARG.st.sh" ;; (I) ST_SOPATH="$ST_SOPATH:$OPTARG" ;; - (n) ST_PIPE_SH=false ;; (o) exec > "$OPTARG" ;; - (x) ST_TRACE=-x ;; + ## bad arguments (:) printf >&2 'Unknown option -%s\n' "$OPTARG"; usage 1 ;; (*) usage 1 ;; -- cgit 1.4.1-21-gabe81