svn commit: r257018 - in head/usr.sbin: bhyve bhyveload

Neel Natu neel at FreeBSD.org
Wed Oct 23 21:42:54 UTC 2013


Author: neel
Date: Wed Oct 23 21:42:53 2013
New Revision: 257018
URL: http://svnweb.freebsd.org/changeset/base/257018

Log:
  Tidy usage messages for bhyve and bhyveload.
  
  Submitted by:	jhb

Modified:
  head/usr.sbin/bhyve/bhyverun.c
  head/usr.sbin/bhyveload/bhyveload.c

Modified: head/usr.sbin/bhyve/bhyverun.c
==============================================================================
--- head/usr.sbin/bhyve/bhyverun.c	Wed Oct 23 21:35:39 2013	(r257017)
+++ head/usr.sbin/bhyve/bhyverun.c	Wed Oct 23 21:42:53 2013	(r257018)
@@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$");
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <err.h>
 #include <libgen.h>
 #include <unistd.h>
@@ -121,9 +122,8 @@ usage(int code)
 {
 
         fprintf(stderr,
-                "Usage: %s [-aehAHIPW][-g <gdb port>][-s <pci>][-S <pci>]"
-		"[-c vcpus][-p pincpu][-m mem]"
-		" <vmname>\n"
+                "Usage: %s [-aehAHIPW] [-g <gdb port>] [-s <pci>] [-S <pci>]\n"
+		"       %*s [-c vcpus] [-p pincpu] [-m mem] <vmname>\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 @@ usage(int code)
 		"       -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: <slot,driver,configinfo> PCI slot config\n"
 		"       -S: <slot,driver,configinfo> legacy PCI slot config\n"
 		"       -m: memory size in MB\n",
-		progname);
+		progname, (int)strlen(progname), "");
 
 	exit(code);
 }

Modified: head/usr.sbin/bhyveload/bhyveload.c
==============================================================================
--- head/usr.sbin/bhyveload/bhyveload.c	Wed Oct 23 21:35:39 2013	(r257017)
+++ head/usr.sbin/bhyveload/bhyveload.c	Wed Oct 23 21:42:53 2013	(r257018)
@@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$");
 #include <err.h>
 #include <fcntl.h>
 #include <getopt.h>
+#include <libgen.h>
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -568,8 +569,9 @@ usage(void)
 {
 
 	fprintf(stderr,
-	    "usage: %s [-m mem-size][-d <disk-path>] [-h <host-path>] "
-	    "[-e <name=value>] <vmname>\n", progname);
+	    "usage: %s [-m mem-size] [-d <disk-path>] [-h <host-path>]\n"
+	    "       %*s [-e <name=value>] <vmname>\n", progname,
+	    (int)strlen(progname), "");
 	exit(1);
 }
 
@@ -582,7 +584,7 @@ main(int argc, char** argv)
 	int opt, error;
 	char *disk_image;
 
-	progname = argv[0];
+	progname = basename(argv[0]);
 
 	mem_size = 256 * MB;
 	disk_image = NULL;


More information about the svn-src-head mailing list