summaryrefslogtreecommitdiff
path: root/doc/dfilter2pod.pl
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2009-04-17 03:53:19 +0000
committerGerald Combs <gerald@wireshark.org>2009-04-17 03:53:19 +0000
commitb6dda791d29ec30b878860a462146e30013402f8 (patch)
tree3549cd58bbfd6b2110cbf9a675f92b79f833f455 /doc/dfilter2pod.pl
parent7b3b6ed3f94dd69f369124512f0357019f23cf73 (diff)
downloadwireshark-b6dda791d29ec30b878860a462146e30013402f8.tar.gz
When building the wireshark-filter documentation on Windows, try to
figure out if we can run TShark. If we can't, just insert the dfref URL in the documentation. svn path=/trunk/; revision=28071
Diffstat (limited to 'doc/dfilter2pod.pl')
-rwxr-xr-xdoc/dfilter2pod.pl50
1 files changed, 30 insertions, 20 deletions
diff --git a/doc/dfilter2pod.pl b/doc/dfilter2pod.pl
index da2ac73a9e..143e8c6838 100755
--- a/doc/dfilter2pod.pl
+++ b/doc/dfilter2pod.pl
@@ -11,6 +11,8 @@
#
# $Id$
+use Getopt::Std;
+
%ftenum_names = (
'FT_NONE', 'No value',
'FT_PROTOCOL', 'Protocol',
@@ -39,31 +41,39 @@
'FT_FRAMENUM', 'Frame number',
);
-# Read all the data into memory
-while (<STDIN>) {
- next unless (/^([PF])/);
-
- $record_type = $1;
- # Strip the line from its line-end sequence
- # chomp($_) won't work on Win32/CygWin as it leaves the '\r' character.
- $_ =~ s/[\r\n]//g;
+getopts('e');
- # Store protocol information
- if ($record_type eq 'P') {
- ($junk, $name, $abbrev) = split(/\t+/, $_);
- $proto_abbrev{$name} = $abbrev;
- }
- # Store header field information
- else {
- ($junk, $name, $abbrev, $type, $parent, $blurb) =
- split(/\t+/, $_);
- push(@{$field_abbrev{$parent}}, $abbrev);
- $field_info{$abbrev} = [ $name, $type, $blurb ];
+if ($opt_e) {
+ $proto_abbrev{'Unable to generate filter documentation'} =
+ 'Please refer to http://www.wireshark.org/docs/dfref/';
+ printf STDERR "Creating empty filter list.\n";
+} else {
+ # Read all the data into memory
+ while (<STDIN>) {
+ next unless (/^([PF])/);
+
+ $record_type = $1;
+ # Strip the line from its line-end sequence
+ # chomp($_) won't work on Win32/CygWin as it leaves the '\r' character.
+ $_ =~ s/[\r\n]//g;
+
+ # Store protocol information
+ if ($record_type eq 'P') {
+ ($junk, $name, $abbrev) = split(/\t+/, $_);
+ $proto_abbrev{$name} = $abbrev;
+ }
+ # Store header field information
+ else {
+ ($junk, $name, $abbrev, $type, $parent, $blurb) =
+ split(/\t+/, $_);
+ push(@{$field_abbrev{$parent}}, $abbrev);
+ $field_info{$abbrev} = [ $name, $type, $blurb ];
+ }
}
}
# if there was no input on stdin, bail out
-if ($record_type ne 'P' and $record_type ne 'F') {
+if ($record_type ne 'P' and $record_type ne 'F' and !defined($opt_e)) {
exit;
}