aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2013-03-21 23:41:13 +0100
committerGravatar Tom Willemsen2013-03-21 23:42:54 +0100
commita664f8f6e8409b3db3a9ee27199a9c0b7868fac8 (patch)
tree3cdb82989dffdfc9d11151b5b4a5e5d0743ee21c
parent99e7d7e303ffab779160f84ceb086aab9e5df065 (diff)
downloadclark-a664f8f6e8409b3db3a9ee27199a9c0b7868fac8.tar.gz
clark-a664f8f6e8409b3db3a9ee27199a9c0b7868fac8.zip
Separate help texts from help command
-rw-r--r--clark.lisp17
1 files changed, 13 insertions, 4 deletions
diff --git a/clark.lisp b/clark.lisp
index 072a6cc..0cae25d 100644
--- a/clark.lisp
+++ b/clark.lisp
@@ -5,6 +5,15 @@
(defvar *db* nil
"The database connection.")
+(defconstant *helps*
+ '(("add" "Add a bookmark to the database"
+ "add <url> <name> <description> [<tags> ...]")
+ ("help" "Display this help and exit"
+ "help")
+ ("version" "Output version information and exit"
+ "version"))
+ "Help texts for commands.")
+
(defconstant *version* "0.1.0"
"Clark's version.")
@@ -56,10 +65,10 @@ The result contains the url and the name of the bookmark."
" clark add <url> <name> <description> [<tags> ...]~%"
"~%"
"Possible commands:~%"
- "~%"
- "add Add a bookmark to the database~%"
- "help Display this help and exit~%"
- "version Output version information and exit~%")))
+ "~%"))
+ (map nil (lambda (hlp)
+ (destructuring-bind (name short long) hlp
+ (format t " ~7A ~A~%" name short))) *helps*))
(defun insert-bookmark (url name description)
"Insert URL, NAME and DESCRIPTION into the bookmark table."