? .gdbinit
? gpt
? gpt.cat8
Index: add.c
===================================================================
RCS file: /cvsroot/src/sbin/gpt/add.c,v
retrieving revision 1.4
diff -u -r1.4 add.c
--- add.c	16 Feb 2007 17:13:02 -0000	1.4
+++ add.c	18 Dec 2007 21:36:48 -0000
@@ -49,13 +49,16 @@
 static off_t block, size;
 static unsigned int entry;
 
+const char addmsg[] = "add [-b lba] [-i index] [-s lba] [-t uuid] "
+	"device ...";
+
 static void
 usage_add(void)
 {
 
 	fprintf(stderr,
-	    "usage: %s [-b lba] [-i index] [-s lba] [-t uuid] device ...\n",
-	    getprogname());
+	    "usage: %s %s\n",
+	    getprogname(), addmsg);
 	exit(1);
 }
 
Index: create.c
===================================================================
RCS file: /cvsroot/src/sbin/gpt/create.c,v
retrieving revision 1.2
diff -u -r1.2 create.c
--- create.c	15 Oct 2006 22:36:29 -0000	1.2
+++ create.c	18 Dec 2007 21:36:48 -0000
@@ -47,12 +47,14 @@
 static int force;
 static int primary_only;
 
+const char createmsg[] = "create [-fp] device ...";
+
 static void
 usage_create(void)
 {
 
 	fprintf(stderr,
-	    "usage: %s [-fp] device ...\n", getprogname());
+	    "usage: %s %s\n", getprogname(), createmsg);
 	exit(1);
 }
 
Index: destroy.c
===================================================================
RCS file: /cvsroot/src/sbin/gpt/destroy.c,v
retrieving revision 1.2
diff -u -r1.2 destroy.c
--- destroy.c	15 Oct 2006 22:36:29 -0000	1.2
+++ destroy.c	18 Dec 2007 21:36:48 -0000
@@ -46,12 +46,14 @@
 
 static int recoverable;
 
+const char destroymsg[] = "destroy [-r] device ...";
+
 static void
 usage_destroy(void)
 {
 
 	fprintf(stderr,
-	    "usage: %s [-r] device ...\n", getprogname());
+	    "usage: %s %s\n", getprogname(), destroymsg);
 	exit(1);
 }
 
Index: gpt.c
===================================================================
RCS file: /cvsroot/src/sbin/gpt/gpt.c,v
retrieving revision 1.4
diff -u -r1.4 gpt.c
--- gpt.c	11 Jun 2007 04:22:00 -0000	1.4
+++ gpt.c	18 Dec 2007 21:36:48 -0000
@@ -734,10 +734,34 @@
 static void
 usage(void)
 {
+	extern const char addmsg[], createmsg[], destroymsg[];
+	extern const char labelmsg1[], labelmsg2[], labelmsg3[];
+	extern const char migratemsg[], recovermsg[], removemsg1[];
+	extern const char removemsg2[], showmsg[];
 
 	fprintf(stderr,
-	    "usage: %s [-rv] [-p nparts] command [options] device ...\n",
-	    getprogname());
+	    "usage: %s %s\n"
+	    "       %s %s\n"
+	    "       %s %s\n"
+	    "       %s %s\n"
+	    "       %s %s\n"
+	    "       %*s %s\n"
+	    "       %s %s\n"
+	    "       %s %s\n"
+	    "       %s %s\n"
+	    "       %s %s\n"
+	    "       %s %s\n",
+	    getprogname(), addmsg,
+	    getprogname(), createmsg,
+	    getprogname(), destroymsg,
+	    getprogname(), labelmsg1,
+	    getprogname(), labelmsg2,
+	    strlen(getprogname()), "", labelmsg3,
+	    getprogname(), migratemsg,
+	    getprogname(), recovermsg,
+	    getprogname(), removemsg1,
+	    getprogname(), removemsg2,
+	    getprogname(), showmsg);
 	exit(1);
 }
 
Index: label.c
===================================================================
RCS file: /cvsroot/src/sbin/gpt/label.c,v
retrieving revision 1.4
diff -u -r1.4 label.c
--- label.c	16 Feb 2007 17:13:02 -0000	1.4
+++ label.c	18 Dec 2007 21:36:48 -0000
@@ -50,15 +50,18 @@
 static unsigned int entry;
 static uint8_t *name;
 
+const char labelmsg1[] = "label -a <-l label | -f file> device ...";
+const char labelmsg2[] = "label [-b lba] [-i index] [-s lba]";
+const char labelmsg3[] = "      [-t uuid] <-l label | -f file> device ...";
+
 static void
 usage_label(void)
 {
-	const char *common = "<-l label | -f file> device ...";
-
 	fprintf(stderr,
-	    "usage: %s -a %s\n"
-	    "       %s [-b lba] [-i index] [-s lba] [-t uuid] %s\n",
-	    getprogname(), common, getprogname(), common);
+	    "usage: %s %s\n"
+	    "       %s %s\n"
+	    "       %*s %s\n", getprogname(), labelmsg1,
+	    getprogname(), labelmsg2, strlen(getprogname()), "", labelmsg3);
 	exit(1);
 }
 
Index: migrate.c
===================================================================
RCS file: /cvsroot/src/sbin/gpt/migrate.c,v
retrieving revision 1.3
diff -u -r1.3 migrate.c
--- migrate.c	17 Oct 2006 09:20:09 -0000	1.3
+++ migrate.c	18 Dec 2007 21:36:48 -0000
@@ -60,12 +60,14 @@
 static int force;
 static int slice;
 
+const char migratemsg[] = "migrate [-fs] device ...";
+
 static void
 usage_migrate(void)
 {
 
 	fprintf(stderr,
-	    "usage: %s [-fs] device ...\n", getprogname());
+	    "usage: %s %s\n", getprogname(), migratemsg);
 	exit(1);
 }
 
Index: recover.c
===================================================================
RCS file: /cvsroot/src/sbin/gpt/recover.c,v
retrieving revision 1.2
diff -u -r1.2 recover.c
--- recover.c	15 Oct 2006 22:36:29 -0000	1.2
+++ recover.c	18 Dec 2007 21:36:48 -0000
@@ -46,12 +46,14 @@
 
 static int recoverable;
 
+const char recovermsg[] = "recover device ...";
+
 static void
 usage_recover(void)
 {
 
 	fprintf(stderr,
-	    "usage: %s device ...\n", getprogname());
+	    "usage: %s %s\n", getprogname(), recovermsg);
 	exit(1);
 }
 
Index: remove.c
===================================================================
RCS file: /cvsroot/src/sbin/gpt/remove.c,v
retrieving revision 1.3
diff -u -r1.3 remove.c
--- remove.c	16 Feb 2007 17:13:02 -0000	1.3
+++ remove.c	18 Dec 2007 21:36:48 -0000
@@ -49,14 +49,18 @@
 static off_t block, size;
 static unsigned int entry;
 
+const char removemsg1[] = "remove -a device ...";
+const char removemsg2[] = "remove [-b lba] [-i index] [-s lba] "
+	"[-t uuid] device ...";
+
 static void
 usage_remove(void)
 {
 
 	fprintf(stderr,
-	    "usage: %s -a device ...\n"
-	    "       %s [-b lba] [-i index] [-s lba] [-t uuid] device ...\n",
-	    getprogname(), getprogname());
+	    "usage: %s %s\n"
+	    "       %s %s\n",
+	    getprogname(), removemsg1, getprogname(), removemsg2);
 	exit(1);
 }
 
Index: show.c
===================================================================
RCS file: /cvsroot/src/sbin/gpt/show.c,v
retrieving revision 1.2
diff -u -r1.2 show.c
--- show.c	15 Oct 2006 22:36:29 -0000	1.2
+++ show.c	18 Dec 2007 21:36:48 -0000
@@ -47,12 +47,14 @@
 static int show_label = 0;
 static int show_uuid = 0;
 
+const char showmsg[] = "show [-lu] device ...";
+
 static void
 usage_show(void)
 {
 
 	fprintf(stderr,
-	    "usage: %s [-lu] device ...\n", getprogname());
+	    "usage: %s %s\n", getprogname(), showmsg);
 	exit(1);
 }
 
