OPT_TIMESTAMP_FORMAT,
OPT_LOG_FILE,
OPT_LOG_STRIP,
+ OPT_LOG_APPEND,
OPT_LINE_PULSE_DURATION,
OPT_RESPONSE_TIMEOUT,
OPT_RS485,
{"list-devices", no_argument, 0, 'L' },
{"log", no_argument, 0, 'l' },
{"log-file", required_argument, 0, OPT_LOG_FILE },
+ {"log-append", no_argument, 0, OPT_LOG_APPEND },
{"log-strip", no_argument, 0, OPT_LOG_STRIP },
{"socket", required_argument, 0, 'S' },
{"map", required_argument, 0, 'm' },
option.log_strip = true;
break;
+ case OPT_LOG_APPEND:
+ option.log_append = true;
+ break;
+
case 'S':
option.socket = optarg;
break;
optind = 1; // Reset option index to restart scanning of argv
options_parse(argc, argv);
+#ifdef __CYGWIN__
+ unsigned char portnum;
+ char *tty_win;
+ if ( ((strncmp("COM", tty_device, 3) == 0)
+ || (strncmp("com", tty_device, 3) == 0) )
+ && (sscanf(tty_device + 3, "%hhu", &portnum) == 1)
+ && (portnum > 0) )
+ {
+ asprintf(&tty_win, "/dev/ttyS%hhu", portnum - 1);
+ tty_device = tty_win;
+ }
+#endif
+
/* Restore tty device */
option.tty_device = tty_device;
}