summaryrefslogtreecommitdiff
path: root/sbin/disklabel/disklabel.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-03-28 14:03:43 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-03-28 14:03:43 +0000
commit13912a7393882086e92aae04239e535d0002b32e (patch)
treecc87ca23aecd08f653233f34d9692db130188fc0 /sbin/disklabel/disklabel.c
parent72f654265f7c9474c59d8e960a93d8524631ccb4 (diff)
make -B not even show up in usage on non-NUMBOOT systems; ok jmc krw
Diffstat (limited to 'sbin/disklabel/disklabel.c')
-rw-r--r--sbin/disklabel/disklabel.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index 1afb586718a..364ad3606d7 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.c,v 1.140 2009/03/22 20:51:58 jmc Exp $ */
+/* $OpenBSD: disklabel.c,v 1.141 2009/03/28 14:03:42 deraadt Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -39,7 +39,7 @@ static const char copyright[] =
#endif /* not lint */
#ifndef lint
-static const char rcsid[] = "$OpenBSD: disklabel.c,v 1.140 2009/03/22 20:51:58 jmc Exp $";
+static const char rcsid[] = "$OpenBSD: disklabel.c,v 1.141 2009/03/28 14:03:42 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -1713,10 +1713,13 @@ usage(void)
{
char *boot = "";
char *blank = " ";
+ char *Bflag = "";
#if NUMBOOT == 1
+ Bflag = "B";
boot = " [-b boot1]";
#elif NUMBOOT == 2
+ Bflag = "B";
boot = " [-b boot1] [-s boot2]";
blank = " ";
#endif
@@ -1733,15 +1736,17 @@ usage(void)
" disklabel -R [-nv] disk protofile\t\t\t(restore)\n");
fprintf(stderr,
" disklabel -N | -W [-nv] disk\t\t\t\t(protect)\n\n");
+#if NUMBOOT > 0
fprintf(stderr,
"%sdisklabel -B [-nv]%s disk [disktype] (boot)\n",
blank, boot);
+#endif
fprintf(stderr,
- "%sdisklabel -Bw [-nv]%s disk disktype [packid] (write)\n",
- blank, boot);
+ "%sdisklabel -%sw [-nv]%s disk disktype [packid] (write)\n",
+ blank, Bflag, boot);
fprintf(stderr,
- "%sdisklabel -BR [-nv]%s disk protofile [disktype] (restore)\n\n",
- blank, boot);
+ "%sdisklabel -%sR [-nv]%s disk protofile [disktype] (restore)\n\n",
+ blank, Bflag, boot);
fprintf(stderr,
"`disk' may be of the form: sd0 or /dev/rsd0%c.\n", 'a'+RAW_PART);
fprintf(stderr,