aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/commands.lisp
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-10-06 15:06:19 +0200
committerGravatar Tom Willemse2013-10-06 15:06:19 +0200
commit209281dcd98231be16b8c67d05597758ae64f43b (patch)
tree9a843088d04f9ab7f7047da5b174ce11302b1a34 /lisp/commands.lisp
parentacc01decbee8479390cef7d0693c1596afc65b02 (diff)
downloadclark-209281dcd98231be16b8c67d05597758ae64f43b.tar.gz
clark-209281dcd98231be16b8c67d05597758ae64f43b.zip
Add tags commandHEADmaster
Diffstat (limited to 'lisp/commands.lisp')
-rw-r--r--lisp/commands.lisp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lisp/commands.lisp b/lisp/commands.lisp
index e92c8b2..2e406ad 100644
--- a/lisp/commands.lisp
+++ b/lisp/commands.lisp
@@ -128,3 +128,17 @@ remove all tags from bookmark."
Print the version number and exit."
(format t "clark version ~A~%" version))
+
+(defcommand tags (&optional (num 0))
+ "List a number of or all tags."
+ "Usage: clark tags [<num>]
+
+Print a list of tags and the number of bookmarks tagged with it
+ordered by that number. If NUM is given, only print the first NUM
+tags."
+ (let ((num (if (integerp num) num (parse-integer num)))
+ (counter 1))
+ (dolist (tag (tag-list))
+ (format t "~30A~10D~%" (car tag) (cadr tag))
+ (if (> (incf counter) num 0)
+ (return)))))