Simple directory/file filtering for 'tmsu files'
I recently came across a very simple, straightforward query case that I felt should be expressible by a normal 'tmsu files' query.
Namely, to retrieve a list of all files in the current directory that are NOT tagged uploaded.
tmsu files -f not uploadeddoesn't work (not restricted to current dir, doesn't catch files that have no tags at all)
tmsu files -f not uploaded |grep -v /doesn't work (doesn't catch files that have no tags at all)
tmsu tags * | grep -vw 'uploaded' | sed 's/: $//g'works. Obviously it's a tad convoluted.
IMO, the appropriate syntax to express this is something like
tmsu files ./ not uploaded
The relevant argument being a directory name or glob pattern (eg './' to specify all files in the current directory, recursively; './*' to specify all files in the current directory only -- no recursion; './*.jpg' to specify all jpg files, etc.)
This is based on the 'no slashes in tags' rule: anything containing a slash can't be a tag, so it must be a directory/glob pattern.
The only corner case I notice here is with leading 'or'/'and',
tmsu files ./ or uploaded would then be a sensible expression.
There's some argument that if this is added, then placing directory/glob-patterns anywhere in the argument list makes sense.
tmsu files uploaded and ./ or
tmsu files 'uploaded not ( ./ or ../foo )' would make sense, etc.
I'm not sure what to think of that prospect. It doesn't seem like a technical problem, but I don't know whether it's a good idea.
(Yes, I'm still using tmsu. Am impressed by the speed improvements lately.)