2009/11/9 Karel Zak <[email protected]>:
> On Mon, Nov 09, 2009 at 11:17:58AM +0100, Jim Meyering wrote:
>> It seems like it'd be useful to be able to extract existing types,
>> too, so how about making the string argument optional.
>> Then, this would print the type of the first partition:
>>
>>     $ parted /dev/sda part-type 1
>
>  This reminds me ...
>
>  ... it would be also nice to have a way how set partition UUID.
>  Currently GPT UUID is always generated. Maybe we will use the UUID
>  for some userspace operations (DevKits, udev, mount, ...) and then
>  people will look for a way how to control this identifier.
>
>  (Yes, I know that UUID should be unique, but sometimes is it very
>  useful to create a new disk layout with the same UUIDs.)
>
>     $ parted /dev/sda part-uuid 89ec2a20-ab3a-4105-b5e8-b141666fbd0c
>
>  ?

From an interface point of view, such optional arguments which completely
changes the meaning of the corresponding command (i.e. part-uuid without
an argument means GET uuid, with an argument it means SET uuid)
should preferably be avoided.

It is much better to have distinct commands for each operation.
Think about when combining several commands on the command line,
for instance

     $ parted /dev/sda part-uuid part-type 1

Does this mean to try to set the UUID to "part-type"? Compare to

     $ parted /dev/sda set-type 1 00
     $ parted /dev/sda set-part-uuid 89ec2a20-ab3a-4105-b5e8-b141666fbd0c
     $ parted /dev/sda print-type 1
     $ parted /dev/sda print-part-uuid

where each command is clear and simple to understand. The "set-" prefix
does probably not add so much value, but I would strongly prefer to
add "print-" to all the get commands and make them distinct from the set
commands.

BR Håkon Løvdal

_______________________________________________
parted-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/parted-devel

Reply via email to