From f70b12c1c9db537c72426e446932c673f288b4d3 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 21 Mar 2013 21:29:43 +0100 Subject: Reorder functions, add docstring to clark --- clark.lisp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'clark.lisp') 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)))) -- cgit v1.2.3-54-g00ecf