aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar KlzXS <klzx+github@klzx.cf>2020-11-08 12:20:36 +0000
committerGravatar KlzXS <klzx+github@klzx.cf>2020-11-08 12:20:36 +0000
commit49936d1ca23c56ad6bbf1e43d701f5f3efd575b5 (patch)
treea7b0eb56c6f7a0acdcf46e047858630ef3962811
parent81953dd57160da91e7f8537086da8e21524b97a6 (diff)
downloadnnn-49936d1ca23c56ad6bbf1e43d701f5f3efd575b5.tar.gz
Clear up which files are removed
-rwxr-xr-xplugins/dups11
1 files changed, 4 insertions, 7 deletions
diff --git a/plugins/dups b/plugins/dups
index a3b1c5d..1cba8a8 100755
--- a/plugins/dups
+++ b/plugins/dups
@@ -22,10 +22,9 @@ tmpfile=$(mktemp "$TMPDIR/.nnnXXXXXX")
printf "\
## This is an overview of all duplicate files found.
-## After editiing this file you will be prompted to remove some of them.
-## You can choose between removing all the commented out files, all the uncommented ones or none at all.
-## Lines with double comments (##) are always ignored.
-## If you choose to remove, you will be given a choice between removing with force or interactively for each file.\n
+## Comment out the files you wish to remove. You will be given an option to cancel.
+## Lines with double comments (##) are ignored.
+## If you choose to remove, you will be given a choice between removing files with force or interactively.\n
" > "$tmpfile"
# shellcheck disable=SC2016
@@ -43,13 +42,11 @@ p' | sed -E 's/^.{32} (.*) d[0-9]*$/\1/' >> "$tmpfile"
"$EDITOR" "$tmpfile"
-printf "Remove commented files? (yes/no/abort) [default=a]: "
+printf "Remove commented files? (yes/no) [default=n]: "
read -r commented
if [ "$commented" = "y" ]; then
sedcmd="/^(##|[^#]).*/d; /^$/d; s/^# *(.*)$/\1/"
-elif [ "$commented" = "n" ]; then
- sedcmd="/^#.*/d; /^$/d; s/^ *(.*)$/\1/"
else
printf "Press any key to exit"
read -r _