X-Git-Url: https://git.jsancho.org/?p=guile-click.git;a=blobdiff_plain;f=examples%2Fhello.scm;h=b8f2eb6e61e2abb0189eddde1391c801735ecdff;hp=9f00e6bbd5e3d279e37276d58afbdf49b00ce9d8;hb=84da61950d4a4038f76fdb9f66e0bbbb71f75385;hpb=7bb66a7166059976c81aef6e76f205c14b45cc45 diff --git a/examples/hello.scm b/examples/hello.scm index 9f00e6b..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))