Lots of updates. Finished implementing BB_FEATURE_TRIVIAL_HELP

which lets you compile out most of the "--help" output, saving
up to 17k.

Renamed mnc to nc.
 -Erik
This commit is contained in:
Erik Andersen
2000-05-12 19:41:47 +00:00
parent 3d427ac5ef
commit 7ab9c7ee52
136 changed files with 1743 additions and 454 deletions

View File

@ -105,9 +105,9 @@ struct cmdoptions_t {
"-vsync", 1, CMD_VSYNC}, {
"-laced", 1, CMD_LACED}, {
"-double", 1, CMD_DOUBLE}, {
"--help", 0, CMD_HELP}, {
"-help", 0, CMD_HELP}, {
#ifdef BB_FEATURE_FBSET_FANCY
"--help", 0, CMD_HELP}, {
"-help", 0, CMD_HELP}, {
"-all", 0, CMD_ALL}, {
"-xres", 1, CMD_XRES}, {
"-yres", 1, CMD_YRES}, {
@ -115,7 +115,7 @@ struct cmdoptions_t {
"-vyres", 1, CMD_VYRES}, {
"-depth", 1, CMD_DEPTH}, {
"-match", 0, CMD_MATCH}, {
"--geometry", 5, CMD_GEOMETRY}, {
"-geometry", 5, CMD_GEOMETRY}, {
"-pixclock", 1, CMD_PIXCLOCK}, {
"-left", 1, CMD_LEFT}, {
"-right", 1, CMD_RIGHT}, {
@ -123,7 +123,7 @@ struct cmdoptions_t {
"-lower", 1, CMD_LOWER}, {
"-hslen", 1, CMD_HSLEN}, {
"-vslen", 1, CMD_VSLEN}, {
"--timings", 7, CMD_TIMING}, {
"-timings", 7, CMD_TIMING}, {
"-csync", 1, CMD_CSYNC}, {
"-gsync", 1, CMD_GSYNC}, {
"-extsync", 1, CMD_EXTSYNC}, {
@ -221,17 +221,21 @@ static void showmode(struct fb_var_screeninfo *v)
static void fbset_usage(void)
{
#ifndef BB_FEATURE_TRIVIAL_HELP
int i;
#endif
#ifndef STANDALONE
fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n",
BB_VER, BB_BT);
#endif
fprintf(stderr, "Usage: fbset [options] [mode]\n\n");
fprintf(stderr, "Show and modify frame buffer device settings\n\n");
fprintf(stderr, "Usage: fbset [options] [mode]\n");
#ifndef BB_FEATURE_TRIVIAL_HELP
fprintf(stderr, "\nShows and modifies frame buffer device settings\n\n");
fprintf(stderr, "The following options are recognized:\n");
for (i = 0; g_cmdoptions[i].name; i++)
fprintf(stderr, "\t%s\n", g_cmdoptions[i].name);
#endif
exit(-1);
}

View File

@ -34,7 +34,11 @@ extern int fdflush_main(int argc, char **argv)
int fd;
if (argc <= 1 || **(++argv) == '-') {
usage("fdflush device\n\nForce floppy disk drive to detect disk change\n");
usage("fdflush DEVICE\n"
#ifndef BB_FEATURE_TRIVIAL_HELP
"\nForces floppy disk drive to detect disk change\n"
#endif
);
}
fd = open(*argv, 0);

View File

@ -34,8 +34,11 @@
static const char freeramdisk_usage[] =
"freeramdisk DEVICE\n\n"
"Free all memory used by the specified ramdisk.\n";
"freeramdisk DEVICE\n"
#ifndef BB_FEATURE_TRIVIAL_HELP
"\nFrees all memory used by the specified ramdisk.\n"
#endif
;
extern int
freeramdisk_main(int argc, char **argv)

View File

@ -198,9 +198,10 @@ static void show_usage(void)
{
fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n",
BB_VER, BB_BT);
fprintf(stderr, "Usage: %s [-larvsmf] /dev/name\n\n", program_name);
fprintf(stderr, "Usage: %s [-larvsmf] /dev/name\n", program_name);
#ifndef BB_FEATURE_TRIVIAL_HELP
fprintf(stderr,
"Performs a consistency check for MINIX filesystems.\n\n");
"\nPerforms a consistency check for MINIX filesystems.\n\n");
fprintf(stderr, "OPTIONS:\n");
fprintf(stderr, "\t-l\tLists all filenames\n");
fprintf(stderr, "\t-r\tPerform interactive repairs\n");
@ -210,6 +211,7 @@ static void show_usage(void)
fprintf(stderr,
"\t-m\tActivates MINIX-like \"mode not cleared\" warnings\n");
fprintf(stderr, "\t-f\tForce file system check.\n\n");
#endif
leave(16);
}

View File

@ -179,9 +179,10 @@ static volatile void show_usage()
fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n",
BB_VER, BB_BT);
fprintf(stderr,
"Usage: %s [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]\n\n",
"Usage: %s [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]\n",
program_name);
fprintf(stderr, "Make a MINIX filesystem.\n\n");
#ifndef BB_FEATURE_TRIVIAL_HELP
fprintf(stderr, "\nMake a MINIX filesystem.\n\n");
fprintf(stderr, "OPTIONS:\n");
fprintf(stderr, "\t-c\t\tCheck the device for bad blocks\n");
fprintf(stderr,
@ -191,6 +192,7 @@ static volatile void show_usage()
fprintf(stderr,
"\t-l FILENAME\tRead the bad blocks list from FILENAME\n");
fprintf(stderr, "\t-v\t\tMake a Minix version 2 filesystem\n\n");
#endif
exit(16);
}

View File

@ -49,13 +49,16 @@
static const char mkswap_usage[] =
"mkswap [-c] [-v0|-v1] device [block-count]\n\n"
"Prepare a disk partition to be used as a swap partition.\n\n"
"mkswap [-c] [-v0|-v1] device [block-count]\n"
#ifndef BB_FEATURE_TRIVIAL_HELP
"\nPrepare a disk partition to be used as a swap partition.\n\n"
"Options:\n" "\t-c\t\tCheck for read-ability.\n"
"\t-v0\t\tMake version 0 swap [max 128 Megs].\n"
"\t-v1\t\tMake version 1 swap [big!] (default for kernels > 2.1.117).\n"
"\tblock-count\tNumber of block to use (default is entire partition).\n";
"\tblock-count\tNumber of block to use (default is entire partition).\n"
#endif
;
#ifndef _IO

View File

@ -30,8 +30,15 @@
#include <fcntl.h>
#include <signal.h>
#include <sys/ioctl.h>
#define BB_DECLARE_EXTERN
#define bb_need_help
#include "messages.c"
static const char more_usage[] = "more [file ...]\n";
static const char more_usage[] = "more [FILE ...]\n"
#ifndef BB_FEATURE_TRIVIAL_HELP
"\nMore is a filter for viewing FILE one screenful at a time.\n"
#endif
;
/* ED: sparc termios is broken: revert back to old termio handling. */
#ifdef BB_FEATURE_USE_TERMIOS
@ -92,7 +99,7 @@ extern int more_main(int argc, char **argv)
argv++;
if (argc > 0
&& (strcmp(*argv, "--help") == 0 || strcmp(*argv, "-h") == 0)) {
&& (strcmp(*argv, dash_dash_help) == 0 || strcmp(*argv, "-h") == 0)) {
usage(more_usage);
}
do {

View File

@ -64,10 +64,12 @@ static int use_loop = FALSE;
extern const char mtab_file[]; /* Defined in utility.c */
static const char mount_usage[] = "\tmount [flags]\n"
"\tmount [flags] device directory [-o options,more-options]\n"
"\n" "Flags:\n"
"\t-a:\t\tMount all file systems in fstab.\n"
static const char mount_usage[] =
"mount [flags] device directory [-o options,more-options]\n"
#ifndef BB_FEATURE_TRIVIAL_HELP
"\nMount a filesystem\n\n"
"Flags:\n"
"\t-a:\t\tMount all filesystems in fstab.\n"
#ifdef BB_MTAB
"\t-f:\t\t\"Fake\" mount. Add entry to mount table but don't mount it.\n"
"\t-n:\t\tDon't write a mount table entry.\n"
@ -88,8 +90,10 @@ static const char mount_usage[] = "\tmount [flags]\n"
"\tsuid/nosuid:\tAllow set-user-id-root programs / disallow them.\n"
"\tremount:\tRe-mount a currently-mounted filesystem, changing its flags.\n"
"\tro/rw:\t\tMount for read-only / read-write.\n"
"There are EVEN MORE flags that are specific to each filesystem.\n"
"You'll have to see the written documentation for those.\n";
"\nThere are EVEN MORE flags that are specific to each filesystem.\n"
"You'll have to see the written documentation for those.\n"
#endif
;
struct mount_options {
@ -451,7 +455,7 @@ extern int mount_main(int argc, char **argv)
fatalError( "\nCannot read /etc/fstab: %s\n", strerror (errno));
while ((m = getmntent(f)) != NULL) {
// If the file system isn't noauto,
// If the filesystem isn't noauto,
// and isn't swap or nfs, then mount it
if ((!strstr(m->mnt_opts, "noauto")) &&
(!strstr(m->mnt_type, "swap")) &&

View File

@ -36,16 +36,22 @@ static int whichApp;
static const char *appName;
static const char swapoff_usage[] =
"swapoff [OPTION] [device]\n\n"
"Stop swapping virtual memory pages on the given device.\n\n"
"swapoff [OPTION] [device]\n"
#ifndef BB_FEATURE_TRIVIAL_HELP
"\nStop swapping virtual memory pages on the given device.\n\n"
"Options:\n"
"\t-a\tStop swapping on all swap devices\n";
"\t-a\tStop swapping on all swap devices\n"
#endif
;
static const char swapon_usage[] =
"swapon [OPTION] [device]\n\n"
"Start swapping virtual memory pages on the given device.\n\n"
"swapon [OPTION] [device]\n"
#ifndef BB_FEATURE_TRIVIAL_HELP
"\nStart swapping virtual memory pages on the given device.\n\n"
"Options:\n"
"\t-a\tStart swapping on all swap devices\n";
"\t-a\tStart swapping on all swap devices\n"
#endif
;
#define SWAPON_APP 1

View File

@ -30,8 +30,10 @@
static const char umount_usage[] =
"umount [flags] filesystem|directory\n\n"
"Flags:\n" "\t-a:\tUnmount all file systems"
"umount [flags] filesystem|directory\n"
#ifndef BB_FEATURE_TRIVIAL_HELP
"Unmount file systems\n"
"\nFlags:\n" "\t-a:\tUnmount all file systems"
#ifdef BB_MTAB
" in /etc/mtab\n\t-n:\tDon't erase /etc/mtab entries\n"
#else
@ -44,6 +46,7 @@ static const char umount_usage[] =
#if defined BB_FEATURE_MOUNT_LOOP
"\t-l:\tDo not free loop device (if a loop device has been used)\n"
#endif
#endif
;
struct _mtab_entry_t {