coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] rm: Add number of arguments to interactive prompt


From: Rasmus Villemoes
Subject: [PATCH] rm: Add number of arguments to interactive prompt
Date: Thu, 18 Jul 2013 21:53:12 +0000

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 all 120 arguments?" is more likely to make
the user catch the problem.
---
 src/rm.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/rm.c b/src/rm.c
index 3e187cf..a7d7357 100644
--- a/src/rm.c
+++ b/src/rm.c
@@ -339,9 +339,9 @@ main (int argc, char **argv)
     {
       fprintf (stderr,
                (x.recursive
-                ? _("%s: remove all arguments recursively? ")
-                : _("%s: remove all arguments? ")),
-               program_name);
+                ? _("%s: remove all %zu arguments recursively? ")
+                : _("%s: remove all %zu arguments? ")),
+              program_name, n_files);
       if (!yesno ())
         exit (EXIT_SUCCESS);
     }
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]