diff options
author | Simon B <sburnet@hotmail.com> | 2012-05-06 15:03:32 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2012-05-06 15:03:32 +0200 |
commit | 3698ed1ca1a00c2460e3b167e4a243a4021c6f62 (patch) | |
tree | b62f44f251a74adfc848f6f263699403b44387ef | |
parent | 8c3439554aa6e9da90246955e00b69c690b52794 (diff) | |
download | busybox-w32-3698ed1ca1a00c2460e3b167e4a243a4021c6f62.tar.gz busybox-w32-3698ed1ca1a00c2460e3b167e4a243a4021c6f62.tar.bz2 busybox-w32-3698ed1ca1a00c2460e3b167e4a243a4021c6f62.zip |
mkdir,rmdir: accept and ignore -v, --verbose
function old new delta
static.rmdir_longopts 38 48 +10
mkdir_longopts 18 28 +10
Signed-off-by: Simon B <sburnet@hotmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | coreutils/mkdir.c | 3 | ||||
-rw-r--r-- | coreutils/rmdir.c | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c index b33b6bba3..4a8e43e43 100644 --- a/coreutils/mkdir.c +++ b/coreutils/mkdir.c | |||
@@ -48,6 +48,7 @@ static const char mkdir_longopts[] ALIGN1 = | |||
48 | #if ENABLE_SELINUX | 48 | #if ENABLE_SELINUX |
49 | "context\0" Required_argument "Z" | 49 | "context\0" Required_argument "Z" |
50 | #endif | 50 | #endif |
51 | "verbose\0" No_argument "v" | ||
51 | ; | 52 | ; |
52 | #endif | 53 | #endif |
53 | 54 | ||
@@ -66,7 +67,7 @@ int mkdir_main(int argc UNUSED_PARAM, char **argv) | |||
66 | #if ENABLE_FEATURE_MKDIR_LONG_OPTIONS | 67 | #if ENABLE_FEATURE_MKDIR_LONG_OPTIONS |
67 | applet_long_options = mkdir_longopts; | 68 | applet_long_options = mkdir_longopts; |
68 | #endif | 69 | #endif |
69 | opt = getopt32(argv, "m:p" IF_SELINUX("Z:"), &smode IF_SELINUX(,&scontext)); | 70 | opt = getopt32(argv, "m:p" IF_SELINUX("Z:") "v", &smode IF_SELINUX(,&scontext)); |
70 | if (opt & 1) { | 71 | if (opt & 1) { |
71 | mode_t mmode = 0777; | 72 | mode_t mmode = 0777; |
72 | if (!bb_parse_mode(smode, &mmode)) { | 73 | if (!bb_parse_mode(smode, &mmode)) { |
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c index 2840d1cfa..cc2dea010 100644 --- a/coreutils/rmdir.c +++ b/coreutils/rmdir.c | |||
@@ -30,8 +30,9 @@ | |||
30 | /* This is a NOFORK applet. Be very careful! */ | 30 | /* This is a NOFORK applet. Be very careful! */ |
31 | 31 | ||
32 | 32 | ||
33 | #define PARENTS 0x01 | 33 | #define PARENTS (1 << 0) |
34 | #define IGNORE_NON_EMPTY 0x02 | 34 | //efine VERBOSE (1 << 1) //accepted but ignored |
35 | #define IGNORE_NON_EMPTY (1 << 2) | ||
35 | 36 | ||
36 | int rmdir_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 37 | int rmdir_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
37 | int rmdir_main(int argc UNUSED_PARAM, char **argv) | 38 | int rmdir_main(int argc UNUSED_PARAM, char **argv) |
@@ -43,13 +44,14 @@ int rmdir_main(int argc UNUSED_PARAM, char **argv) | |||
43 | #if ENABLE_FEATURE_RMDIR_LONG_OPTIONS | 44 | #if ENABLE_FEATURE_RMDIR_LONG_OPTIONS |
44 | static const char rmdir_longopts[] ALIGN1 = | 45 | static const char rmdir_longopts[] ALIGN1 = |
45 | "parents\0" No_argument "p" | 46 | "parents\0" No_argument "p" |
47 | "verbose\0" No_argument "v" | ||
46 | /* Debian etch: many packages fail to be purged or installed | 48 | /* Debian etch: many packages fail to be purged or installed |
47 | * because they desperately want this option: */ | 49 | * because they desperately want this option: */ |
48 | "ignore-fail-on-non-empty\0" No_argument "\xff" | 50 | "ignore-fail-on-non-empty\0" No_argument "\xff" |
49 | ; | 51 | ; |
50 | applet_long_options = rmdir_longopts; | 52 | applet_long_options = rmdir_longopts; |
51 | #endif | 53 | #endif |
52 | flags = getopt32(argv, "p"); | 54 | flags = getopt32(argv, "pv"); |
53 | argv += optind; | 55 | argv += optind; |
54 | 56 | ||
55 | if (!*argv) { | 57 | if (!*argv) { |