From 7d1330b0209c33d0449385bef237ccaf022d996b Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Fri, 14 Jul 2023 22:02:09 -0400 Subject: [PATCH] tagger.sh: improvements - no longer use printf incorrectly - more lenient new tag creation --- src/.local/bin/tagger.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/.local/bin/tagger.sh b/src/.local/bin/tagger.sh index 52648d4..fc9e9b1 100755 --- a/src/.local/bin/tagger.sh +++ b/src/.local/bin/tagger.sh @@ -44,15 +44,15 @@ editargs() { appendargs() { while true; do - RES="$(tmsu tags | fzf -m --print-query --header "Select tag (or write 'tagname+' or any other special character to create a new tag)" || true)" + RES="$(tmsu tags | fzf -m --print-query --header "Select tag (or write 'tagname;' to create a new tag)" || true)" if [ -z "$RES" ]; then break fi SEL="$(printf "%s\n" "$RES" | tail -n+2)" - QUER="$(printf "%s" "$RES" | head -n 1 | head -c-1)" + QUER="$(printf "%s" "$RES" | head -n 1 | sed 's/;$//')" if [ "$SEL" = "" ]; then - printf "$QUER\n" >> "$TMSU_ARGS" + printf "%s\n" "$QUER" >> "$TMSU_ARGS" else printf "$SEL\n" >> "$TMSU_ARGS" fi @@ -76,9 +76,9 @@ while read -r FILE; do while true; do printf "\n\ntagging %s%s%s with tags:\n" "$COL_LIGHT_BLUE" "$FILE" "$COL_RESET" - printf "$COL_LIGHT_PURPLE" + printf "%s" "$COL_LIGHT_PURPLE" cat "$TMSU_ARGS" | sed 's/^/- /' - printf "$COL_RESET" + printf "%s" "$COL_RESET" printf "\nh view again, j add tmsu args, k edit tmsu args, l confirm, q exit, s skip\n" printf "\n> " ANS="$(readc