From e954e37fbf92720533f59901513ce50e375c8abf Mon Sep 17 00:00:00 2001 From: "makepost@firemail.cc" Date: Mon, 25 Mar 2019 23:29:12 -0500 Subject: Add rm -v. Gentoo removes verbosely when building packages, for example vim-core: https://github.com/gentoo/gentoo/blob/665eaa8/app-editors/vim-core/vim-core-8.1.0648.ebuild#L120 Implement like toy cp, without prepending an escape sign to quotation marks in filenames. Document in a test this difference from coreutils but similarity to busybox. How do other implementations handle such escapes? If it matters, would you approach it with a loop and multiple prints or somehow else? Short help description follows 141a075, consistent with other commands. --- tests/rm.test | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/rm.test') diff --git a/tests/rm.test b/tests/rm.test index 95710c82..42727442 100755 --- a/tests/rm.test +++ b/tests/rm.test @@ -48,3 +48,13 @@ mkdir -p one && touch one/two && chmod 000 one SKIP_HOST=1 testing "-rf 000 dir" \ "rm -rf one 2>/dev/null && [ ! -e one ] && echo yes" "yes\n" "" "" chmod 777 one 2>/dev/null ; rm -rf one + +mkdir -p d1 +touch d1/f1.txt d1/f2.txt +testing "-rv dir" \ + "rm -rv d1" "rm 'd1/f1.txt'\nrm 'd1/f2.txt'\nrmdir 'd1'\n" "" "" +rm -rf d1 + +touch "'" +testing "-v \\'" "rm -v \\'" "rm '''\n" "" "" # TODO: coreutils escapes quote +rm -f \' -- cgit v1.2.3