-
Notifications
You must be signed in to change notification settings - Fork 9
/
cli.js
33 lines (28 loc) · 763 Bytes
/
cli.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env node
'use strict';
var meow = require('meow');
var parser = require('./index');
var cli = meow({
help: [
'Usage',
' $ chrome-http2-log-parser',
'',
'Options',
' -f, --file file path containing the output of Chrome HTTP/2 net-internals log',
' --reporter html, generate a html table representing the parsed log data',
' --interval the resolution in milliseconds of the report',
'',
'Examples',
' $ chrome-http2-log-parser --file=./test/fixtures/session.txt --reporter=html --interval=5'
]
});
var flags = cli.flags;
parser(flags.f || flags.file, {
reporters: [flags.reporter],
interval: flags.interval
}, function (err, data) {
if (err) {
throw err;
}
console.log(data.reports[flags.reporter]);
});