mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Fix command-line tty-device|config parsing
Allow user to add options on both sides of the provided config argument. For example: $ tio -b 9600 am64-evm -e Before, tio only allowed adding arguments after the config argument. Implemented as simple as possible by introducing two stage option parsing.
This commit is contained in:
parent
bd5f542959
commit
a0d4be068b
5 changed files with 30 additions and 19 deletions
12
src/main.c
12
src/main.c
|
|
@ -42,13 +42,15 @@ int main(int argc, char *argv[])
|
|||
/* Add error exit handler */
|
||||
atexit(&error_exit);
|
||||
|
||||
/* Parse configuration file */
|
||||
config_file_parse(argc, argv);
|
||||
atexit(&config_exit);
|
||||
|
||||
/* Parse command-line options */
|
||||
/* Parse command-line options (1st pass) */
|
||||
options_parse(argc, argv);
|
||||
|
||||
/* Parse configuration file */
|
||||
config_file_parse();
|
||||
|
||||
/* Parse command-line options (2nd pass) */
|
||||
options_parse_final(argc, argv);
|
||||
|
||||
/* List available serial devices */
|
||||
if (option.list_devices)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue