diff options
author | Tom Willemsen | 2013-03-21 21:29:43 +0100 |
---|---|---|
committer | Tom Willemsen | 2013-03-21 21:29:43 +0100 |
commit | f70b12c1c9db537c72426e446932c673f288b4d3 (patch) | |
tree | af6ad91a271f8b7b14837eb5c2ef145dbd4ee840 | |
parent | 0e6e79568156797cfd24a7e689eff280f3ff08b3 (diff) | |
download | clark-f70b12c1c9db537c72426e446932c673f288b4d3.tar.gz clark-f70b12c1c9db537c72426e446932c673f288b4d3.zip |
Reorder functions, add docstring to clark
-rw-r--r-- | clark.lisp | 28 |
1 files changed, 16 insertions, 12 deletions
@@ -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)))) |