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:
parent
4d7876aa70
commit
67bceb38f4
@ -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':
|
||||
|
Loading…
Reference in New Issue
Block a user