From c490a6ff2b7336121428c908de1ad4ceb87f6199 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Thu, 18 Jul 2013 21:53:12 +0000 Subject: rm: output number of arguments at the interactive prompt Include the number of arguments which rm received in the "Remove all arguments?" prompt. This is useful in the, presumably, common case where the arguments were not provided by hand, but instead were the result of various shell expansions. A simple, if somewhat contrived, example (assuming rm is aliased to rm -I) could be: rm * .o where the prompt "Remove 120 arguments?" is more likely to make the user catch the problem. * src/rm.c (main): Include correctly pluralized n_files in the output message. Also remove the now redudant "all". * tests/rm/interactive-always.sh: Adjust to the new prompt. * tests/rm/interactive-once.sh: Likewise. --- tests/rm/interactive-always.sh | 4 ++-- tests/rm/interactive-once.sh | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'tests') diff --git a/tests/rm/interactive-always.sh b/tests/rm/interactive-always.sh index 1dfb5a694..13743eb49 100755 --- a/tests/rm/interactive-always.sh +++ b/tests/rm/interactive-always.sh @@ -72,13 +72,13 @@ no WHEN WHEN=never . WHEN=once -rm: remove all arguments recursively? . +rm: remove 2 arguments recursively? . WHEN=always @remove_empty 'file4-1'? @remove_empty 'file4-2'? . -f overrides --interactive . --interactive overrides -f -rm: remove all arguments recursively? . +rm: remove 1 argument recursively? . EOF compare expout out || fail=1 diff --git a/tests/rm/interactive-once.sh b/tests/rm/interactive-once.sh index d138b7520..dcda5b848 100755 --- a/tests/rm/interactive-once.sh +++ b/tests/rm/interactive-once.sh @@ -88,17 +88,17 @@ one file, no recursion three files, no recursion . four files, no recursion, answer no -rm: remove all arguments? . +rm: remove 4 arguments? . four files, no recursion, answer yes -rm: remove all arguments? . +rm: remove 4 arguments? . one file, recursion, answer no -rm: remove all arguments recursively? . +rm: remove 1 argument recursively? . one file, recursion, answer yes -rm: remove all arguments recursively? . +rm: remove 1 argument recursively? . multiple files, recursion, answer no -rm: remove all arguments recursively? . +rm: remove 2 arguments recursively? . multiple files, recursion, answer yes -rm: remove all arguments recursively? . +rm: remove 2 arguments recursively? . EOF compare expout out || fail=1 -- cgit v1.2.3-54-g00ecf