[git commit] mkdir,rmdir: accept and ignore -v, --verbose

Denys Vlasenko vda.linux at googlemail.com
Sun May 6 13:03:32 UTC 2012


commit: http://git.busybox.net/busybox/commit/?id=3698ed1ca1a00c2460e3b167e4a243a4021c6f62
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

function                                             old     new   delta
static.rmdir_longopts                                 38      48     +10
mkdir_longopts                                        18      28     +10

Signed-off-by: Simon B <sburnet at hotmail.com>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 coreutils/mkdir.c |    3 ++-
 coreutils/rmdir.c |    8 +++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c
index b33b6bb..4a8e43e 100644
--- a/coreutils/mkdir.c
+++ b/coreutils/mkdir.c
@@ -48,6 +48,7 @@ static const char mkdir_longopts[] ALIGN1 =
 #if ENABLE_SELINUX
 	"context\0" Required_argument "Z"
 #endif
+	"verbose\0" No_argument       "v"
 	;
 #endif
 
@@ -66,7 +67,7 @@ int mkdir_main(int argc UNUSED_PARAM, char **argv)
 #if ENABLE_FEATURE_MKDIR_LONG_OPTIONS
 	applet_long_options = mkdir_longopts;
 #endif
-	opt = getopt32(argv, "m:p" IF_SELINUX("Z:"), &smode IF_SELINUX(,&scontext));
+	opt = getopt32(argv, "m:p" IF_SELINUX("Z:") "v", &smode IF_SELINUX(,&scontext));
 	if (opt & 1) {
 		mode_t mmode = 0777;
 		if (!bb_parse_mode(smode, &mmode)) {
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c
index 2840d1c..cc2dea0 100644
--- a/coreutils/rmdir.c
+++ b/coreutils/rmdir.c
@@ -30,8 +30,9 @@
 /* This is a NOFORK applet. Be very careful! */
 
 
-#define PARENTS 0x01
-#define IGNORE_NON_EMPTY 0x02
+#define PARENTS          (1 << 0)
+//efine VERBOSE          (1 << 1) //accepted but ignored
+#define IGNORE_NON_EMPTY (1 << 2)
 
 int rmdir_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
 int rmdir_main(int argc UNUSED_PARAM, char **argv)
@@ -43,13 +44,14 @@ int rmdir_main(int argc UNUSED_PARAM, char **argv)
 #if ENABLE_FEATURE_RMDIR_LONG_OPTIONS
 	static const char rmdir_longopts[] ALIGN1 =
 		"parents\0"                  No_argument "p"
+		"verbose\0"                  No_argument "v"
 		/* Debian etch: many packages fail to be purged or installed
 		 * because they desperately want this option: */
 		"ignore-fail-on-non-empty\0" No_argument "\xff"
 		;
 	applet_long_options = rmdir_longopts;
 #endif
-	flags = getopt32(argv, "p");
+	flags = getopt32(argv, "pv");
 	argv += optind;
 
 	if (!*argv) {


More information about the busybox-cvs mailing list