diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/markam.scm | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/markam.scm b/src/markam.scm index 5d6581f..8069701 100644 --- a/src/markam.scm +++ b/src/markam.scm @@ -1,5 +1,5 @@ ;;; markam -- Store/retrieve/manage bookmarks -;; Copyright (C) 2012 Tom Willemsen <tom at ryuslash dot org> +;; Copyright (C) 2012,2013 Tom Willemsen <tom at ryuslash dot org> ;; This program is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -42,9 +42,13 @@ ;; stream. (: print-row (string fixnum string string -> void)) (define (print-row url seconds name description) - (format #t "~a~% ~a~% ~a~% ~a~%~%" (string-no-null name) - (string-no-null description) (string-no-null url) - (seconds->string seconds))) + (if script? + (format #t "~a~a~a" + (string-no-null name) (string-no-null description) + (string-no-null url)) + (format #t "~a~% ~a~% ~a~% ~a~%~%" (string-no-null name) + (string-no-null description) (string-no-null url) + (seconds->string seconds)))) ;; Add NAME to the `tag' table in DB. (define (add-tag db name) @@ -120,9 +124,19 @@ END (format #t "Unrecognized option: ~a~%" (car args)))) (set! args (cdr args)))) +(define (check-script args) + (if (member "--script" args) + (begin + (set! script? #t) + (delete "--script" args)) + args)) + +(define script? #f) + ;; Open a database connection, list bookmarks, create a bookmark or ;; pass arguments on to `handle-regular-args'. (define (main args) + (set! args (check-script args)) (let ((db (open-database (data-file "markam.db")))) (cond ((null? args) |
