aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/cut.c2
-rw-r--r--coreutils/date.c4
-rw-r--r--coreutils/df.c2
-rw-r--r--coreutils/du.c4
-rw-r--r--coreutils/env.c2
-rw-r--r--coreutils/id.c5
-rw-r--r--coreutils/install.c7
-rw-r--r--coreutils/mv.c2
-rw-r--r--coreutils/rm.c2
9 files changed, 11 insertions, 19 deletions
diff --git a/coreutils/cut.c b/coreutils/cut.c
index e5fb5aff7..f65754e63 100644
--- a/coreutils/cut.c
+++ b/coreutils/cut.c
@@ -295,7 +295,7 @@ extern int cut_main(int argc, char **argv)
295 unsigned long opt; 295 unsigned long opt;
296 char *sopt, *sdopt; 296 char *sopt, *sdopt;
297 297
298 bb_opt_complementaly = "b~bcf:c~bcf:f~bcf"; 298 bb_opt_complementally = "b~bcf:c~bcf:f~bcf";
299 opt = bb_getopt_ulflags(argc, argv, optstring, &sopt, &sopt, &sopt, &sdopt); 299 opt = bb_getopt_ulflags(argc, argv, optstring, &sopt, &sopt, &sopt, &sdopt);
300 part = opt & (OPT_BYTE_FLGS|OPT_CHAR_FLGS|OPT_FIELDS_FLGS); 300 part = opt & (OPT_BYTE_FLGS|OPT_CHAR_FLGS|OPT_FIELDS_FLGS);
301 if(part == 0) 301 if(part == 0)
diff --git a/coreutils/date.c b/coreutils/date.c
index 70484e2cd..0488b2de3 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -152,7 +152,7 @@ int date_main(int argc, char **argv)
152#else 152#else
153# define GETOPT_ISOFMT 153# define GETOPT_ISOFMT
154#endif 154#endif
155 bb_opt_complementaly = "d~ds:s~ds"; 155 bb_opt_complementally = "!d~ds:s~ds";
156 opt = bb_getopt_ulflags(argc, argv, "Rs:ud:r:" GETOPT_ISOFMT, 156 opt = bb_getopt_ulflags(argc, argv, "Rs:ud:r:" GETOPT_ISOFMT,
157 &date_str, &date_str, &filename 157 &date_str, &date_str, &filename
158#ifdef CONFIG_FEATURE_DATE_ISOFMT 158#ifdef CONFIG_FEATURE_DATE_ISOFMT
@@ -165,8 +165,6 @@ int date_main(int argc, char **argv)
165 bb_error_msg_and_die(bb_msg_memory_exhausted); 165 bb_error_msg_and_die(bb_msg_memory_exhausted);
166 } 166 }
167 use_arg = opt & DATE_OPT_DATE; 167 use_arg = opt & DATE_OPT_DATE;
168 if(opt & BB_GETOPT_ERROR)
169 bb_show_usage();
170#ifdef CONFIG_FEATURE_DATE_ISOFMT 168#ifdef CONFIG_FEATURE_DATE_ISOFMT
171 if(opt & DATE_OPT_TIMESPEC) { 169 if(opt & DATE_OPT_TIMESPEC) {
172 if (!isofmt_arg) { 170 if (!isofmt_arg) {
diff --git a/coreutils/df.c b/coreutils/df.c
index 9233fbbf1..51d3cc632 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -62,7 +62,7 @@ extern int df_main(int argc, char **argv)
62 const char *disp_units_hdr = hdr_1k; 62 const char *disp_units_hdr = hdr_1k;
63 63
64#ifdef CONFIG_FEATURE_HUMAN_READABLE 64#ifdef CONFIG_FEATURE_HUMAN_READABLE
65 bb_opt_complementaly = "h-km:k-hm:m-hk"; 65 bb_opt_complementally = "h-km:k-hm:m-hk";
66 opt = bb_getopt_ulflags(argc, argv, "hmk"); 66 opt = bb_getopt_ulflags(argc, argv, "hmk");
67 if(opt & 1) { 67 if(opt & 1) {
68 df_disp_hr = 0; 68 df_disp_hr = 0;
diff --git a/coreutils/du.c b/coreutils/du.c
index bfa44034a..3778f0895 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -191,7 +191,7 @@ int du_main(int argc, char **argv)
191 * ignore -a. This is consistent with -s being equivalent to -d 0. 191 * ignore -a. This is consistent with -s being equivalent to -d 0.
192 */ 192 */
193#ifdef CONFIG_FEATURE_HUMAN_READABLE 193#ifdef CONFIG_FEATURE_HUMAN_READABLE
194 bb_opt_complementaly = "h-km:k-hm:m-hk:H-L:L-H:s-d:d-s"; 194 bb_opt_complementally = "h-km:k-hm:m-hk:H-L:L-H:s-d:d-s";
195 opt = bb_getopt_ulflags(argc, argv, "aHkLsx" "d:" "lc" "hm", &smax_print_depth); 195 opt = bb_getopt_ulflags(argc, argv, "aHkLsx" "d:" "lc" "hm", &smax_print_depth);
196 if((opt & (1 << 9))) { 196 if((opt & (1 << 9))) {
197 /* -h opt */ 197 /* -h opt */
@@ -206,7 +206,7 @@ int du_main(int argc, char **argv)
206 disp_hr = KILOBYTE; 206 disp_hr = KILOBYTE;
207 } 207 }
208#else 208#else
209 bb_opt_complementaly = "H-L:L-H:s-d:d-s"; 209 bb_opt_complementally = "H-L:L-H:s-d:d-s";
210 opt = bb_getopt_ulflags(argc, argv, "aHkLsx" "d:" "lc", &smax_print_depth); 210 opt = bb_getopt_ulflags(argc, argv, "aHkLsx" "d:" "lc", &smax_print_depth);
211#if !defined CONFIG_FEATURE_DU_DEFALT_BLOCKSIZE_1K 211#if !defined CONFIG_FEATURE_DU_DEFALT_BLOCKSIZE_1K
212 if((opt & (1 << 2))) { 212 if((opt & (1 << 2))) {
diff --git a/coreutils/env.c b/coreutils/env.c
index 87ab30cdd..70cef6588 100644
--- a/coreutils/env.c
+++ b/coreutils/env.c
@@ -65,7 +65,7 @@ extern int env_main(int argc, char** argv)
65 llist_t *unset_env = NULL; 65 llist_t *unset_env = NULL;
66 extern char **environ; 66 extern char **environ;
67 67
68 bb_opt_complementaly = "u*"; 68 bb_opt_complementally = "u*";
69 bb_applet_long_options = env_long_options; 69 bb_applet_long_options = env_long_options;
70 70
71 opt = bb_getopt_ulflags(argc, argv, "+iu:", &unset_env); 71 opt = bb_getopt_ulflags(argc, argv, "+iu:", &unset_env);
diff --git a/coreutils/id.c b/coreutils/id.c
index 636049168..03c6a6d2a 100644
--- a/coreutils/id.c
+++ b/coreutils/id.c
@@ -61,12 +61,11 @@ extern int id_main(int argc, char **argv)
61 unsigned long flags; 61 unsigned long flags;
62 short status; 62 short status;
63 63
64 bb_opt_complementaly = "u~g:g~u"; 64 bb_opt_complementally = "!u~g:g~u";
65 flags = bb_getopt_ulflags(argc, argv, "rnug"); 65 flags = bb_getopt_ulflags(argc, argv, "rnug");
66 66
67 if ((flags & BB_GETOPT_ERROR)
68 /* Don't allow -n -r -nr */ 67 /* Don't allow -n -r -nr */
69 || (flags <= 3 && flags > 0) 68 if ((flags <= 3 && flags > 0)
70 /* Don't allow more than one username */ 69 /* Don't allow more than one username */
71 || (argc > optind + 1)) 70 || (argc > optind + 1))
72 bb_show_usage(); 71 bb_show_usage();
diff --git a/coreutils/install.c b/coreutils/install.c
index 345e75af0..e22dda6f9 100644
--- a/coreutils/install.c
+++ b/coreutils/install.c
@@ -64,15 +64,10 @@ extern int install_main(int argc, char **argv)
64 int i; 64 int i;
65 65
66 bb_applet_long_options = install_long_options; 66 bb_applet_long_options = install_long_options;
67 bb_opt_complementaly = "s~d:d~s"; 67 bb_opt_complementally = "!s~d:d~s";
68 /* -c exists for backwards compatability, its needed */ 68 /* -c exists for backwards compatability, its needed */
69 flags = bb_getopt_ulflags(argc, argv, "cdpsg:m:o:", &gid_str, &mode_str, &uid_str); /* 'a' must be 2nd */ 69 flags = bb_getopt_ulflags(argc, argv, "cdpsg:m:o:", &gid_str, &mode_str, &uid_str); /* 'a' must be 2nd */
70 70
71 /* Check valid options were given */
72 if(flags & BB_GETOPT_ERROR) {
73 bb_show_usage();
74 }
75
76 /* preserve access and modification time, this is GNU behaviour, BSD only preserves modification time */ 71 /* preserve access and modification time, this is GNU behaviour, BSD only preserves modification time */
77 if (flags & INSTALL_OPT_PRESERVE_TIME) { 72 if (flags & INSTALL_OPT_PRESERVE_TIME) {
78 copy_flags |= FILEUTILS_PRESERVE_STATUS; 73 copy_flags |= FILEUTILS_PRESERVE_STATUS;
diff --git a/coreutils/mv.c b/coreutils/mv.c
index e1c4529ad..43a8e6d7d 100644
--- a/coreutils/mv.c
+++ b/coreutils/mv.c
@@ -56,7 +56,7 @@ extern int mv_main(int argc, char **argv)
56 int status = 0; 56 int status = 0;
57 57
58 bb_applet_long_options = mv_long_options; 58 bb_applet_long_options = mv_long_options;
59 bb_opt_complementaly = "f-i:i-f"; 59 bb_opt_complementally = "f-i:i-f";
60 flags = bb_getopt_ulflags(argc, argv, "fi"); 60 flags = bb_getopt_ulflags(argc, argv, "fi");
61 if (optind + 2 > argc) { 61 if (optind + 2 > argc) {
62 bb_show_usage(); 62 bb_show_usage();
diff --git a/coreutils/rm.c b/coreutils/rm.c
index 39609e7b8..e4e9bb0be 100644
--- a/coreutils/rm.c
+++ b/coreutils/rm.c
@@ -38,7 +38,7 @@ extern int rm_main(int argc, char **argv)
38 int flags = 0; 38 int flags = 0;
39 unsigned long opt; 39 unsigned long opt;
40 40
41 bb_opt_complementaly = "f-i:i-f"; 41 bb_opt_complementally = "f-i:i-f";
42 opt = bb_getopt_ulflags(argc, argv, "fiRr"); 42 opt = bb_getopt_ulflags(argc, argv, "fiRr");
43 if(opt & 1) 43 if(opt & 1)
44 flags |= FILEUTILS_FORCE; 44 flags |= FILEUTILS_FORCE;