diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2016-11-16 16:28:03 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2016-11-18 07:05:52 +0100 |
commit | b44a4bae7d5c1098709dfaffd122263e0f4c5bc6 (patch) | |
tree | 2789f5ab99317bf1e399f82b173e7d2ba3b1ce1c /doc/grosciteco.tes | |
parent | cb5e08b40d7444817c7eb6c1e4e8bf5208c2823c (diff) | |
download | sciteco-b44a4bae7d5c1098709dfaffd122263e0f4c5bc6.tar.gz |
standard lib: added getopt.tes for parsing command line options in scripts
* this uses an optstring compatible with getopt(3).
* It does not use repeated getopt calls to iterate options, though
but places the results in registers beginning with "getopt.".
E.g. option "C" will result in "getopt.C" being set after the
call to setopt.
String arguments are supported and are placed in the string part
of the getopt registers.
* The grosciteco.tes and symbols-extract.tes scripts make use of
getopt now, to simplify and clean up their command line handling.
Diffstat (limited to 'doc/grosciteco.tes')
-rwxr-xr-x | doc/grosciteco.tes | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/doc/grosciteco.tes b/doc/grosciteco.tes index 7be01fb..262f2c0 100755 --- a/doc/grosciteco.tes +++ b/doc/grosciteco.tes @@ -1,9 +1,14 @@ #!/usr/local/bin/sciteco -m -!* grosciteco.tes <output-woman> <output-tec> <input> *! +!* grosciteco.tes [-t <output-tec>] [--] <output-woman> <input> *! + +:EMQ[$SCITECOPATH]/getopt.tes !* Process command-line options *! -LR 0X[output-woman] 2LR 0X[output-tec] 2LR 0X[input] HK -EBQ[input] +[optstring]t: M[getopt]"F (0/0) ' +LR 0X[output-woman] 2LR 0X[input] HK +:Q[getopt.t]"< EU[getopt.t]Q[output-woman].tec ' + +EBN[input] ! skip whitespace characters ! @#sw{ @@ -278,6 +283,6 @@ EQ[styles] !* Generate topic index *! J I!*Q[topics]*!^J -EWQ[output-tec] +EWQ[getopt.t] -EX |