summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenys Vlasenko2021-06-15 10:39:33 +0200
committerDenys Vlasenko2021-06-15 10:39:33 +0200
commite47000490c30109db1d571bcab12f385cd0139e5 (patch)
treea2cd5ab7bdc26920a8f2b20ae7d8e57c7aa8bf3c /coreutils
parent1f60d88cf6f5ad3efcad6e7ef1501ce334046e40 (diff)
downloadbusybox-e47000490c30109db1d571bcab12f385cd0139e5.zip
busybox-e47000490c30109db1d571bcab12f385cd0139e5.tar.gz
shuf: simplify check that we have at least one FILE
function old new delta .rodata 103190 103194 +4 packed_usage 33541 33537 -4 shred_main 354 337 -17 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 4/-21) Total: -17 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/shred.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/coreutils/shred.c b/coreutils/shred.c
index 8f3d9c5..69fb3e8 100644
--- a/coreutils/shred.c
+++ b/coreutils/shred.c
@@ -15,7 +15,7 @@
//kbuild:lib-$(CONFIG_SHRED) += shred.o
//usage:#define shred_trivial_usage
-//usage: "FILE..."
+//usage: "[-fuz] [-n N] FILE..."
//usage:#define shred_full_usage "\n\n"
//usage: "Overwrite/delete FILEs\n"
//usage: "\n -f Chmod to ensure writability"
@@ -54,16 +54,13 @@ int shred_main(int argc UNUSED_PARAM, char **argv)
OPT_x = (1 << 5),
};
- opt = getopt32(argv, "fuzn:+vx", &num_iter);
+ opt = getopt32(argv, "^" "fuzn:+vx" "\0" "-1"/*min 1 arg*/, &num_iter);
argv += optind;
zero_fd = xopen("/dev/zero", O_RDONLY);
if (num_iter != 0)
rand_fd = xopen("/dev/urandom", O_RDONLY);
- if (!*argv)
- bb_show_usage();
-
for (;;) {
struct stat sb;
const char *fname;