diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-22 04:17:07 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-01-22 04:17:07 +0100 |
commit | feadfe742ae9cdc8ddeb425e2b7808c2905bfccb (patch) | |
tree | bd2212b6f883caba2a6a1c3b2f52d2a7bbc6ce30 | |
parent | 94ca6943bc5266b0f3e6fc180814e184d7502442 (diff) | |
download | busybox-w32-feadfe742ae9cdc8ddeb425e2b7808c2905bfccb.tar.gz busybox-w32-feadfe742ae9cdc8ddeb425e2b7808c2905bfccb.tar.bz2 busybox-w32-feadfe742ae9cdc8ddeb425e2b7808c2905bfccb.zip |
patch: add more long opts; but remove -g for now
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | editors/patch.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/editors/patch.c b/editors/patch.c index b36980fed..69fa973a2 100644 --- a/editors/patch.c +++ b/editors/patch.c | |||
@@ -78,7 +78,10 @@ int patch_main(int argc UNUSED_PARAM, char **argv) | |||
78 | enum { | 78 | enum { |
79 | OPT_R = (1 << 2), | 79 | OPT_R = (1 << 2), |
80 | OPT_N = (1 << 3), | 80 | OPT_N = (1 << 3), |
81 | OPT_dry_run = (1 << 4) * ENABLE_LONG_OPTS, | 81 | /*OPT_f = (1 << 4), ignored */ |
82 | /*OPT_E = (1 << 5), ignored, this is the default */ | ||
83 | // /*OPT_g = (1 << x), ignored */ | ||
84 | OPT_dry_run = (1 << 6) * ENABLE_LONG_OPTS, | ||
82 | }; | 85 | }; |
83 | 86 | ||
84 | xfunc_error_retval = 2; | 87 | xfunc_error_retval = 2; |
@@ -87,16 +90,30 @@ int patch_main(int argc UNUSED_PARAM, char **argv) | |||
87 | const char *i = "-"; /* compat */ | 90 | const char *i = "-"; /* compat */ |
88 | #if ENABLE_LONG_OPTS | 91 | #if ENABLE_LONG_OPTS |
89 | static const char patch_longopts[] ALIGN1 = | 92 | static const char patch_longopts[] ALIGN1 = |
90 | "strip\0" Required_argument "p" | 93 | "strip\0" Required_argument "p" |
91 | "get\0" Required_argument "g" | 94 | "input\0" Required_argument "i" |
92 | "input\0" Required_argument "i" | 95 | "reverse\0" No_argument "R" |
93 | "reverse\0" No_argument "R" | 96 | "forward\0" No_argument "N" |
94 | "forward\0" No_argument "N" | 97 | /* "Assume user knows what [s]he is doing, do not ask any questions": */ |
95 | "dry-run\0" No_argument "\xff" | 98 | "force\0" No_argument "f" /*ignored*/ |
99 | # if ENABLE_DESKTOP | ||
100 | "remove-empty-files\0" No_argument "E" /*ignored*/ | ||
101 | /* "Controls actions when a file is under RCS or SCCS control, | ||
102 | * and does not exist or is read-only and matches the default version, | ||
103 | * or when a file is under ClearCase control and does not exist..." | ||
104 | * IOW: does anyone really wants this? */ | ||
105 | // "get\0" Required_argument "g" /*ignored*/ | ||
106 | # endif | ||
107 | "dry-run\0" No_argument "\xfd" | ||
108 | # if ENABLE_DESKTOP | ||
109 | "backup-if-mismatch\0" No_argument "\xfe" /*ignored*/ | ||
110 | "no-backup-if-mismatch\0" No_argument "\xff" /*ignored*/ | ||
111 | # endif | ||
96 | ; | 112 | ; |
97 | applet_long_options = patch_longopts; | 113 | applet_long_options = patch_longopts; |
98 | #endif | 114 | #endif |
99 | opt = getopt32(argv, "p:i:RNg:", &p, &i, NULL); | 115 | /* -f,-E are ignored */ |
116 | opt = getopt32(argv, "p:i:RN""fE"/*"g:"*/, &p, &i /*,NULL*/); | ||
100 | if (opt & OPT_R) | 117 | if (opt & OPT_R) |
101 | plus = '-'; | 118 | plus = '-'; |
102 | patch_level = xatoi(p); /* can be negative! */ | 119 | patch_level = xatoi(p); /* can be negative! */ |