diff --git a/files/cclip b/files/cclip index e33fe0c..057ffd0 100755 --- a/files/cclip +++ b/files/cclip @@ -148,7 +148,7 @@ _read_menu() { NAME=${NAME#\"} NAME=${NAME%\'} NAME=${NAME%\"} - if [[ -e "$STORAGE/$NAME" ]]; then + if [[ -e "$STORAGE/$NAME" || -L "$STORAGE/$NAME" ]]; then NAME=$( basename "$NAME" ) _read else @@ -202,12 +202,12 @@ _read_stdout() { # name } _delete() { # name - [[ -e "$STORAGE/$1" ]] || { + [[ -e "$STORAGE/$1" || -L "$STORAGE/$1" ]] || { _msg No such clipboard exit 1 } [[ "$FORCE" -ne 1 ]] && { - read -p "Really delete $1 ? Break to cancel. " foo + read -p "Really delete '$1' ? Break to cancel. " foo } echo Deleting "$1" rm -rf "$STORAGE/$1" @@ -218,7 +218,7 @@ _delete_all() { exit 0 } [[ "$FORCE" -ne 1 ]] && { - read -p "Really delete $STORAGE ? Break to cancel. " foo + read -p "Really delete the whole clipboard? ($STORAGE) Break to cancel. " foo } rm -vrf "$STORAGE/" mkdir "$STORAGE" @@ -250,7 +250,7 @@ _get_file() { _edit() { EDITOR=${EDITOR:-vi} - [[ -d "$STORAGE/$NAME" ]] && { + [[ -f "$STORAGE/$NAME" ]] || { _msg "$NAME is a directory, can not edit" exit 1 }