From 6c697a81e7ef056dd096d43b38b2bdafb73dfa95 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 11 Apr 2014 18:35:16 -0300 Subject: [PATCH] dvb-zap: fix --search argument The search argument is used to filter the monitored traffic. Also, it requires a string as argument. Fix it. Signed-off-by: Mauro Carvalho Chehab --- utils/dvb/dvbv5-zap.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/utils/dvb/dvbv5-zap.c b/utils/dvb/dvbv5-zap.c index bff993f..e32d028 100644 --- a/utils/dvb/dvbv5-zap.c +++ b/utils/dvb/dvbv5-zap.c @@ -74,7 +74,7 @@ static const struct argp_option options[] = { {"input-format", 'I', "format", 0, "Input format: ZAP, CHANNEL, DVBV5 (default: DVBV5)", 0}, {"lna", 'w', "LNA (0, 1, -1)", 0, "enable/disable/auto LNA power", 0}, {"lnbf", 'l', "LNBf_type", 0, "type of LNBf to use. 'help' lists the available ones", 0}, - {"search", 'L', NULL, 0, "search/look for a string inside the traffic", 0}, + {"search", 'L', "string", 0, "search/look for a string inside the traffic", 0}, {"monitor", 'm', NULL, 0, "monitors de DVB traffic", 0}, {"output", 'o', "file", 0, "output filename (use -o - for stdout)", 0}, {"pat", 'p', NULL, 0, "add pat and pmt to TS recording (implies -r)", 0}, @@ -721,6 +721,12 @@ int main(int argc, char **argv) return -1; } + if (!args.traffic_monitor && args.search) { + fprintf(stderr, "ERROR: search string can be used only on monitor mode\n"); + argp_help(&argp, stderr, ARGP_HELP_STD_HELP, PROGRAM_NAME); + return -1; + } + if (args.lnb_name) { lnb = dvb_sat_search_lnb(args.lnb_name); if (lnb < 0) { -- 2.7.4