diff options
author | Erik Andersen <andersen@codepoet.org> | 2000-05-12 23:41:47 +0400 |
---|---|---|
committer | Erik Andersen <andersen@codepoet.org> | 2000-05-12 23:41:47 +0400 |
commit | 7ab9c7ee52db8759d457819f5480378fa3aa97cc (patch) | |
tree | 37ef0fb8b142a4925b866c7caa5207b71b4ecae6 /util-linux | |
parent | 3d427ac5efd249dc25dd03deb30520335f68911a (diff) |
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
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/fbset.c | 16 | ||||
-rw-r--r-- | util-linux/fdflush.c | 6 | ||||
-rw-r--r-- | util-linux/freeramdisk.c | 7 | ||||
-rw-r--r-- | util-linux/fsck_minix.c | 6 | ||||
-rw-r--r-- | util-linux/mkfs_minix.c | 6 | ||||
-rw-r--r-- | util-linux/mkswap.c | 9 | ||||
-rw-r--r-- | util-linux/more.c | 11 | ||||
-rw-r--r-- | util-linux/mount.c | 18 | ||||
-rw-r--r-- | util-linux/swaponoff.c | 18 | ||||
-rw-r--r-- | util-linux/umount.c | 7 |
10 files changed, 71 insertions, 33 deletions
diff --git a/util-linux/fbset.c b/util-linux/fbset.c index 4e5609e41..de4c82425 100644 --- a/util-linux/fbset.c +++ b/util-linux/fbset.c @@ -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); } diff --git a/util-linux/fdflush.c b/util-linux/fdflush.c index 56ea2244d..4ec0a8886 100644 --- a/util-linux/fdflush.c +++ b/util-linux/fdflush.c @@ -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); diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c index d373bcbf7..4106cf144 100644 --- a/util-linux/freeramdisk.c +++ b/util-linux/freeramdisk.c @@ -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) diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index c890dff7d..7d27566b8 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c @@ -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); } diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c index be180a46b..bf4bda9fd 100644 --- a/util-linux/mkfs_minix.c +++ b/util-linux/mkfs_minix.c @@ -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); } diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c index 17866a735..7d76916f0 100644 --- a/util-linux/mkswap.c +++ b/util-linux/mkswap.c @@ -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 diff --git a/util-linux/more.c b/util-linux/more.c index 30d2757cd..50446861e 100644 --- a/util-linux/more.c +++ b/util-linux/more.c @@ -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 { diff --git a/util-linux/mount.c b/util-linux/mount.c index 00a774a53..bde55d155 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c @@ -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")) && diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c index aa961dac9..0f8c4f5f3 100644 --- a/util-linux/swaponoff.c +++ b/util-linux/swaponoff.c @@ -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 diff --git a/util-linux/umount.c b/util-linux/umount.c index 18a5afe80..86833b717 100644 --- a/util-linux/umount.c +++ b/util-linux/umount.c @@ -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 { |