i2c(8): fix option handling

Recognize the '-o' option when processing command line arguments.

Fixes:  9c10d00bf8 ("i2c(8): Add interpreted mode for batch/scripted...")
PR:     258572
This commit is contained in:
Martin Birgmeier 2021-10-06 21:20:56 -08:00 committed by Robert Wing
parent 4d7876aa70
commit 67bceb38f4

View file

@ -744,7 +744,7 @@ main(int argc, char** argv)
struct options i2c_opt;
const char *dev, *err_msg;
int fd, error = 0, ch;
const char *optflags = "a:f:d:o:w:c:m:n:sbvrh";
const char *optflags = "a:f:d:o:iw:c:m:n:sbvrh";
char do_what = 0;
dev = I2C_DEV;
@ -763,7 +763,7 @@ main(int argc, char** argv)
/* Find out what we are going to do */
while ((ch = getopt(argc, argv, "a:f:d:iw:c:m:n:sbvrh")) != -1) {
while ((ch = getopt(argc, argv, optflags)) != -1) {
switch(ch) {
case 'a':
case 'i':