This patch, put together by Manuel Novoa III, is a merge of work

done by Evin Robertson (bug#1105) and work from Manuel to make
usage messages occupy less space and simplify how usage messages
are displayed.
This commit is contained in:
Eric Andersen
2001-02-14 21:23:06 +00:00
parent 68be2ab914
commit 67991cf824
198 changed files with 702 additions and 3979 deletions

View File

@@ -163,13 +163,13 @@ extern int ar_main(int argc, char **argv)
funct |= extract_to_file;
break;
default:
usage(ar_usage);
show_usage();
}
}
/* check the src filename was specified */
if (optind == argc)
usage(ar_usage);
show_usage();
if ( (srcFd = open(argv[optind], O_RDONLY)) < 0)
error_msg_and_die("Cannot read %s", argv[optind]);

View File

@@ -840,7 +840,7 @@ extern int dpkg_main(int argc, char **argv)
case 'c':
return dpkg_configure(packages, status);
default :
usage(dpkg_usage);
show_usage();
return EXIT_FAILURE;
}
}
}

View File

@@ -141,14 +141,12 @@ extern int dpkg_deb_main(int argc, char **argv)
break;
*/
default:
usage(dpkg_deb_usage);
return EXIT_FAILURE;
show_usage();
}
}
if (((optind + 1 ) > argc) || (optflag == 0)) {
usage(dpkg_deb_usage);
return(EXIT_FAILURE);
show_usage();
}
if ((optflag & dpkg_deb_control) || (optflag & dpkg_deb_extract) || (optflag & dpkg_deb_verbose_extract)) {
if ( (optind + 1) == argc ) {

View File

@@ -1250,7 +1250,7 @@ int gunzip_main(int argc, char **argv)
force = 1;
break;
default:
usage(gunzip_usage);
show_usage();
}
}
}
@@ -1275,7 +1275,7 @@ int gunzip_main(int argc, char **argv)
} else {
/* Open up the input file */
if (argc <= 0)
usage(gunzip_usage);
show_usage();
if (strlen(*argv) > MAX_PATH_LEN) {
error_msg(name_too_long);
exit(WARNING);

View File

@@ -1812,7 +1812,7 @@ int gzip_main(int argc, char **argv)
case 'd':
exit(gunzip_main(argc, argv));
default:
usage(gzip_usage);
show_usage();
}
}
}
@@ -1865,7 +1865,7 @@ int gzip_main(int argc, char **argv)
} else {
/* Open up the input file */
if (argc <= 0)
usage(gzip_usage);
show_usage();
strncpy(ifname, *argv, MAX_PATH_LEN);
/* Open input file */

View File

@@ -214,7 +214,7 @@ extern int tar_main(int argc, char **argv)
int opt;
if (argc <= 1)
usage(tar_usage);
show_usage();
if (argv[1][0] != '-') {
char *tmp = xmalloc(strlen(argv[1]) + 2);
@@ -283,7 +283,7 @@ extern int tar_main(int argc, char **argv)
break;
#endif
default:
usage(tar_usage);
show_usage();
}
}