diff --git a/CLAUDE.md b/CLAUDE.md index 998ee38..2066e13 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,4 +2,5 @@ - This is my nix configuration system. Whenever you need to introduce update to my config, remember to check the current config. - When you are going to introduce update to my nix config, do it on a experimental branch (use 'nightly'), and commit to that branch after you perform test to check the updates work as intended. Never work on the master branch which I will perform merge manually. -- After you introduce updates, remember to reflect those updates in the readme, should they bring any changes. \ No newline at end of file +- After you introduce updates, remember to reflect those updates in the readme, should they bring any changes. +- You can use `hms` to perform home-manager switch and `exec zsh` to refresh shell environment diff --git a/modules/papis.nix b/modules/papis.nix index afdd519..7032656 100644 --- a/modules/papis.nix +++ b/modules/papis.nix @@ -103,7 +103,7 @@ fi } - # Papis tag function - add multiple tags using hash-separated format + # Papis tag function - rewrite tags using hash-separated format patag() { if [ $# -ne 2 ]; then echo "Usage: patag \"tag1#tag2#tag3\" " @@ -115,21 +115,17 @@ local tags_string="$1" local query="$2" - # Build --add arguments by processing each tag - local add_args="" - local oldIFS="$IFS" - IFS='#' - for tag in $tags_string; do + # First, drop all existing tags + papis tag --drop "$query" + + # Add each tag individually by splitting on # + echo "$tags_string" | tr '#' '\n' | while read tag; do # Trim whitespace tag=$(echo "$tag" | xargs) if [ -n "$tag" ]; then - add_args="$add_args --add \"$tag\"" + papis tag --add "$tag" "$query" fi done - IFS="$oldIFS" - - # Execute the papis tag command - eval "papis tag $add_args \"$query\"" } ''; }