Bugfix: $2 is the name and $3 may be a path
This commit is contained in:
parent
d3c40428d7
commit
3bd6d3b678
1 changed files with 2 additions and 2 deletions
4
label
4
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)
|
||||
|
|
Loading…
Reference in a new issue