]> git.jsancho.org Git - guile-click.git/blob - examples/nested.scm
414e5896b931f0dd9db958f0c30e21b46b7263ca
[guile-click.git] / examples / nested.scm
1 #!/usr/bin/guile-3.0 --no-auto-compile
2 -*- scheme -*-
3 !#
4 ;;; Click --- Command Line Interface Creation Kit for GNU Guile
5 ;;; Copyright © 2021 Javier Sancho <jsf@jsancho.org>
6 ;;;
7 ;;; This file is part of Click.
8 ;;;
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.
13 ;;;
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.
18 ;;;
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/>.
21
22
23 (use-modules (click))
24
25
26 (define initdb
27   (command
28    #:name "initdb"
29    #:help "Init database."
30    #:procedure (lambda ()
31                  (format #t "Initialized the database"))))
32
33 (define dropdb
34   (command
35    #:name "dropdb"
36    #:help "Drop database."
37    #:procedure (lambda ()
38                  (format #t "Dropped the database"))))
39
40 (define cli
41   (group
42    #:help "Database Tools"
43    #:commands `(,initdb ,dropdb)))
44
45 (cli (command-line))