[parted-devel] Printing partition type in --machine output
Brian C. Lane
bcl at redhat.com
Tue Oct 16 23:13:18 BST 2018
On Thu, Sep 27, 2018 at 02:50:03PM +0200, Alberto Planas Dominguez wrote:
> Hi, I would like to include this in parted, as printing the partition
> type in machine readable output can be a relevant feature.
>
> This will make the normal and the machine readable format more similar
> too.
>
>
> Index: parted-3.2/parted/parted.c
> ===================================================================
> --- parted-3.2.orig/parted/parted.c
> +++ parted-3.2/parted/parted.c
> @@ -1381,6 +1381,11 @@ do_print (PedDevice** dev, PedDisk** dis
>
> if (!(part->type & PED_PARTITION_FREESPACE)) {
>
> + if (has_extended)
> + printf ("%s:", ped_partition_type_get_name
> (part->type));
> + else
> + putchar (':');
> +
> if (part->fs_type)
> printf ("%s:", part->fs_type->name);
> else
>
>
This may be a useful thing to add, but it changes the machine output so
I think it would be best to hold off on it until after we do the 3.3
release.
Thanks!
--
Brian C. Lane (PST8PDT)
More information about the parted-devel
mailing list