aboutsummaryrefslogtreecommitdiff
path: root/archival/cpio.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-09 19:56:15 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-09 19:56:15 +0100
commit93ac7d8468feec562b468e87e1e04b0afdec0951 (patch)
treefa45240bf23cdf232f4b76b2d1321d4b29fff146 /archival/cpio.c
parentdc698bb038756a926aaa529bda1b939eab2c1676 (diff)
downloadbusybox-w32-93ac7d8468feec562b468e87e1e04b0afdec0951.tar.gz
busybox-w32-93ac7d8468feec562b468e87e1e04b0afdec0951.tar.bz2
busybox-w32-93ac7d8468feec562b468e87e1e04b0afdec0951.zip
cpio: improve help text; document two TODOs
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/cpio.c')
-rw-r--r--archival/cpio.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/archival/cpio.c b/archival/cpio.c
index b21ba6e79..be9fbd0b5 100644
--- a/archival/cpio.c
+++ b/archival/cpio.c
@@ -304,8 +304,12 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
304 /* -L makes sense only with -o or -p */ 304 /* -L makes sense only with -o or -p */
305 305
306#if !ENABLE_FEATURE_CPIO_O 306#if !ENABLE_FEATURE_CPIO_O
307 /* no parameters */
308 opt_complementary = "=0";
307 opt = getopt32(argv, OPTION_STR, &cpio_filename); 309 opt = getopt32(argv, OPTION_STR, &cpio_filename);
308#else 310#else
311 /* _exactly_ one parameter for -p, thus <= 1 param if -p is allowed */
312 opt_complementary = ENABLE_FEATURE_CPIO_P ? "?1" : "=0";
309 opt = getopt32(argv, OPTION_STR "oH:" IF_FEATURE_CPIO_P("p"), &cpio_filename, &cpio_fmt); 313 opt = getopt32(argv, OPTION_STR "oH:" IF_FEATURE_CPIO_P("p"), &cpio_filename, &cpio_fmt);
310 argv += optind; 314 argv += optind;
311 if (opt & CPIO_OPT_PASSTHROUGH) { 315 if (opt & CPIO_OPT_PASSTHROUGH) {
@@ -346,13 +350,13 @@ int cpio_main(int argc UNUSED_PARAM, char **argv)
346 xchdir(*argv++); 350 xchdir(*argv++);
347 close(pp.wr); 351 close(pp.wr);
348 xmove_fd(pp.rd, STDIN_FILENO); 352 xmove_fd(pp.rd, STDIN_FILENO);
349 opt &= ~CPIO_OPT_PASSTHROUGH; 353 //opt &= ~CPIO_OPT_PASSTHROUGH;
350 opt |= CPIO_OPT_EXTRACT; 354 opt |= CPIO_OPT_EXTRACT;
351 goto skip; 355 goto skip;
352 } 356 }
353 /* -o */ 357 /* -o */
354 if (opt & CPIO_OPT_CREATE) { 358 if (opt & CPIO_OPT_CREATE) {
355 if (*cpio_fmt != 'n') /* we _require_ "-H newc" */ 359 if (cpio_fmt[0] != 'n') /* we _require_ "-H newc" */
356 bb_show_usage(); 360 bb_show_usage();
357 if (opt & CPIO_OPT_FILE) { 361 if (opt & CPIO_OPT_FILE) {
358 xmove_fd(xopen3(cpio_filename, O_WRONLY | O_CREAT | O_TRUNC, 0666), STDOUT_FILENO); 362 xmove_fd(xopen3(cpio_filename, O_WRONLY | O_CREAT | O_TRUNC, 0666), STDOUT_FILENO);