X-Git-Url: https://git.jsancho.org/?p=guile-click.git;a=blobdiff_plain;f=examples%2Fhello.scm;h=b8f2eb6e61e2abb0189eddde1391c801735ecdff;hp=4f59cccf85f770a24df71e9b33c091a949a2089a;hb=84da61950d4a4038f76fdb9f66e0bbbb71f75385;hpb=ebf74b7c3fda8ead57a398bb6a1555067150d06f diff --git a/examples/hello.scm b/examples/hello.scm index 4f59ccc..b8f2eb6 100755 --- a/examples/hello.scm +++ b/examples/hello.scm @@ -25,13 +25,13 @@ (define hello (command - '((count (single-char #\c) (default 1) (help "Number of greetings.")) - (name (prompt "Your name") (help "The person to greet."))) - (lambda (count name) - "Simple program that greets NAME for a total of COUNT times." - (let loop ((times count)) - (cond ((> times 0) - (format #t "Hello ~a!~%" name) - (loop (- times 1)))))))) + #:option-spec '((count (single-char #\c) (default 1) (help "Number of greetings.")) + (name (prompt "Your name") (help "The person to greet."))) + #:procedure (lambda (count name) + "Simple program that greets NAME for a total of COUNT times." + (let loop ((times count)) + (cond ((> times 0) + (format #t "Hello ~a!~%" name) + (loop (- times 1)))))))) (hello (command-line))