'tmsu tags' help incorrect

17 views
Skip to first unread message

D Gowers

unread,
Oct 28, 2014, 8:36:30 PM10/28/14
to tm...@googlegroups.com
Hi,

'tmsu help tags' says:


tmsu tags [OPTION]... [FILE]...

Lists the tags applied to FILEs. **If no FILE is specified then all files in the
database are listed.**


Emphasis mine.

Whereas of course the actual behaviour is that when no FILE is specified, all *tags* in the database are listed.

Currently there seems to be no way to list all files in the database using only TMSU.
For now, I'm using "sqlite3 ~/.tmsu/default.db "select directory, name from file" | sed 's,|,/,g' |" with xargs to work around this.

I can file a bug if necessary, but this seemed like something that probably had a very simple fix.


David

Paul Ruane

unread,
Oct 29, 2014, 5:34:36 AM10/29/14
to tm...@googlegroups.com

Hi,

Thanks for pointing this out to me. I recently changed the behavior of the commands to improve consistency.

In 0.4 you need to specify the --all option to list all files as it will list tags for the files in the current directory without arguments. In 0.5 you can simply omit the arguments to list ask the tags. It could be I've failed to keep the  documentation up to date.  Unfortunately I'm currently away so am unable to fix it until the weekend. I'll check it out then though. (Opportunity to try out Google Inbox to remind me!)

Hope this clarifies it for you.

Thanks
Paul

--
You received this message because you are subscribed to the Google Groups "tmsu" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmsu+uns...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

D Gowers

unread,
Oct 29, 2014, 7:12:59 AM10/29/14
to tm...@googlegroups.com
> In 0.4 you need to specify the --all option to list all files as it will list tags for the files in the current directory without arguments. In 0.5 you can simply omit the arguments to list ask the tags

Unless I'm missing something, the two things you are comparing are not equivalent: 0.4 'tmsu tags --all' lists tagging of all files, whereas 0.5 'tmsu tags' lists every unique tag name. There doesn't appear to currently be a way to list taggings of all files (that is, "some/file: apple banana orange","other/file: grape kumquat mango" etc)

Paul Ruane

unread,
Oct 29, 2014, 11:34:50 AM10/29/14
to tm...@googlegroups.com
I haven't looked at 0.4 for a while and don't have my laptop with me but as far as I can remember tmsu tags --all lists every unique tag defined. This is directly equivalent to tmsu tags with no arguments in 0.5. There is no way in either version to list every file along with all it's tags. To do this you wool need to pipe:

0.4: tmsu files --all | xargs tmsu tags
0.5: tmsu files | xargs tmsu tags

Apologies if I have remembered this incorrectly.

Paul

D Gowers

unread,
Oct 29, 2014, 7:57:22 PM10/29/14
to tm...@googlegroups.com
No, sorry, of course 0.4 doesn't do that. Rather, the 0.5 help message claims "Lists the tags applied to FILEs. If no FILE is specified then all files in the
database are listed.". To me, this appears to be a clear claim that such functionality existed (although it may, of course, be a lie .. I don't remember definitively myself).

`tmsu files | tr \\n \\0 | xargs -0 tmsu tags`  appears to do the task in question correctly.
(the version without tr and -0 does not, because xargs chokes on certain filenames otherwise)

Paul Ruane

unread,
Nov 5, 2014, 2:32:26 AM11/5/14
to tm...@googlegroups.com

Sorry for the delay. I've fixed the bad wording in the tags command on the default branch. I'll add some more examples to the tips and tricks page on the wiki to cover listing all files along with their tags.

Thanks again
Paul

Reply all
Reply to author
Forward
0 new messages