summaryrefslogtreecommitdiffstats
path: root/sbin/newfs_msdos
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2015-11-27 14:40:21 +0000
committeremaste <emaste@FreeBSD.org>2015-11-27 14:40:21 +0000
commitbc1737f78296ae74b386f1a3acc20da697400685 (patch)
treee04b2a4b82bae5ac99c7bc4d35a9369382ff088a /sbin/newfs_msdos
parente2706f2c8a1cf869b153216bc0bd7aae63861c4d (diff)
downloadFreeBSD-src-bc1737f78296ae74b386f1a3acc20da697400685.zip
FreeBSD-src-bc1737f78296ae74b386f1a3acc20da697400685.tar.gz
Use netbsd usage() implementation in newfs_msdos
In r289629 newfs_msdos option descriptions are available in mkfs_msdos.h. Obtained from: NetBSD
Diffstat (limited to 'sbin/newfs_msdos')
-rw-r--r--sbin/newfs_msdos/newfs_msdos.c41
1 files changed, 14 insertions, 27 deletions
diff --git a/sbin/newfs_msdos/newfs_msdos.c b/sbin/newfs_msdos/newfs_msdos.c
index d84f706..0d3340d 100644
--- a/sbin/newfs_msdos/newfs_msdos.c
+++ b/sbin/newfs_msdos/newfs_msdos.c
@@ -235,31 +235,18 @@ argtooff(const char *arg, const char *msg)
static void
usage(void)
{
- fprintf(stderr,
- "usage: newfs_msdos [ -options ] special [disktype]\n"
- "where the options are:\n"
- "\t-@ create file system at specified offset\n"
- "\t-B get bootstrap from file\n"
- "\t-C create image file with specified size\n"
- "\t-F FAT type (12, 16, or 32)\n"
- "\t-I volume ID\n"
- "\t-L volume label\n"
- "\t-N don't create file system: just print out parameters\n"
- "\t-O OEM string\n"
- "\t-S bytes/sector\n"
- "\t-a sectors/FAT\n"
- "\t-b block size\n"
- "\t-c sectors/cluster\n"
- "\t-e root directory entries\n"
- "\t-f standard format\n"
- "\t-h drive heads\n"
- "\t-i file system info sector\n"
- "\t-k backup boot sector\n"
- "\t-m media descriptor\n"
- "\t-n number of FATs\n"
- "\t-o hidden sectors\n"
- "\t-r reserved sectors\n"
- "\t-s file system size (sectors)\n"
- "\t-u sectors/track\n");
- exit(1);
+ fprintf(stderr,
+ "usage: %s [ -options ] special [disktype]\n", getprogname());
+ fprintf(stderr, "where the options are:\n");
+static struct {
+ char o;
+ const char *h;
+} opts[] = {
+#define AOPT(_opt, _type, _name, _min, _desc) { _opt, _desc },
+ALLOPTS
+#undef AOPT
+ };
+ for (size_t i = 0; i < nitems(opts); i++)
+ fprintf(stderr, "\t-%c %s\n", opts[i].o, opts[i].h);
+ exit(1);
}
OpenPOWER on IntegriCloud