From: Karel Zak Date: Thu, 13 Nov 2014 10:19:58 +0000 (+0100) Subject: cfdisk: remove [Load] from menu X-Git-Tag: v2.26-rc1~222 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5cb9918d595e4a512e3c6b9fcdb8450b96d228a4;p=thirdparty%2Futil-linux.git cfdisk: remove [Load] from menu This functionality will be rarely used, so it does not make sense to waste screen space with this menu item. It's enough to provide this functionality in "Select label type" dialog (cfdisk --zero and then 'L' command). Signed-off-by: Karel Zak --- diff --git a/disk-utils/cfdisk.8 b/disk-utils/cfdisk.8 index ab51757796..6da8f431b5 100644 --- a/disk-utils/cfdisk.8 +++ b/disk-utils/cfdisk.8 @@ -66,7 +66,9 @@ Display version information and exit. .BR \-z , " \-\-zero" Start with an in-memory zeroed partition table. This option does not zero the partition table on the disk; rather, it simply starts the program without -reading the existing partition table. +reading the existing partition table. This option allows to a create new +partition table from scratch or create a new partition table according to +a sfdisk compatible script. .SH COMMANDS The commands for @@ -105,18 +107,16 @@ MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB Quit the program. This will exit the program without writing any data to the disk. .TP -.B l -Load sfdisk compatible script file and create a new (in-memory) disk label -according to the script, and then it is possible to modify the -partition table before you write it to the device. -.TP .B u Dump the current in-memory partition table to the sfdisk compatible file. -to the script file by command 'O'. .sp The script files are compatible between cfdisk, sfdisk, fdisk and another libfdisk applications. For more details see .BR sfdisk (8). +.sp +It is also possible to load sfdisk script to cfdisk if there is no partition +table on the device or when you start cfdisk with \fI--zero\fR command line +option. .TP .B t Change the partition type. By default, new partitions are created as diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c index f3e93b2202..d7f116a1e0 100644 --- a/disk-utils/cfdisk.c +++ b/disk-utils/cfdisk.c @@ -159,7 +159,6 @@ static struct cfdisk_menuitem main_menuitems[] = { { 'h', N_("Help"), N_("Print help screen") }, { 's', N_("Sort"), N_("Fix partitions order") }, { 'W', N_("Write"), N_("Write partition table to disk (this might destroy data)") }, - { 'l', N_("Load"), N_("Load disk layout from sfdisk compatible script file") }, { 'u', N_("Dump"), N_("Dump partition table to sfdisk compatible script file") }, { 0, NULL, NULL } }; @@ -1771,7 +1770,6 @@ static int ui_help(void) N_(" b Toggle bootable flag of the current partition"), N_(" d Delete the current partition"), N_(" h Print this screen"), - N_(" l Load disk layout from sfdisk compatible script file"), N_(" n Create new partition from free space"), N_(" q Quit program without writing partition table"), N_(" t Change the partition type"), @@ -1953,17 +1951,6 @@ static int main_menu_action(struct cfdisk *cf, int key) ref = 1; } break; - case 'l': - rc = ui_script_read(cf); - if (rc == 0) { - info = _("Script file successfully applied."); - ref = 1; - } else if (rc != CFDISK_ERR_ESC) { - refresh(); - sleep(2); - warn = _("Failed to read script file"); - } - break; case 'u': rc = ui_script_write(cf); if (rc == 0) diff --git a/disk-utils/fdisk-menu.c b/disk-utils/fdisk-menu.c index bea6ab3579..8afdf69085 100644 --- a/disk-utils/fdisk-menu.c +++ b/disk-utils/fdisk-menu.c @@ -110,8 +110,8 @@ struct menu menu_generic = { MENU_ENT_E('x', N_("extra functionality (experts only)"), FDISK_DISKLABEL_BSD), MENU_SEP(N_("Script")), - MENU_ENT ('I', N_("load disk layout from fdisk script file")), - MENU_ENT ('O', N_("dump disk layout to fdisk script file")), + MENU_ENT ('I', N_("load disk layout from sfdisk script file")), + MENU_ENT ('O', N_("dump disk layout to sfdisk script file")), MENU_BSEP(N_("Save & Exit")), MENU_ENT_E('w', N_("write table to disk and exit"), FDISK_DISKLABEL_BSD),