04.06.2021 10:19, Paolo Bonzini wrote:
On 03/06/21 14:19, Vladimir Sementsov-Ogievskiy wrote:

Double-dash options give extra information to the user that short (single-dash) 
options can be combined, while this is not the case for iotests/check.

You can combine short options for check script, as argparse supports it.

We don't have many short options yet.. But something like

./check -ng auto

makes sense and works..

Oh, I missed that.  Then it's okay, thanks!


Actually, I understand that my arguing against -gdb was time wasting 
nit-picking, sorry for that :\

When I've rewritten check into python, I decided that "I like double-dash options, 
they are modern and more usual and look nice", and used double dash for new 
options.. Nobody complained, so now we have inconsistent options, thanks to me :( 
Probably, I should have added new options with one dash. That's all not really 
significant, as check script is only a testing tool.. Still, inconsistency never helps.

Anyway now we have what we have.

So, there are some ways to improve the situation:

1. Take this patch and do nothing more.

Pros: as said in commit message, more consistency with qemu-io and qemu-nbd.
Cons: we still have -qcow2, -nbd, -raw, etc format and protocol options

2. Take this patch and also convert protocol and format options

Pros: everything is consistent and use two dashes, so we can safely use 
combining short options syntax
Cons: more pain for developers to write --qcow2 instead of -qcow2 every time. 
What actually stopped me of posting that patch (converting protocol and format 
options), I imagined the heavy extra load on all block-layer developers right 
pinky to push '-' one time more :))

3. Do nothing at all
Cons: all these inconsistent options

4. Convert new options to one dash
Pros: less pain of converting, as new options should be rarely used (unlike 
-qcow2 or -nbd),  and we have consistent set of options
Const: inconsistency with qemu-io and qemu-nbd
       ambiguity in using combined short options (note also, that starting from 
Python 3.8 combining short options can't be disabled)*
So, I'm OK with either way and can make patches. But I don't want to be the 
only person who makes a decision. So, let's wait for opinions, and if nobody 
really interested, go the default way [3].



* looking at https://docs.python.org/3/library/argparse.html I see:

Changed in version 3.5: allow_abbrev parameter was added.

Changed in version 3.8: In previous versions, allow_abbrev also disabled 
grouping of short flags such as -vv to mean -v -v.

--
Best regards,
Vladimir

Reply via email to