From owner-svn-src-all@freebsd.org Fri Nov 27 14:40:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3588A3A178; Fri, 27 Nov 2015 14:40:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A77C81EA7; Fri, 27 Nov 2015 14:40:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAREeLhw055775; Fri, 27 Nov 2015 14:40:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAREeL6M055774; Fri, 27 Nov 2015 14:40:21 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201511271440.tAREeL6M055774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 27 Nov 2015 14:40:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291385 - head/sbin/newfs_msdos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2015 14:40:23 -0000 Author: emaste Date: Fri Nov 27 14:40:21 2015 New Revision: 291385 URL: https://svnweb.freebsd.org/changeset/base/291385 Log: Use netbsd usage() implementation in newfs_msdos In r289629 newfs_msdos option descriptions are available in mkfs_msdos.h. Obtained from: NetBSD Modified: head/sbin/newfs_msdos/newfs_msdos.c Modified: head/sbin/newfs_msdos/newfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/newfs_msdos.c Fri Nov 27 14:38:36 2015 (r291384) +++ head/sbin/newfs_msdos/newfs_msdos.c Fri Nov 27 14:40:21 2015 (r291385) @@ -235,31 +235,18 @@ argtooff(const char *arg, const char *ms 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); }