aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2013-03-21 21:29:43 +0100
committerGravatar Tom Willemsen2013-03-21 21:29:43 +0100
commitf70b12c1c9db537c72426e446932c673f288b4d3 (patch)
treeaf6ad91a271f8b7b14837eb5c2ef145dbd4ee840
parent0e6e79568156797cfd24a7e689eff280f3ff08b3 (diff)
downloadclark-f70b12c1c9db537c72426e446932c673f288b4d3.tar.gz
clark-f70b12c1c9db537c72426e446932c673f288b4d3.zip
Reorder functions, add docstring to clark
-rw-r--r--clark.lisp28
1 files changed, 16 insertions, 12 deletions
diff --git a/clark.lisp b/clark.lisp
index 923c0d3..aa4ea35 100644
--- a/clark.lisp
+++ b/clark.lisp
@@ -29,18 +29,6 @@ The result contains the url and the name of the bookmark."
(statement-column-value statement 1))
finally (finalize-statement statement))))
-(defun print-bookmark (bm)
- "Print information about bookmark BM.
-
-BM should be a list containing the url and name of the bookmark."
- (destructuring-bind (url name) bm
- (format t "~A~%~A~%~%" url name)))
-
-(defun make-command-name (base)
- "Turn BASE into the name of a possible command."
- (intern (concatenate 'string (string-upcase base) "-COMMAND")
- :org.ryuslash.clark))
-
(defun help-command (args)
"Show a help message."
(format t (concatenate
@@ -52,11 +40,27 @@ BM should be a list containing the url and name of the bookmark."
"help Display this help and exit~%"
"version Output version information and exit~%")))
+(defun make-command-name (base)
+ "Turn BASE into the name of a possible command."
+ (intern (concatenate 'string (string-upcase base) "-COMMAND")
+ :org.ryuslash.clark))
+
+(defun print-bookmark (bm)
+ "Print information about bookmark BM.
+
+BM should be a list containing the url and name of the bookmark."
+ (destructuring-bind (url name) bm
+ (format t "~A~%~A~%~%" url name)))
+
(defun version-command (args)
"Display clark's version number."
(format t "clark version ~A~%" *version*))
(defun clark (args)
+ "Main function.
+
+Connect to the database, parse command-line arguments, execute and
+then disconnect."
(check-db "test2.db")
(if (> (length args) 1)
(let* ((cmd-name (make-command-name (cadr args))))