1
0
mirror of https://github.com/UzixLS/picocom.git synced 2025-07-19 07:21:18 +03:00

Add compatibility with 1.x

This allows 2.x to use the same switches as 1.x thus allowing for it to be a drop-in replacement.

This is especially useful where picocom is used from a proprietary binary.
This commit is contained in:
Ben Holmes
2017-07-04 18:28:54 +10:00
parent deffd18c24
commit d8433da4b0

View File

@ -1420,6 +1420,8 @@ parse_args(int argc, char *argv[])
switch (optarg[0]) {
case 'X':
case 'x':
case 'S':
case 's':
opts.flow = FC_XONXOFF;
break;
case 'H':
@ -1481,13 +1483,22 @@ parse_args(int argc, char *argv[])
}
break;
case 'p':
opts.stopbits = 1;
switch (optarg[0]) {
case '1':
opts.stopbits = 1;
break;
case '2':
opts.stopbits = 2;
break;
case 'e':
opts.parity = P_EVEN;
break;
case 'o':
opts.parity = P_ODD;
break;
case 'n':
opts.parity = P_NONE;
break;
default:
fprintf(stderr, "Invalid --stopbits: %c\n", optarg[0]);
r = -1;