Before:

  $ ./rm
  rm: Needs 1 argument
  $ ./rmdir
  rmdir: Needs 1 argument (see "rmdir --help")

After:

  $ ./rm
  rm: Needs 1 argument (see "rm --help")
---
 toys/posix/rm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
From 4f692fbea1d683733c5f9b60410eb58ebf0bf281 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <[email protected]>
Date: Thu, 22 Aug 2019 12:55:42 -0700
Subject: [PATCH] rm: error message consistency.

Before:

  $ ./rm
  rm: Needs 1 argument
  $ ./rmdir
  rmdir: Needs 1 argument (see "rmdir --help")

After:

  $ ./rm
  rm: Needs 1 argument (see "rm --help")
---
 toys/posix/rm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toys/posix/rm.c b/toys/posix/rm.c
index 6c64e13f..5d5cb604 100644
--- a/toys/posix/rm.c
+++ b/toys/posix/rm.c
@@ -89,7 +89,7 @@ void rm_main(void)
   char **s;
 
   // Can't use <1 in optstring because zero arguments with -f isn't an error
-  if (!toys.optc && !(toys.optflags & FLAG_f)) error_exit("Needs 1 argument");
+  if (!toys.optc && !(toys.optflags & FLAG_f)) help_exit("Needs 1 argument");
 
   for (s = toys.optargs; *s; s++) {
     if (!strcmp(*s, "/")) {
-- 
2.23.0.187.g17f5b7556c-goog

_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to