From: Johan Grande <nahoj@crans.org>
To: zsh <zsh-users@zsh.org>
Subject: tss, a tool to manage files with filename tags
Date: Fri, 28 Jul 2023 22:12:12 +0200 [thread overview]
Message-ID: <7e0eaaad-4dd4-c2af-2f78-12f644e89f83@crans.org> (raw)
Hi all. I thought I should present what I've been working on for the
past weeks.
This is my first time developing anything half-serious in zsh. I'd love
some thoughts on it or even a code review if anybody feels like it.
I took this project as an exercise and aimed to write as clean and
robust code as I could, offer decent completion (though I admit I only
understand the most simple features of the system), and have automated
testing for the core features.
The code: https://github.com/nahoj/tss
git clone https://github.com/nahoj/tss.git
## What it does
tss is a tool to tag and find files with tags à la TagSpaces (a
graphical tool), i.e., tags in file names such as "IMG-2653[vacation
alps].jpg".
As you can guess, one can perfectly manage such files without any
specialized tool, which was part of the appeal of this tagging system to
me. But after a couple of years of tagging my files half in TagSpaces,
half by hand, I thought a dedicated CLI tool would be handy after all.
$ ls
IMG-2653.jpg
$ tss add 'vacation alps' IMG-2653.jpg
$ tss files -t 'alps' *
IMG-2653[vacation alps].jpg
$ cp "IMG-2653[vacation alps].jpg" "IMG-2653_copy[vacation alps copy].jpg"
$ tss files -t 'alps' -T 'copy' * # or --tags 'alps' --not-tags 'copy'
IMG-2653[vacation alps].jpg
### Glob patterns
$ tss remove 'v* a*' "IMG-2653_copy[vacation alps copy].jpg"
$ find | tss filter -t '(alps|pyrenees)'
./IMG-2653[vacation alps].jpg
### Completion
$ tss query -t tag1 <tab> # Files with tag1
$ tss query -t tag1 path/ -t <tab> # Tags found on files that have tag1
in path/
$ tss add tag1 <tab> # Files that don't have tag1
Best,
--
Johan
next reply other threads:[~2023-07-28 20:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-28 20:12 Johan Grande [this message]
2023-07-29 12:57 ` Thomas Lauer
2023-07-29 13:51 ` Johan Grande
2023-07-30 17:34 ` Thomas Lauer
2023-07-30 18:12 ` Johan Grande
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7e0eaaad-4dd4-c2af-2f78-12f644e89f83@crans.org \
--to=nahoj@crans.org \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).