Sun May 24 21:02:12 2020 UTC ()
Add -g to usage.


(wiz)
diff -r1.158 -r1.159 src/sbin/fdisk/fdisk.c

cvs diff -r1.158 -r1.159 src/sbin/fdisk/fdisk.c (expand / switch to unified diff)

--- src/sbin/fdisk/fdisk.c 2020/05/24 18:42:48 1.158
+++ src/sbin/fdisk/fdisk.c 2020/05/24 21:02:12 1.159
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: fdisk.c,v 1.158 2020/05/24 18:42:48 jmcneill Exp $ */ 1/* $NetBSD: fdisk.c,v 1.159 2020/05/24 21:02:12 wiz Exp $ */
2 2
3/* 3/*
4 * Mach Operating System 4 * Mach Operating System
5 * Copyright (c) 1992 Carnegie Mellon University 5 * Copyright (c) 1992 Carnegie Mellon University
6 * All Rights Reserved. 6 * All Rights Reserved.
7 * 7 *
8 * Permission to use, copy, modify and distribute this software and its 8 * Permission to use, copy, modify and distribute this software and its
9 * documentation is hereby granted, provided that both the copyright 9 * documentation is hereby granted, provided that both the copyright
10 * notice and this permission notice appear in all copies of the 10 * notice and this permission notice appear in all copies of the
11 * software, derivative works or modified versions, and any portions 11 * software, derivative works or modified versions, and any portions
12 * thereof, and that both notices appear in supporting documentation. 12 * thereof, and that both notices appear in supporting documentation.
13 * 13 *
14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 14 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
@@ -29,27 +29,27 @@ @@ -29,27 +29,27 @@
29/* 29/*
30 * 14-Dec-89 Robert Baron (rvb) at Carnegie-Mellon University 30 * 14-Dec-89 Robert Baron (rvb) at Carnegie-Mellon University
31 * Copyright (c) 1989 Robert. V. Baron 31 * Copyright (c) 1989 Robert. V. Baron
32 * Created. 32 * Created.
33 */ 33 */
34 34
35#if HAVE_NBTOOL_CONFIG_H 35#if HAVE_NBTOOL_CONFIG_H
36#include "nbtool_config.h" 36#include "nbtool_config.h"
37#endif 37#endif
38 38
39#include <sys/cdefs.h> 39#include <sys/cdefs.h>
40 40
41#ifndef lint 41#ifndef lint
42__RCSID("$NetBSD: fdisk.c,v 1.158 2020/05/24 18:42:48 jmcneill Exp $"); 42__RCSID("$NetBSD: fdisk.c,v 1.159 2020/05/24 21:02:12 wiz Exp $");
43#endif /* not lint */ 43#endif /* not lint */
44 44
45#define MBRPTYPENAMES 45#define MBRPTYPENAMES
46#include <sys/types.h> 46#include <sys/types.h>
47#include <sys/param.h> 47#include <sys/param.h>
48#include <sys/stat.h> 48#include <sys/stat.h>
49#include <ctype.h> 49#include <ctype.h>
50#include <err.h> 50#include <err.h>
51#include <errno.h> 51#include <errno.h>
52#include <fcntl.h> 52#include <fcntl.h>
53#include <paths.h> 53#include <paths.h>
54#include <stdarg.h> 54#include <stdarg.h>
55#include <stddef.h> 55#include <stddef.h>
@@ -655,36 +655,37 @@ out: errx(EXIT_FAILURE, "Invalid sec @@ -655,36 +655,37 @@ out: errx(EXIT_FAILURE, "Invalid sec
655 warnx("Secondary GPT header was deleted"); 655 warnx("Secondary GPT header was deleted");
656 write_mbr(); 656 write_mbr();
657 } 657 }
658 } 658 }
659 659
660 exit(0); 660 exit(0);
661} 661}
662 662
663static void 663static void
664usage(void) 664usage(void)
665{ 665{
666 int indent = 7 + (int)strlen(getprogname()) + 1; 666 int indent = 7 + (int)strlen(getprogname()) + 1;
667 667
668 (void)fprintf(stderr, "usage: %s [-aBFfIilSuv] " 668 (void)fprintf(stderr, "usage: %s [-aBFfgIilSuv] "
669 "[-A ptn_alignment[/ptn_0_offset]] \\\n" 669 "[-A ptn_alignment[/ptn_0_offset]] \\\n"
670 "%*s[-b cylinders/heads/sectors] \\\n" 670 "%*s[-b cylinders/heads/sectors] \\\n"
671 "%*s[-0123 | -E num " 671 "%*s[-0123 | -E num "
672 "[-s [id][/[start][/[size][/bootmenu]]]] \\\n" 672 "[-s [id][/[start][/[size][/bootmenu]]]] \\\n"
673 "%*s[-t disktab] [-T disktype] \\\n" 673 "%*s[-t disktab] [-T disktype] \\\n"
674 "%*s[-c bootcode] " 674 "%*s[-c bootcode] "
675 "[-r|-w file] [-z sectorsize] [device]\n" 675 "[-r|-w file] [-z sectorsize] [device]\n"
676 "\t-a change active partition\n" 676 "\t-a change active partition\n"
677 "\t-f force - not interactive\n" 677 "\t-f force - not interactive\n"
 678 "\t-g preserve existing GPT headers\n"
678 "\t-i initialise MBR code\n" 679 "\t-i initialise MBR code\n"
679 "\t-I ignore errors about no space or overlapping partitions\n" 680 "\t-I ignore errors about no space or overlapping partitions\n"
680 "\t-l list partition types\n" 681 "\t-l list partition types\n"
681 "\t-u update partition data\n" 682 "\t-u update partition data\n"
682 "\t-v verbose output, -v -v more verbose still\n" 683 "\t-v verbose output, -v -v more verbose still\n"
683 "\t-B update bootselect options\n" 684 "\t-B update bootselect options\n"
684 "\t-F treat device as a regular file\n" 685 "\t-F treat device as a regular file\n"
685 "\t-S output as shell defines\n" 686 "\t-S output as shell defines\n"
686 "\t-r and -w access 'file' for non-destructive testing\n", 687 "\t-r and -w access 'file' for non-destructive testing\n",
687 getprogname(), indent, "", indent, "", indent, "", indent, ""); 688 getprogname(), indent, "", indent, "", indent, "", indent, "");
688 exit(1); 689 exit(1);
689} 690}
690 691