]> git.jsancho.org Git - guile-click.git/blob - examples/nested.scm
Groups support
[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    '()
29    (lambda ()
30      (format #t "Initialized the database"))))
31
32 (define dropdb
33   (command
34    '()
35    (lambda ()
36      (format #t "Dropped the database"))))
37
38 (define cli
39   (group
40    '()
41    "Database Tools"
42    initdb
43    dropdb))
44
45 (cli (command-line))