logger: Check for unused arguments

There is no place for unused arguments, their are consequence of invalid
argument list as usual.
Such an situation is highly possible especially during defining trace
filters, eg `-Fv=mux 4.1` instead `-F"v=mux 4.1"` or `-Fv=mux4.1`.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This commit is contained in:
Karol Trzcinski 2020-10-20 10:09:01 +02:00 committed by Liam Girdwood
parent 7709924f16
commit 9e131360fc
1 changed files with 5 additions and 0 deletions

View File

@ -262,6 +262,11 @@ int main(int argc, char *argv[])
}
}
if (argc != optind) {
fprintf(stderr, "error: Unused parameter '%s'\n", argv[optind]);
usage();
}
if (snapshot_file)
return baud ? EINVAL : -snapshot(snapshot_file);