diff options
author | Case Duckworth | 2024-02-06 00:16:09 -0600 |
---|---|---|
committer | Case Duckworth | 2024-02-06 00:16:09 -0600 |
commit | ec8147f806ba13adc1980140befcd74e2e8469a4 (patch) | |
tree | 569dde9b119bcee06ac4217549dcaa4061a7816b /subtext.sh | |
parent | Various changes (diff) | |
download | subtext-ec8147f806ba13adc1980140befcd74e2e8469a4.tar.gz subtext-ec8147f806ba13adc1980140befcd74e2e8469a4.zip |
Add documentation
Diffstat (limited to 'subtext.sh')
-rwxr-xr-x | subtext.sh | 9 |
1 files 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... | |||
12 | Options: | 12 | Options: |
13 | -h Show this help and exit. | 13 | -h Show this help and exit. |
14 | -n Don't run the resulting script; just print it. | 14 | -n Don't run the resulting script; just print it. |
15 | -x Trace sh execution (sh -x). | ||
15 | -m FILE Use macrofile FILE. | 16 | -m FILE Use macrofile FILE. |
16 | -I DIRECTORY Add DIRECTORY to the search path. | 17 | -I DIRECTORY Add DIRECTORY to the search path. |
18 | -o FILE Output to FILE instead of stdout. | ||
17 | EOF | 19 | EOF |
18 | exit $1 | 20 | exit $1 |
19 | } | 21 | } |
@@ -25,15 +27,16 @@ configure() { | |||
25 | : "${ST_PIPE_SH:=true}" | 27 | : "${ST_PIPE_SH:=true}" |
26 | : "${ST_TRACE=+x}" | 28 | : "${ST_TRACE=+x}" |
27 | ## Process options | 29 | ## Process options |
28 | while getopts :hm:I:no:x OPT | 30 | while getopts :hnxm:I:o: OPT |
29 | do | 31 | do |
30 | case "$OPT" in | 32 | case "$OPT" in |
31 | (h) usage ;; | 33 | (h) usage ;; |
34 | (n) ST_PIPE_SH=false ;; | ||
35 | (x) ST_TRACE=-x ;; | ||
32 | (m) ST_MACROFILE="$OPTARG.st.sh" ;; | 36 | (m) ST_MACROFILE="$OPTARG.st.sh" ;; |
33 | (I) ST_SOPATH="$ST_SOPATH:$OPTARG" ;; | 37 | (I) ST_SOPATH="$ST_SOPATH:$OPTARG" ;; |
34 | (n) ST_PIPE_SH=false ;; | ||
35 | (o) exec > "$OPTARG" ;; | 38 | (o) exec > "$OPTARG" ;; |
36 | (x) ST_TRACE=-x ;; | 39 | ## bad arguments |
37 | (:) printf >&2 'Unknown option -%s\n' "$OPTARG"; | 40 | (:) printf >&2 'Unknown option -%s\n' "$OPTARG"; |
38 | usage 1 ;; | 41 | usage 1 ;; |
39 | (*) usage 1 ;; | 42 | (*) usage 1 ;; |