Extract usage information into a separate file.

This commit is contained in:
Matt Kraai
2000-07-16 20:57:15 +00:00
parent 3bd8bd89ee
commit bf181b9338
175 changed files with 2529 additions and 2050 deletions

View File

@@ -32,16 +32,6 @@ static inline _syscall3(int, klogctl, int, type, char *, b, int, len);
# include <sys/klog.h>
#endif
static const char dmesg_usage[] = "dmesg [-c] [-n LEVEL] [-s SIZE]\n"
#ifndef BB_FEATURE_TRIVIAL_HELP
"\nPrints or controls the kernel ring buffer\n\n"
"Options:\n"
"\t-c\t\tClears the ring buffer's contents after printing\n"
"\t-n LEVEL\tSets console logging level\n"
"\t-s SIZE\t\tUse a buffer of size SIZE\n"
#endif
;
int dmesg_main(int argc, char **argv)
{
char *buf, c;

View File

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

View File

@@ -34,14 +34,6 @@
/* From linux/fs.h */
#define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
static const char freeramdisk_usage[] =
"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

@@ -288,21 +288,6 @@ static void leave(int status)
exit(status);
}
const char fsck_minix_usage[] =
"Usage: fsck.minix [-larvsmf] /dev/name\n"
#ifndef BB_FEATURE_TRIVIAL_HELP
"\nPerforms a consistency check for MINIX filesystems.\n\n"
"Options:\n"
"\t-l\tLists all filenames\n"
"\t-r\tPerform interactive repairs\n"
"\t-a\tPerform automatic repairs\n"
"\t-v\tverbose\n"
"\t-s\tOutputs super-block information\n"
"\t-m\tActivates MINIX-like \"mode not cleared\" warnings\n"
"\t-f\tForce file system check.\n\n"
#endif
;
static void show_usage(void)
{
usage(fsck_minix_usage);

View File

@@ -267,19 +267,6 @@ static volatile void die(char *str)
exit(8);
}
const char mkfs_minix_usage[] =
"mkfs.minix [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]\n"
#ifndef BB_FEATURE_TRIVIAL_HELP
"\nMake a MINIX filesystem.\n\n"
"Options:\n"
"\t-c\t\tCheck the device for bad blocks\n"
"\t-n [14|30]\tSpecify the maximum length of filenames\n"
"\t-i INODES\tSpecify the number of inodes for the filesystem\n"
"\t-l FILENAME\tRead the bad blocks list from FILENAME\n"
"\t-v\t\tMake a Minix version 2 filesystem\n\n"
#endif
;
static volatile void show_usage() __attribute__ ((noreturn));
static volatile void show_usage()
{

View File

@@ -47,20 +47,6 @@
#include <asm/page.h> /* for PAGE_SIZE and PAGE_SHIFT */
/* we also get PAGE_SIZE via getpagesize() */
static const char mkswap_usage[] =
"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"
#endif
;
#ifndef _IO
/* pre-1.3.45 */
#define BLKGETSIZE 0x1260

View File

@@ -34,12 +34,6 @@
#define bb_need_help
#include "messages.c"
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
# if #cpu(sparc)

View File

@@ -80,38 +80,6 @@ extern int umount2 (__const char *__special_file, int __flags);
extern const char mtab_file[]; /* Defined in utility.c */
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"
#endif
"\t-o option:\tOne of many filesystem options, listed below.\n"
"\t-r:\t\tMount the filesystem read-only.\n"
"\t-t fs-type:\tSpecify the filesystem type.\n"
"\t-w:\t\tMount for reading and writing (default).\n"
"\n"
"Options for use with the \"-o\" flag:\n"
"\tasync/sync:\tWrites are asynchronous / synchronous.\n"
"\tatime/noatime:\tEnable / disable updates to inode access times.\n"
"\tdev/nodev:\tAllow use of special device files / disallow them.\n"
"\texec/noexec:\tAllow use of executable files / disallow them.\n"
#if defined BB_FEATURE_MOUNT_LOOP
"\tloop:\t\tMounts a file via loop device.\n"
#endif
"\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"
"\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 {
const char *name;
unsigned long and;

View File

@@ -35,25 +35,6 @@ _syscall1(int, swapoff, const char *, path);
static int whichApp;
static const char swapoff_usage[] =
"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"
#endif
;
static const char swapon_usage[] =
"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"
#endif
;
#define SWAPON_APP 1
#define SWAPOFF_APP 2

View File

@@ -39,28 +39,6 @@ extern int mount (__const char *__special_file, __const char *__dir,
extern int umount (__const char *__special_file);
extern int umount2 (__const char *__special_file, int __flags);
static const char umount_usage[] =
"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
"\n"
#endif
"\t-r:\tTry to remount devices as read-only if mount is busy\n"
#if defined BB_FEATURE_MOUNT_FORCE
"\t-f:\tForce filesystem umount (i.e. unreachable NFS server)\n"
#endif
#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 {
char *device;
char *mountpt;