Commits

Paul Ruane  committed 0041c9c

Fixed Zsh completion for 'tag' command broken in earlier check-in.
Added extra verbose logging to 'tag' command.

  • Participants
  • Parent commits 8c2408d

Comments (0)

Files changed (2)

File misc/zsh/_tmsu

 	_arguments -s -w ''{--tags=,-t}'[apply set of tags to multiple files]:tags:_tmsu_tags' \
 	                 ''{--recursive,-r}'[apply tags recursively to contents of directories]' \
 	                 ''{--from+,-f}'[copy tags from the specified file]:source:_files' \
-	                 '*:file:_files' \
+	                 '*:: :->items' \
 	&& ret=0
+
+	case $state in
+        (items)
+            if (( ${+opt_args[--tags]} ))
+            then
+                _wanted files expl 'files' _files
+            else
+                if (( CURRENT == 1 ))
+                then
+                    _wanted files expl 'file' _files
+                else
+                    _wanted tags expl 'tags' _tmsu_tags
+                fi
+            fi
+    esac
 }
 
 _tmsu_cmd_tags() {

File src/tmsu/cli/tag.go

 		}
 	}
 
+	log.Infof(2, "%v: checking if file exists", absPath)
+
 	file, err := store.FileByPath(absPath)
 	if err != nil {
 		return fmt.Errorf("%v: could not retrieve file: %v", path, err)
 }
 
 func addFile(store *storage.Storage, path string, modTime time.Time, size uint, isDir bool) (*entities.File, error) {
-	log.Infof(2, "%v: adding file.", path)
+	log.Infof(2, "%v: creating fingerprint", path)
 
 	fingerprint, err := fingerprint.Create(path)
 	if err != nil {
 		return nil, fmt.Errorf("%v: could not create fingerprint: %v", path, err)
 	}
 
+	log.Infof(2, "%v: adding file.", path)
+
 	file, err := store.AddFile(path, fingerprint, modTime, int64(size), isDir)
 	if err != nil {
 		return nil, fmt.Errorf("%v: could not add file to database: %v", path, err)