tagger

Simple tagging system for any types of files
git clone git://git.konyahin.xyz/tagger
Log | Files | Refs | LICENSE

commit 9b94a74ce6d5cbc2a135ac92ba27f54bfdd24846
Author: Anton Konyahin <me@konyahin.xyz>
Date:   Sat,  3 Jun 2023 21:15:00 +0300

Inital version without any checks and tests

Diffstat:
ALICENSE | 21+++++++++++++++++++++
Atagger | 41+++++++++++++++++++++++++++++++++++++++++
2 files changed, 62 insertions(+), 0 deletions(-)

diff --git a/LICENSE b/LICENSE @@ -0,0 +1,21 @@ +MIT/X Consortium License + +© 2023 Anton Konyahin <me@konyahin.xyz> + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/tagger b/tagger @@ -0,0 +1,41 @@ +#!/usr/bin/env sh + +# Developer notes +# - 'tagger alias folder' for output alias and completion commands +# - add '_tagger_completion name folder` for aliases completion + +set -e + +print_help() { + echo "tagger - simple tagging system for any types of files +Usage: + tagger init name + create new folder structure, under name, for + keeping files and tags + tagger add folder file + move file to tagger in tagger folder + tagger tag folder file tag + add tag to file from tagger folder + tagger untag folder file tag + remove tag from file in tagger folder +" +} + +if [ -z "$1" ]; then + print_help + exit +fi + +base_folder="$2/.base" + +[ "$1" = "init" ] && mkdir -p "$base_folder" && exit + +[ "$1" = "add" ] && mv "$3" "$base_folder" && exit + +[ "$1" = "tag" ] && mkdir "$2/$4" && ln -s "$base_folder/$3" "$2/$4/" && exit + +[ "$1" = "untag" ] && rm "$2/$4/$3" && exit + +echo "Unknown command: $1" + +