From bcae998048190ce70ae9d0cbc05dc61e9e66c3b4 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Wed, 22 Jun 2016 14:41:16 -0700 Subject: Qt: Support the -j, -J, and -l command line flags Add support for -j, -J, and -l. Mark the -m flag deprecated. Bug: 12546 Change-Id: Ic44b3997840018e5d571aa1813a1646bce11d4a6 Reviewed-on: https://code.wireshark.org/review/16083 Reviewed-by: Gerald Combs Petri-Dish: Gerald Combs Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- wireshark-qt.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'wireshark-qt.cpp') diff --git a/wireshark-qt.cpp b/wireshark-qt.cpp index 16fc62dc2e..cf73e5deb9 100644 --- a/wireshark-qt.cpp +++ b/wireshark-qt.cpp @@ -796,6 +796,22 @@ int main(int argc, char *argv[]) /* Jump to the specified frame number, kept for backward compatibility. */ cf_goto_frame(CaptureFile::globalCapFile(), commandline_info.go_to_packet); + } else if (commandline_info.jfilter != NULL) { + dfilter_t *jump_to_filter = NULL; + /* try to compile given filter */ + if (!dfilter_compile(commandline_info.jfilter, &jump_to_filter, &err_msg)) { + // Similar code in MainWindow::mergeCaptureFile(). + QMessageBox::warning(main_w, QObject::tr("Invalid Display Filter"), + QObject::tr("The filter expression %1 isn't a valid display filter. (%2).") + .arg(commandline_info.jfilter, err_msg), + QMessageBox::Ok); + g_free(err_msg); + } else { + /* Filter ok, jump to the first packet matching the filter + conditions. Default search direction is forward, but if + option d was given, search backwards */ + cf_find_packet_dfilter(CaptureFile::globalCapFile(), jump_to_filter, commandline_info.jump_backwards); + } } } } -- cgit v1.2.3