From e36fb07af63005f26a1e9d0017ea54ea6b02e77f Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 2 Oct 2014 13:43:52 +0200 Subject: [PATCH] sfdisk: cleanup option names Rename options to --part-{label,uuid,type} to be compatible with another tools (like lsblk, parts, etc). Signed-off-by: Karel Zak --- disk-utils/sfdisk.8 | 26 +++++++-------- disk-utils/sfdisk.c | 79 ++++++++++++++++++++++++++------------------- 2 files changed, 58 insertions(+), 47 deletions(-) diff --git a/disk-utils/sfdisk.8 b/disk-utils/sfdisk.8 index fb0807c97..f0eea948c 100644 --- a/disk-utils/sfdisk.8 +++ b/disk-utils/sfdisk.8 @@ -55,10 +55,6 @@ addressed by \fIpartno\fR. Switch on the bootable flag. If \fIpartno\fR no specified then lists all partitions with enabled flag. .TP -.BR \-c , " \-\-type " \fIdevice\fR " " \fIpartno\fR " "[\fItype\fR] -Change partition type. If \fItype\fR no specified then print the current -partition type. The argument \fItype\fR is hex for MBR or GUID for GPT. -.TP .BR \-d , " \-\-dump " \fIdevice\fR Dump the partitions of a device in a format that is usable as input to sfdisk. See the section "BACKUP PARTITION TABLE". @@ -70,21 +66,25 @@ List geometry of all or specified devices. List partitions of all or specified devices. This command can be used together with \fB\-\-verify\fR. .TP +.BR \-\-part\-label " " \fIdevice\fR " " \fIpartno\fR " "[\fIlabel\fR] +Change GPT partition name (label). If \fIlabel\fR no specified then print the current +partition label. +.TP +.BR \-\-part-type " " \fIdevice\fR " " \fIpartno\fR " "[\fItype\fR] +Change partition type. If \fItype\fR no specified then print the current +partition type. The argument \fItype\fR is hex for MBR or GUID for GPT. +For backward compatibility the option -c, --id has the same meaning. +.TP +.BR \-\-part\-uuid " " \fIdevice\fR " " \fIpartno\fR " "[\fIuuid\fR] +Change GPT partition UUID. If \fIuuid\fR no specified then print the current +partition UUID. +.TP .BR \-s , " \-\-show-size " [\fIdevice\fR ...] List sizes of all or specified devices. .TP .BR \-T , " \-\-list-types Print all supported types for the current disk label or label specified by \fB\-\-label\fR. -.TP -.BR \-U , " \-\-uuid " \fIdevice\fR " " \fIpartno\fR " "[\fIuuid\fR] -Change GPT partition UUID. If \fIuuid\fR no specified then print the current -partition UUID. -.TP -.BR \-\-name " " \fIdevice\fR " " \fIpartno\fR " "[\fIname\fR] -Change GPT partition name (label). If \fIname\fR no specified then print the current -partition name. - .TP .BR \-V , " \-\-verify Test whether partition table and partitions seem correct. diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c index 5aa8a0708..b9ae1b35c 100644 --- a/disk-utils/sfdisk.c +++ b/disk-utils/sfdisk.c @@ -71,7 +71,7 @@ enum { ACT_VERIFY, ACT_PARTTYPE, ACT_PARTUUID, - ACT_PARTNAME, + ACT_PARTLABEL, }; struct sfdisk { @@ -646,7 +646,7 @@ static void assign_device_partition(struct sfdisk *sf, } /* - * sfdisk --type [] + * sfdisk --part-type [] */ static int command_parttype(struct sfdisk *sf, int argc, char **argv) { @@ -711,7 +711,7 @@ static int command_parttype(struct sfdisk *sf, int argc, char **argv) } /* - * sfdisk --uuid [] + * sfdisk --part-uuid [] */ static int command_partuuid(struct sfdisk *sf, int argc, char **argv) { @@ -766,9 +766,9 @@ static int command_partuuid(struct sfdisk *sf, int argc, char **argv) } /* - * sfdisk --name [] + * sfdisk --part-label [