Command line interface to abcddb-tool
[clinton/abcde.git] / abcddb-tool
index 218e75a..414839d 100755 (executable)
@@ -127,12 +127,19 @@ of (disc-number . tag-value)"
   ;; Store genre(s) in a bash array. mp3s will just have to live with
   ;; using the first, but Vorbis/FLAC can handle an arbitrary set of
   ;; genres
-    (format out "DGENRE=(~{$'~A' ~})~%" (map escape-for-shell (disc-query 'GENRE)))
+    (format out "CDGENRE=(~{$'~A' ~})~%" (map escape-for-shell (disc-query 'GENRE)))
 
     (format out "~:{TRACK~A=$'~A'~%~}"
            (map (lambda (ttitle) (list (1+ (first ttitle)) (escape-for-shell (second ttitle))))
                 (cddb-query-tracks cddb 'TITLE)))))
 
+(define (main args)
+  (cond ((string= (second args) "parse")
+        (call-with-input-file (third args)
+          (lambda (f) (cddb->export (read-cddb f)))))
+       (else
+        (apply execlp "cddb-tool" args))))
 
 
-
+(when (batch-mode?)
+  (exit (main (program-arguments))))
\ No newline at end of file