This used to work in e.g. the 0.2.0 release and is much more convenient
than having to supply "-i" for every file. It also allows for (easier, at
least) association of the .sr extension with PulseView on most OSes.
}
}
- if (argc != optind) {
- fprintf(stderr, "Unexpected argument: %s\n", argv[optind]);
+ if (argc - optind > 1) {
+ fprintf(stderr, "Only one file can be openened.\n");
return 1;
+ } else if (argc - optind == 1) {
+ open_file = argv[argc - 1];
}
// Initialise libsigrok