diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2014-11-22 11:59:50 +0100 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2014-11-25 02:52:16 +0000 |
commit | 363b87a4befcfbdd61ed7656283022a31afb2ab5 (patch) | |
tree | 730810e75c8c7d35e35c3c5ca7043250e6f9e9e1 /ui/qt/main.cpp | |
parent | e899c3e262594813fa765e44ad143d7f14d6d415 (diff) |
Qt: support the -Y option to set an initial display filter
Change-Id: I7627265b876c6994b163df1c5b037f4dae2f6d42
Reviewed-on: https://code.wireshark.org/review/5445
Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'ui/qt/main.cpp')
-rw-r--r-- | ui/qt/main.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/qt/main.cpp b/ui/qt/main.cpp index 7b244c1f3f..696a3dff71 100644 --- a/ui/qt/main.cpp +++ b/ui/qt/main.cpp @@ -502,6 +502,8 @@ int main(int argc, char *argv[]) char badopt; guint go_to_packet = 0; + QString dfilter; + cmdarg_err_init(wireshark_cmdarg_err, wireshark_cmdarg_err_cont); #ifdef _WIN32 @@ -1073,7 +1075,7 @@ int main(int argc, char *argv[]) /* ext ops were already processed just ignore them this time*/ break; case 'Y': - /* Not supported yet */ + dfilter = QString(optarg); break; case 'z': /* We won't call the init function for the stat this soon @@ -1347,6 +1349,8 @@ int main(int argc, char *argv[]) // XXX The GTK+ UI does error checking here. main_w->openCaptureFile(cf_name, display_filter, in_file_type); + if (!dfilter.isEmpty()) + main_w->filterPackets(dfilter, false); if(go_to_packet != 0) { /* Jump to the specified frame number, kept for backward compatibility. */ |