Browse Source

Support spaces in file names & direct piping to "listened"

Samuel W. Flint 1 year ago
parent
commit
f43ba0eb58
1 changed files with 10 additions and 4 deletions
  1. 10 4
      pod

+ 10 - 4
pod

@@ -144,11 +144,17 @@ case "$CMD" in
     listened)
         if [ $# -lt 1 ] ; then
             FILE=$(get_cur_file)
-            git_annex_wrap metadata -s tag=listened $FILE
+            git_annex_wrap metadata -s tag=listened "${FILE}"
         else
-            for FILE in $* ; do
-                git_annex_wrap metadata -s tag=listened $FILE
-            done
+            if [ $1 = '-' ] ; then
+                cat | while read FILE ; do
+                    git_annex_wrap metadata -s tag=listened "${FILE}"
+                done
+            else
+                for FILE in $* ; do
+                    git_annex_wrap metadata -s tag=listened "${FILE}"
+                done
+            fi
         fi
         exit
         ;;