(usegauche.parseopt)(usegauche.sequence)(define (mainargs)(let-args(cdr args)((output"o|output"#f)(quiet"q|quiet"#f)(debug"d|debug=i"0).argv)(cond((not output)(format(current-error-port)"output option is not supplied.~%"))((not (memv debug'(012)))(format(current-error-port)"debug option's value must be 0, 1, or 2: ~A~%"debug))((null? argv)(format(current-error-port)"no arguments are supplied.~%"))(else(format#t"[options]~%o(output): ON~%q(quote): ~A~%d(debug): ~A~%~%"(if quiet'ON'OFF)debug)(format#t"[parameters]~%# of pamameters: ~A~%"(length argv))(for-each-with-index(lambda (ix)(format#t"~A: ~A~%"(+ i1)x))argv)(exit0)))1))
leque
#7609()
[
Scheme
]
Rating0/0=0.00
SRFI-37 や SLIB を使う方法もありますが、とりあえずは gauche.parseopt 版。 -oq のような指定や -d1, -d2 のような指定には対応していないようです。
ところで起動例にある -s オプションは -d ですよね?
;; エラー処理で悩んでしまった。
Rating0/0=0.00-0+
[ reply ]