Re: [PATCH v2 1/2] i2c-tools: Use getopt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 09, 2022 at 11:03:26AM +0200, Jean Delvare wrote:
> Use the standard C getopt() function instead of parsing the options
> manually. The benefit of this move is that getopt() supports merged
> flags (for example -fy instead of -f -y) and does not require options
> to come first on the command line. As this is pretty standard by now,
> not supporting such possibilities can confuse and disappoint the user.
> 
> Based on a preliminary patch from David Kerns.
> 
> Signed-off-by: Jean Delvare <jdelvare@xxxxxxx>
> ---
> Note: For i2ctransfer, I chose to keep arg_idx although it has the same
> meaning as getopt's optind variable, as I'm not sure if it is considered
> an acceptable practice for the caller to tinkle with it. If it is then
> we could get rid of arg_idx and use optind everywhere instead.

I think we can improve that incrementally once we find out. A quick
glimpse from my side also did not reveal any conclusion. So:

Reviewed-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>

Thank you for doing it!

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux