summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsrc/password-store.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index f642a03..5e168c1 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -349,13 +349,13 @@ case "$command" in
;;
delete|rm|remove)
recursive=""
- force="-i"
+ force=0
opts="$($GETOPT -o rf -l recursive,force -n "$program" -- "$@")"
err=$?
eval set -- "$opts"
while true; do case $1 in
-r|--recursive) recursive="-r"; shift ;;
- -f|--force) force="-f"; shift ;;
+ -f|--force) force=1; shift ;;
--) shift; break ;;
esac done
if [[ $# -ne 1 ]]; then
@@ -364,7 +364,7 @@ case "$command" in
fi
path="$1"
- passfile="$PREFIX/$path"
+ passfile="$PREFIX/${path%/}"
if ! [[ -d $passfile ]]; then
passfile="$PREFIX/$path.gpg"
if ! [[ -f $passfile ]]; then
@@ -372,9 +372,12 @@ case "$command" in
exit 1
fi
fi
- rm $recursive $force -v "$passfile"
+
+ [[ $force -eq 1 ]] || yesno "Are you sure you would like to delete $path?"
+
+ rm $recursive -f -v "$passfile"
if [[ -d $GIT_DIR && ! -e $passfile ]]; then
- git rm -r "$passfile"
+ git rm -qr "$passfile"
git commit -m "Removed $path from store."
fi
;;
-0/+8 2012-09-06Change debian name.Jason A. Donenfeld5-5/+4 2012-09-06Use more normal sleep variant.1.1.1Jason A. Donenfeld1-1/+1 2012-09-06Use --noreport instead of head -n -2 for tree so that it works on mac.Jason A. Donenfeld1-1/+1 Reported-by: Theo Belaire <tbelaire@uwaterloo.ca> 2012-09-05Be sure to explicitly state that install is a phony target.Jason A. Donenfeld1-0/+2 2012-09-05Bump debian version horribly.1.1Jason A. Donenfeld2-2/+2 2012-09-04No echo mode.Jason A. Donenfeld2-16/+42 Add a --no-echo flag to the insert operation so that the password isn't echoed when entering it. This requires the user to echo the password twice for confirmation. Reported-by: Dominic Lüchinger <d.luechinger@snowgarden.ch> 2012-09-04Properly quote the path too.Jason A. Donenfeld1-1/+1 2012-09-04Allow passwords having spaces to go unbroken to the clipboard.Bernardo Freitas Paulo da Costa1-1/+1 This also prevents showing the second <word> of the password in the prompt. 2012-09-04Separate out the massive git example.Jason A. Donenfeld1-10/+14 2012-09-04Prepare for debianification.1.0Jason A. Donenfeld9-4/+60 2012-09-03Fix readme typo.Jason A. Donenfeld1-1/+1 2012-09-03Show program name properly in error message.Jason A. Donenfeld1-1/+1 2012-09-03Move examples into manpage.Jason A. Donenfeld4-93/+224 2012-09-03Make into a real project.Jason A. Donenfeld8-5/+173 2012-09-03Support pass gitJason A. Donenfeld2-1/+15 2012-08-31Add remove synonyms.Jason A. Donenfeld1-2/+2 2012-08-31Use basename in usage.Jason A. Donenfeld1-2/+1 2012-08-19now using gpg_id as a varMatthew Ramirez1-2/+2 2012-08-07Forty five seconds.Jason A. Donenfeld1-1/+1 2012-08-06Deal with klipper and new lines.Jason A. Donenfeld1-3/+19 2012-08-06Update examples.Jason A. Donenfeld1-7/+7 2012-08-06Update readme.Jason A. Donenfeld1-11/+13 2012-08-06Be slicker and more like git.Jason A. Donenfeld1-114/+173