From 3e5bc2687fc23309ad46872fc5accde2af82ea87 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Fri, 21 Aug 2015 15:23:58 +0200 Subject: [PATCH 1/1] Restore the default of "pulseview foo.sr" opening the file. 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. --- main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 62397239..97a61280 100644 --- 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 -- 2.30.2