Discussion:
HEADSUP: i2c(8) has been washed and ironed
Poul-Henning Kamp
2021-05-13 12:09:55 UTC
Permalink
I have renovated the i2c(8) program and while I belive all argument
processing is 100% compatible, various undocumented aspects of the
program may have changed, amongst these precisely what goes to
stdout and stderr.

Apologies if this breaks any of your scripts.

<bikeshed>

There is one aspect of this program which I have not changed, but
which bugs me utterly: All arguments are in hex, except [-c count]
which is decimal.

My personal preference would be if all the arguments called strtoul(3)
with zero third argument, so that users can use decimal, octal or
hex as they prefer, but I fear that would break pretty much every
single script.

Alternatively [-c count] could be changed to be hex like the rest.

</bikeshed>
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
***@FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
Rodney W. Grimes
2021-05-13 19:13:12 UTC
Permalink
Post by Poul-Henning Kamp
I have renovated the i2c(8) program and while I belive all argument
processing is 100% compatible, various undocumented aspects of the
program may have changed, amongst these precisely what goes to
stdout and stderr.
Apologies if this breaks any of your scripts.
<bikeshed>
<blue>
Post by Poul-Henning Kamp
There is one aspect of this program which I have not changed, but
which bugs me utterly: All arguments are in hex, except [-c count]
which is decimal.
My personal preference would be if all the arguments called strtoul(3)
with zero third argument, so that users can use decimal, octal or
hex as they prefer, but I fear that would break pretty much every
single script.
Alternatively [-c count] could be changed to be hex like the rest.
What about adding a new flag to enable strtoul behavior?
Or invoked by another name i2cX and install a hard link?
Post by Poul-Henning Kamp
</bikeshed>
</blue>
--
Rod Grimes ***@freebsd.org
jake h
2021-05-14 01:43:45 UTC
Permalink
Post by Rodney W. Grimes
What about adding a new flag to enable strtoul behavior?
I have had a look at the available flag options for a potential strtoul
flag, and a flag that makes sense to me is [-s] / [--strtoul]. [-s] is not
currently being used in i2c, if we wanted to use it.

On Fri, May 14, 2021 at 5:13 AM Rodney W. Grimes <
Post by Rodney W. Grimes
Post by Poul-Henning Kamp
I have renovated the i2c(8) program and while I belive all argument
processing is 100% compatible, various undocumented aspects of the
program may have changed, amongst these precisely what goes to
stdout and stderr.
Apologies if this breaks any of your scripts.
<bikeshed>
<blue>
Post by Poul-Henning Kamp
There is one aspect of this program which I have not changed, but
which bugs me utterly: All arguments are in hex, except [-c count]
which is decimal.
My personal preference would be if all the arguments called strtoul(3)
with zero third argument, so that users can use decimal, octal or
hex as they prefer, but I fear that would break pretty much every
single script.
Alternatively [-c count] could be changed to be hex like the rest.
What about adding a new flag to enable strtoul behavior?
Or invoked by another name i2cX and install a hard link?
Post by Poul-Henning Kamp
</bikeshed>
</blue>
--
Rod Grimes
_______________________________________________
https://lists.freebsd.org/mailman/listinfo/freebsd-current
Poul-Henning Kamp
2021-05-14 08:10:55 UTC
Permalink
--------
Post by jake h
Post by Rodney W. Grimes
What about adding a new flag to enable strtoul behavior?
I have had a look at the available flag options for a potential strtoul
flag, and a flag that makes sense to me is [-s] / [--strtoul]. [-s] is not
currently being used in i2c, if we wanted to use it.
-s is already used to select "scan" mode.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
***@FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
Loading...