Skip to content
Snippets Groups Projects
Verified Commit 1f0f9d13 authored by Tomas Krizek's avatar Tomas Krizek
Browse files

pcap/extract-clients: improve usage help

parent 0386553b
No related branches found
No related tags found
1 merge request!24dnsjit pcap processing scripts
......@@ -21,7 +21,7 @@ local input = require("dnsjit.input.pcap").new()
local output = require("dnsjit.output.pcap").new()
local layer = require("dnsjit.filter.layer").new()
local object = require("dnsjit.core.objects")
local log = require("dnsjit.core.log").new("pellet.lua")
local log = require("dnsjit.core.log").new("extract-clients.lua")
local getopt = require("dnsjit.lib.getopt").new({
{ "r", "read", "", "input file to read", "?" },
{ "w", "write", "clients%04d.pcap", "output filename template", "?" },
......@@ -48,6 +48,12 @@ args.time = getopt:val("t")
args.keep = getopt:val("k")
args.csv = getopt:val("csv") -- TODO add statistics
-- Display help
if getopt:val("help") then
getopt:usage()
return
end
-- Check arguments
if args.time < 0 then
log:fatal("time duration can't be negative")
......@@ -70,6 +76,7 @@ if args.read ~= "" then
end
log:notice("using input PCAP "..args.read)
else
getopt:usage()
log:fatal("input must be specified, use -r")
end
layer:producer(input)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment