Rename the `--scan` argument to `-w/--write-file` and the `--use`
argument to `-r/--read-file`. This is more aligned with `tshark`'s
syntax, and I think it is a more intuitive naming scheme.
Remove the `--filter` and `--range` arguments. They are very easily
replaced by more powerful tools like `grep` and `jq`. It seems
unnecessary to have them in this script (specially when the most useful
thing it does is exporting the capture as NDJSON for other tools to
process). This fixes an issue with the last message not being exported.
Change the default port to `6080`. This matches the current information
[in the
book](https://book.servo.org/hacking/using-devtools.html#connecting-to-servo)
on how to run Servo with DevTools enabled.
Testing: Checked with `math test-scripts`
---------
Signed-off-by: eri <eri@igalia.com>
Instead of outputing `{"_to": "...", "message": {"to": "...", ...}}` the
JSON message is simplified to `{"to": "...", ...}`. This is possible
since all valid devtools messages include a "to" or a "from" field.
These two fields will always be placed at the start of the serialized
message, with the rest of fields being sorted alphabetically.
Simplify detection of server or client message, removing the need to
pass the devtools port when reading a .pcap file. Now the pretty message
says "Server" and "Client" instead of "Servo" and "Firefox", which was
innacurate when inspecting one instance of Firefox from another.
Testing: Check with `mach test-scripts`
Signed-off-by: eri <eri@igalia.com>