Commit Graph

63 Commits

Author SHA1 Message Date
Guy Harris 72d9785cfc We need global_capture_opts if we have extcap, even without pcap.
Change-Id: I16b778064c1cd2bbf281fb5192bf35da252e99dd
Reviewed-on: https://code.wireshark.org/review/16179
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-27 23:49:39 +00:00
Gerald Combs bcae998048 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 <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-23 03:03:51 +00:00
Guy Harris 88b7a48bf5 Pull the options structure initialization into commandline_other_options().
Change-Id: I931cde27a81566dfa0ce6e5c9307bfc1a4d5fe54
Reviewed-on: https://code.wireshark.org/review/16033
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-20 07:00:07 +00:00
Guy Harris bea1950d07 Protect some code that's only for Wireshark-with-pcap.
Put that code inside #ifdef HAVE_LIBPCAP/#endif.

Change-Id: I85768fd49a008341a95ac3c8656e96afa6741fbe
Reviewed-on: https://code.wireshark.org/review/16030
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-20 00:42:57 +00:00
Guy Harris e79e834ecf Move some option checking to common code.
Change-Id: Icff9dacd73ea933c59ed664db05098dd8cb3dbf5
Reviewed-on: https://code.wireshark.org/review/16029
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-19 23:37:08 +00:00
Guy Harris 234d8eacec Pass the info strings directly to commandline_early_options().
Just pass them directly as arguments, don't stuff them into a structure.

Change-Id: Iac84226f54898bc953011bca64795e9049762905
Reviewed-on: https://code.wireshark.org/review/16022
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-19 21:12:41 +00:00
Guy Harris 85c805d60e Handle capture options in pcap-less Wireshark in the commandline_ routines.
Get rid of the capture_option_specified and arg_error members of the
commandline_capture_param_info_t and commandline_param_info_t
structures, and have them be local variables in
commandline_early_options() and commandline_other_options().  Have
commandline_early_options() print the "sorry, Wireshark wasn't built
with pcap" and exit if -D was specified but Wireshark wasn't built with
pcap.

Change-Id: I0efcdea89d9585af8f3c0a28aee060f33d3ec5fd
Reviewed-on: https://code.wireshark.org/review/16021
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-19 20:21:30 +00:00
Guy Harris 0ca9fc11b0 Fix indentation.
Change-Id: I71332dc35047e7d8d32b428fb99b8b9368c41de6
Reviewed-on: https://code.wireshark.org/review/16020
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-19 20:00:23 +00:00
Guy Harris 42985f4f17 Those aren't capture options, they're the options we must process early.
The only one of those options that has anything to do with packet
capture is -i, and all we do there is check for an argument of "-"; the
rest are either

	1) options that affect your preference settings (-C to select
	   the profile, -P to set the personal file directory path);

	2) options that just print something to the standard output or
	   error and exit, before firing up the GUI;

	3) extension command line options (-X).

Change-Id: Iba9b8b14fe468e2ca9d4c67e1a9b8103603678d9
Reviewed-on: https://code.wireshark.org/review/16019
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-19 19:56:04 +00:00
Michael Mann 147b3d5149 Ability to invoke "Decode As..." as command-line argument for GUIshark.
TShark has had the functionality for awhile. While the GUI version
still has ways to change and persist Decode As functionality, adding
command line functionality gives the Decode As from initial launch
of the GUI.
Was also an excuse to refactor a bunch of code out of tshark.c

Bug: 5143
Change-Id: Ie67007d75e897bc06cc9afd9b84372a96b93778c
Reviewed-on: https://code.wireshark.org/review/16008
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-19 18:59:07 +00:00
Guy Harris 6febf9b740 Get rid of an unused variable; set a structure member.
There's no need for the capture_option_specified variable, but we *do*
need to initialize the capture_option_specified member of *param_info
before parsing the flags.

Change-Id: I89d0b8c338c2784742b21ba4e854f702ce491849
Reviewed-on: https://code.wireshark.org/review/16017
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-19 16:29:39 +00:00
Guy Harris f4fd1a3640 Fix problems when compiling without pcap.
Change-Id: Id682a76ac561f92f65638bbdfcd4236eb92e46b7
Reviewed-on: https://code.wireshark.org/review/16010
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-19 07:50:09 +00:00
Michael Mann 9b5b4443cf Refactor command-line handling of GUI options.
Both GTK and Qt both use the same command-line options, so refactor
the parsing and (possibly) applying of those arguments to a single
location.

Ping-Bug: 12546
Change-Id: Ib31e576c509c5d3d21c33d3247640d9f9c68661b
Reviewed-on: https://code.wireshark.org/review/16006
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-19 05:56:45 +00:00