From fc7d002ed211d78e352b1ca96d3749a69cac63ee Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Thu, 3 Mar 2005 18:33:58 +0000 Subject: [PATCH] . original commit: b90e5dfd5b95038e6b56ec208b7af931cafef431 --- collects/mzlib/cmdline.ss | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/collects/mzlib/cmdline.ss b/collects/mzlib/cmdline.ss index e7feda6..65c659a 100644 --- a/collects/mzlib/cmdline.ss +++ b/collects/mzlib/cmdline.ss @@ -96,6 +96,8 @@ [(expr1 rest) (extract-one "handler body expressions" rest line)]) + (when (null? helps) + (serror "missing help string/s")) (with-syntax ([formals formals] [formal-names (formal-names formals)] [helps helps] @@ -266,14 +268,13 @@ (arity-at-least? a) (bad-table (format "flag handler procedure cannot have multiple cases: ~e" (cadr line))))) - (or (and (list? (caddr line)) - (let ([h (caddr line)]) - (or (null? h) - (and (or (string? (car h)) - (andmap string? (car h))) - (andmap string? (cdr h)))))) - (bad-table (format "spec-line help section must be a list of strings"))) - + (or (let ([h (caddr line)]) + (and (pair? h) + (or (string? (car h)) + (andmap string? (car h))) + (andmap string? (cdr h)))) + (bad-table (format "spec-line help section must be a list of string-or-string-list and strings"))) + (or (let ([l (length (caddr line))] [a (procedure-arity (cadr line))]) (if (number? a) @@ -295,7 +296,7 @@ (let ([a (procedure-arity unknown-flag)]) (or (number? a) (arity-at-least? a)))) (raise-type-error 'parse-command-line "unknown-flag procedure of simple arity, accepting 1 argument (an perhaps more)" unknown-flag)) - + (letrec ([a (procedure-arity finish)] [l (length finish-help)] [a-c (lambda (a)