]> git.jsancho.org Git - guile-click.git/blobdiff - examples/hello.scm
Nested commands help message
[guile-click.git] / examples / hello.scm
index 4f59cccf85f770a24df71e9b33c091a949a2089a..b8f2eb6e61e2abb0189eddde1391c801735ecdff 100755 (executable)
 
 (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))