diff --git a/label b/label index 7f57df8..cb15496 100755 --- a/label +++ b/label @@ -1,6 +1,6 @@ #!/usr/bin/env zsh -set -ex +set -e : "${1:=--help}" @@ -19,7 +19,7 @@ EOF label rm "$2" _zsh_goto_sed -i '/^$/d' "$(_goto_file)" # Remove empty lines _zsh_goto_sed -i -e '$a\' "$(_goto_file)" # Fix potentially missing last newline - printf '%s %s\n' "${1}" $(echo "$2" | _zsh_goto_sed "s^${HOME}^~^g") >> "$(_goto_file)" + printf '%s %s\n' "${2}" $(realpath "${3:-$PWD}" | _zsh_goto_sed "s^${HOME}^~^g") >> "$(_goto_file)" ;; get)