size_t lines_idx; /* current line <0..N>, exclude header */
size_t page_sz;
- unsigned int wrong_order :1; /* PT not in right order */
+ unsigned int wrong_order :1, /* PT not in right order */
+ zero_start :1; /* ignore existing partition table */
};
/* Initialize output columns -- we follow libcfdisk columns (usually specific
DBG(FRONTEND, ul_debug("ui: start COLS=%d, LINES=%d", COLS, LINES));
- if (!fdisk_dev_has_disklabel(cf->cxt)) {
+ if (!fdisk_dev_has_disklabel(cf->cxt) || cf->zero_start) {
rc = ui_create_label(cf);
if (rc < 0)
ui_errx(EXIT_FAILURE,
fputs(USAGE_OPTIONS, out);
fputs(_(" -L --color[=<when>] colorize output (auto, always or never)\n"), out);
+ fputs(_(" -z --zero start with zeroed partition table\n"), out);
fputs(USAGE_SEPARATOR, out);
fputs(USAGE_HELP, out);
{ "color", optional_argument, NULL, 'L' },
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, 'V' },
+ { "zero", no_argument, NULL, 'z' },
{ NULL, 0, 0, 0 },
};
textdomain(PACKAGE);
atexit(close_stdout);
- while((c = getopt_long(argc, argv, "L::hV", longopts, NULL)) != -1) {
+ while((c = getopt_long(argc, argv, "L::hVz", longopts, NULL)) != -1) {
switch(c) {
case 'h':
usage(stdout);
printf(_("%s from %s\n"), program_invocation_short_name,
PACKAGE_STRING);
return EXIT_SUCCESS;
+ case 'z':
+ cf->zero_start = 1;
+ break;
}
}