X-Git-Url: https://git.jsancho.org/?p=guile-click.git;a=blobdiff_plain;f=examples%2Fnested.scm;fp=examples%2Fnested.scm;h=023e1ef72f479f140b9ae8f6073551b8cda6e046;hp=0000000000000000000000000000000000000000;hb=ebf74b7c3fda8ead57a398bb6a1555067150d06f;hpb=ee290f19711b9e4fb789a0b2a164635e7140a8e5 diff --git a/examples/nested.scm b/examples/nested.scm new file mode 100755 index 0000000..023e1ef --- /dev/null +++ b/examples/nested.scm @@ -0,0 +1,45 @@ +#!/usr/bin/guile-3.0 --no-auto-compile +-*- scheme -*- +!# +;;; Click --- Command Line Interface Creation Kit for GNU Guile +;;; Copyright © 2021 Javier Sancho +;;; +;;; This file is part of Click. +;;; +;;; Click is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or +;;; (at your option) any later version. +;;; +;;; Click is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with Click. If not, see . + + +(use-modules (click)) + + +(define initdb + (command + '() + (lambda () + (format #t "Initialized the database")))) + +(define dropdb + (command + '() + (lambda () + (format #t "Dropped the database")))) + +(define cli + (group + '() + "Database Tools" + initdb + dropdb)) + +(cli (command-line))