From owner-freebsd-virtualization@FreeBSD.ORG Wed Oct 23 14:36:59 2013 Return-Path: Delivered-To: virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 44A724F0 for ; Wed, 23 Oct 2013 14:36:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 210372454 for ; Wed, 23 Oct 2013 14:36:59 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 4C987B93B for ; Wed, 23 Oct 2013 10:36:58 -0400 (EDT) From: John Baldwin To: virtualization@freebsd.org Subject: [PATCH] Tidy usage messages for bhyve and bhyveload Date: Wed, 23 Oct 2013 10:36:55 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201310231036.55620.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 23 Oct 2013 10:36:58 -0400 (EDT) X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Oct 2013 14:36:59 -0000 These are just some cosmetic nits to the usage messages for bhyve and bhyveload so that they are more consistent with other tools in the base system (spaces between options, wrapping at 80 cols, etc.) Index: bhyve/bhyverun.c =================================================================== --- bhyve/bhyverun.c (revision 256946) +++ bhyve/bhyverun.c (working copy) @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -121,9 +122,8 @@ { fprintf(stderr, - "Usage: %s [-aehAHIPW][-g ][-s ][-S ]" - "[-c vcpus][-p pincpu][-m mem]" - " \n" + "Usage: %s [-aehAHIPW] [-g ] [-s ] [-S ]\n" + " %*s [-c vcpus] [-p pincpu] [-m mem] \n" " -a: local apic is in XAPIC mode (default is X2APIC)\n" " -A: create an ACPI table\n" " -g: gdb port\n" @@ -132,13 +132,13 @@ " -H: vmexit from the guest on hlt\n" " -I: present an ioapic to the guest\n" " -P: vmexit from the guest on pause\n" - " -W: force virtio to use single-vector MSI\n" - " -e: exit on unhandled i/o access\n" + " -W: force virtio to use single-vector MSI\n" + " -e: exit on unhandled I/O access\n" " -h: help\n" " -s: PCI slot config\n" " -S: legacy PCI slot config\n" " -m: memory size in MB\n", - progname); + progname, (int)strlen(progname), ""); exit(code); } Index: bhyveload/bhyveload.c =================================================================== --- bhyveload/bhyveload.c (revision 256946) +++ bhyveload/bhyveload.c (working copy) @@ -71,6 +71,7 @@ #include #include #include +#include #include #include #include @@ -568,8 +569,9 @@ { fprintf(stderr, - "usage: %s [-m mem-size][-d ] [-h ] " - "[-e ] \n", progname); + "usage: %s [-m mem-size] [-d ] [-h ]\n" + " %*s [-e ] \n", progname, + (int)strlen(progname), ""); exit(1); } @@ -582,7 +584,7 @@ int opt, error; char *disk_image; - progname = argv[0]; + progname = basename(argv[0]); mem_size = 256 * MB; disk_image = NULL; -- John Baldwin