From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 596 invoked from network); 28 Jul 2023 20:13:03 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 28 Jul 2023 20:13:03 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1690575183; b=S0KRjX5J0DFwsngwkmbvE2RtxQHGOw+ET9tAenhAIDu+sc8K8N8LJwfJRbkxE0V7XdTKlmSi6G ytsQ4BIdv4V5TObz4dByViu2JkHD6eTqd2pHqmegJ+YTVmhKVBk+VIcpAQzIWVpjjiBjFDb5nd OWnGxxsAxFoluASh7Ef1nSJqtpxguZWdOdpQM725tFFIVo1fEEfwQ6MQIajVPi6hvqrOtz2eUX YN3aWHAetISlXajdpa5bC0cqwOA/rQcL6PEtKZewXKdDEK6kd7uL5TWdYyTQPaZLNlyCrQcR1B r1pmTZSVRxWhk3WurH+ktuTl6uOcLBGOWrudpTS76Pcukw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (redisdead.crans.org) smtp.remote-ip=185.230.79.39; dkim=pass header.d=crans.org header.s=mail header.a=rsa-sha256; dmarc=none header.from=crans.org; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1690575183; bh=Mx/zrexzwTtXHWnSege8nFCW3aBRP9HMGzWEWU0dhp0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:To:Subject:From: MIME-Version:Date:Message-ID:DKIM-Signature:DKIM-Signature; b=OH72pLFZSixWrEQbJeHrNp+6cmnY5b4tbS8rsgqceJpFuMrH2dJu5zqtXhaoJK0cCGaCEdCfpl BFYSYiA2N7S03Kpw+sxEitcQUUbPwv1xmxqHpt/37df52H1yxNPHnUuZYvXhRqtvZ7V9fwY5bT XNjMjTVKA44SWOaomxZfZYzp4C65T78Ri83Asj0VsO2kJAlGzKfzVKGOhcaANxQxuU/1+hUrER Piag9I/EfhzElD2jfQ0N9BMdk86YREFOCX+aXiow56me8tlpzSMAfDT4UkHnYdXInGtKFaJ+bi FA3A2HdkTMnacyuBylMogsPrheFWXPn0ivYj8QvyIn+gZg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:To:Subject:From:MIME-Version:Date:Message-ID:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References; bh=z0g0xv4bh8AAFQV+UFbGu/8Co4RvW/eCgvNLKzkB9bk=; b=pOoI9lMytmLi4DD0rGwR5xVu6Z 5LvUkouDH/sSeHyq2uZtTvQ656530lSYTg9FAGd8hjFIdkq/tPSaboETZildFeMS9q9dTih3Xdfp7 OVjBlQTH5EyJe+2D3WQIWAVNkF0HYHMDwNB9/O/pGjqRWZiSEoLW63psL/h2ay0koodHSd2t8TAix 6KhJkobIf/CKio4fxaVyderRY5U44uj6YQ4k1LCdMurE68q7toKWpUK3JYhZdZOEbPbP0OntGwh/v VPzhviP5w19aBr+s8pBq2cY+hBWuftwLI6+KYDrXwz+lgS+dsy5jSFEfuGlGR4ICPDnifdHpC6MXL Lx71AMwQ==; Received: by zero.zsh.org with local id 1qPTpf-0004bt-Ar; Fri, 28 Jul 2023 20:13:03 +0000 Authentication-Results: zsh.org; iprev=pass (redisdead.crans.org) smtp.remote-ip=185.230.79.39; dkim=pass header.d=crans.org header.s=mail header.a=rsa-sha256; dmarc=none header.from=crans.org; arc=none Received: from redisdead.crans.org ([185.230.79.39]:57778) (DNSSEC AD) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1qPTot-0003uz-4M; Fri, 28 Jul 2023 20:12:17 +0000 Received: from [IPV6:2a01:e0a:1aa:1110:d9b2:37e6:2368:fc5c] (unknown [IPv6:2a01:e0a:1aa:1110:d9b2:37e6:2368:fc5c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by redisdead.crans.org (Postfix) with ESMTPSA id 28631664 for ; Fri, 28 Jul 2023 22:12:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crans.org; s=mail; t=1690575134; bh=Mx/zrexzwTtXHWnSege8nFCW3aBRP9HMGzWEWU0dhp0=; h=Date:From:Subject:To:From; b=FXTjwLEDafTezOFqK1n+wm3AfjT6hT52QMcce5dkUJVQShMmHyeCKmD/UsP9XIpPu FzUd3MoAetvQ9SJHnYDx4S4lKmljIVOUQm55L4lEUEf/IidvguQjtrvFK6VFqQ+bLJ rYYYTR/DEuZAhjkG/HJcEWss94GAYTL2gGERLq8pdCOQ/vdXgIyS7XZQ+pj+MIOLyz NE2/+qfj7VXbm0/gAJ1awCTvK7309euQ5Uu0shMdUqqPhdRZFSpwUF9VeSl24aG66l 3c2BTPpMfhhpcNF17CGOjEurUw/s1BQBRjdyBywYryQn4FYmeCjDU22oTlzsbMbn4o hibtYkGw8yHnoKiXbzu2sdcTH+h0ZX/x4TVy8vqFU5TFZjxdBgEi7lROX8obleTq4A 5bYEIPhmccH6YL+nnfRJNnYoJmbQ8WNCrKwaxFcYoN9SaW5Jbtuy5AbBiRc1F5uv11 TM2DTRicFVkoNl1d5c2skt6XtWYOr0IZZCzZ02u5TcIdzDhluqHiO2gXtjgG82nFxF LbeSOePHyUYEI25AZpUH/5GuyzAvwo1whhO2/b9dOzoPhTET/yVNCoQQjZGosNTTUM 4lpw2k1qMkQHhcvKtdPYO1QNNLUnt0IC5YzTD3BLecQAgBLJCPdyU1nfBalp6wSqiN UcltzVU6SnG3x+OmQh9tIceI= Message-ID: <7e0eaaad-4dd4-c2af-2f78-12f644e89f83@crans.org> Date: Fri, 28 Jul 2023 22:12:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.1 Content-Language: en-US, en-AU, fr From: Johan Grande Subject: tss, a tool to manage files with filename tags To: zsh Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Seq: 29115 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: 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 # Files with tag1 $ tss query -t tag1 path/ -t # Tags found on files that have tag1 in path/ $ tss add tag1 # Files that don't have tag1 Best, -- Johan