1 #!/usr/bin/guile-3.0 --no-auto-compile
4 ;;; Click --- Command Line Interface Creation Kit for GNU Guile
5 ;;; Copyright © 2021 Javier Sancho <jsf@jsancho.org>
7 ;;; This file is part of Click.
9 ;;; Click is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or
12 ;;; (at your option) any later version.
14 ;;; Click is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 ;;; General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with Click. If not, see <http://www.gnu.org/licenses/>.
28 #:option-spec '((count (single-char #\c) (default 1) (help "Number of greetings."))
29 (name (prompt "Your name") (help "The person to greet.")))
30 #:procedure (lambda (count name)
31 "Simple program that greets NAME for a total of COUNT times."
32 (let loop ((times count))
34 (format #t "Hello ~a!~%" name)
35 (loop (- times 1))))))))
37 (hello (command-line))