From: Wolfram Sang <wsa@kernel.org>
To: Jean Delvare <jdelvare@suse.de>
Cc: Linux I2C <linux-i2c@vger.kernel.org>,
david kerns <david.t.kerns@gmail.com>
Subject: Re: [PATCH v2 1/2] i2c-tools: Use getopt
Date: Sat, 14 May 2022 15:53:14 +0200 [thread overview]
Message-ID: <Yn+0SrNnWpkCeib6@shikoro> (raw)
In-Reply-To: <20220509110326.53e4b669@endymion.delvare>
[-- Attachment #1: Type: text/plain, Size: 1057 bytes --]
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@suse.de>
> ---
> 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@sang-engineering.com>
Thank you for doing it!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2022-05-14 13:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-09 9:03 [PATCH v2 1/2] i2c-tools: Use getopt Jean Delvare
2022-05-09 9:08 ` [PATCH v2 2/2] i2c-tools: Implement and document option -h Jean Delvare
2022-05-14 13:53 ` Wolfram Sang
2022-05-14 13:53 ` Wolfram Sang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yn+0SrNnWpkCeib6@shikoro \
--to=wsa@kernel.org \
--cc=david.t.kerns@gmail.com \
--cc=jdelvare@suse.de \
--cc=linux-i2c@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox