[PATCH] lxc: Format --handshakefd for controller cmd fully

Michal Privoznik mprivozn at redhat.com
Mon Apr 19 09:31:46 UTC 2021


On 4/19/21 11:01 AM, Peter Krempa wrote:
> On Mon, Apr 19, 2021 at 09:34:16 +0200, Michal Privoznik wrote:
>> The command line argument is called --hanshakefd (check out
>> lxc_controller.c:main()). But the command line builder puts only
>> --handshake. This works, because there is no other argument
>> sharing the prefix.
> 
> That is an extremely questionable "feature" of the commanline parser.

Indeed. but that's how getopt_long() works. From its man page:

   Long  option names may be abbreviated if the abbreviation is unique or
   is an exact match for some defined option.

I'm not sure how to turn this behaviour off. Also, it's not just us who 
suffers from it, e.g. 'git rebase --int'.

> 
>>
>> Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>> ---
>>   src/lxc/lxc_process.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Reviewed-by: Peter Krempa <pkrempa at redhat.com>
> 

Thanks.

Michal




More information about the libvir-list mailing list