]> sigrok.org Git - pulseview.git/blobdiff - main.cpp
Restore the default of "pulseview foo.sr" opening the file.
[pulseview.git] / main.cpp
index 623972395c6c91e61b1d0dfe62590f83ba8a502f..97a61280ac5bc0462dc2da35d179ecd129a54ecf 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -128,9 +128,11 @@ int main(int argc, char *argv[])
                }
        }
 
-       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