diff --git a/lib/chibi/app-test.sld b/lib/chibi/app-test.sld index 01af4894..d817928f 100644 --- a/lib/chibi/app-test.sld +++ b/lib/chibi/app-test.sld @@ -40,5 +40,10 @@ (test 'error (guard (exn (else 'error)) (run-application zoo-app-spec - '("zoo" "--soap" "wash" "--animals" "rhino")))) + '("zoo" "--soap" "wash" "--animals" "rhino")))) + (let ((out (open-output-string))) + (parameterize ((current-output-port out)) + (run-application zoo-app-spec '("zoo" "help")) + (test "Usage: zoo [options] \nCommands:\n feed animals ... - feed the animals\n wash animals ... - wash the animals\n help - print help\nOptions:\n --animals - list of animals to act on (default all)\n -l, --lions - also apply the action to lions\n" + (get-output-string out)))) (test-end)))) diff --git a/lib/chibi/app.scm b/lib/chibi/app.scm index 18228545..9738dad3 100644 --- a/lib/chibi/app.scm +++ b/lib/chibi/app.scm @@ -538,7 +538,7 @@ (and (pair? (car ls)) (memq (caar ls) '(begin: end:) ))) (lp (cdr ls) (car ls) commands options)) ((and (pair? (car ls)) (eq? '@ (caar ls))) - (lp (cdr ls) docs commands (append options (cadr (car ls))))) + (lp (cdr ls) docs commands (append options (cdar ls)))) ((and (pair? (car ls)) (symbol? (caar ls))) ;; don't print nested commands (if (pair? commands)