From owner-svn-src-head@FreeBSD.ORG Wed Jun 26 22:53:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 76450C11; Wed, 26 Jun 2013 22:53:22 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1E13B120B; Wed, 26 Jun 2013 22:53:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5QMrM9g094656; Wed, 26 Jun 2013 22:53:22 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5QMrLXh094655; Wed, 26 Jun 2013 22:53:21 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201306262253.r5QMrLXh094655@svn.freebsd.org> From: Jim Harris Date: Wed, 26 Jun 2013 22:53:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252264 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jun 2013 22:53:22 -0000 Author: jimharris Date: Wed Jun 26 22:53:21 2013 New Revision: 252264 URL: http://svnweb.freebsd.org/changeset/base/252264 Log: Add separate *_usage() functions for each nvmecontrol command. Sponsored by: Intel MFC after: 3 days Modified: head/sbin/nvmecontrol/nvmecontrol.c Modified: head/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- head/sbin/nvmecontrol/nvmecontrol.c Wed Jun 26 22:50:49 2013 (r252263) +++ head/sbin/nvmecontrol/nvmecontrol.c Wed Jun 26 22:53:21 2013 (r252264) @@ -289,6 +289,14 @@ open_dev(const char *str, int *fd, int s } static void +devlist_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, DEVLIST_USAGE); + exit(EX_USAGE); +} + +static void devlist(int argc, char *argv[]) { struct nvme_controller_data cdata; @@ -302,7 +310,7 @@ devlist(int argc, char *argv[]) while ((ch = getopt(argc, argv, "")) != -1) { switch ((char)ch) { default: - usage(); + devlist_usage(); } } @@ -347,6 +355,14 @@ devlist(int argc, char *argv[]) } static void +identify_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, IDENTIFY_USAGE); + exit(EX_USAGE); +} + +static void identify_ctrlr(int argc, char *argv[]) { struct nvme_controller_data cdata; @@ -362,7 +378,7 @@ identify_ctrlr(int argc, char *argv[]) hexflag = 1; break; default: - usage(); + identify_usage(); } } @@ -382,7 +398,7 @@ identify_ctrlr(int argc, char *argv[]) if (verboseflag == 1) { printf("-v not currently supported without -x.\n"); - usage(); + identify_usage(); } print_controller(&cdata); @@ -407,7 +423,7 @@ identify_ns(int argc, char *argv[]) hexflag = 1; break; default: - usage(); + identify_usage(); } } @@ -454,7 +470,7 @@ identify_ns(int argc, char *argv[]) if (verboseflag == 1) { printf("-v not currently supported without -x.\n"); - usage(); + identify_usage(); } print_namespace(&nsdata); @@ -467,7 +483,7 @@ identify(int argc, char *argv[]) char *target; if (argc < 2) - usage(); + identify_usage(); while (getopt(argc, argv, "vx") != -1) ; @@ -624,6 +640,14 @@ perftest(int argc, char *argv[]) } static void +reset_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, RESET_USAGE); + exit(EX_USAGE); +} + +static void reset_ctrlr(int argc, char *argv[]) { int ch, fd; @@ -631,7 +655,7 @@ reset_ctrlr(int argc, char *argv[]) while ((ch = getopt(argc, argv, "")) != -1) { switch ((char)ch) { default: - usage(); + reset_usage(); } }