Have Ethereal, when invoked as "ethereal-dump-fields", dump out a
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 5 Aug 1999 06:34:43 +0000 (06:34 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 5 Aug 1999 06:34:43 +0000 (06:34 +0000)
glossary of display filter symbols, just as it does with "-G", except
that, as it can discover that it was so invoked before even looking at
the command-line arguments, it needn't even bother calling "gtk_init()"
to process those command-line arguments GTK+ cares about, and thus
needn't do any X stuff at all when so invoked.

That allows Ethereal to be built in an environment where you don't have
an X server, and, if your connection to your X server is slow, allows
you to built it faster.

Get rid of the "-G" flag, as it had only a somewhat specialized use.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@444 f5534014-38df-0310-8fa8-9805f1628bb7

doc/Makefile
doc/ethereal.pod.template
ethereal.c

index bebb155d0ba665d8d8684ca6345e82871cbbfa4a..335109d1ea96f005e6d797f99ef9f020dd133ec6 100644 (file)
@@ -5,5 +5,7 @@
        > ../ethereal.1
 
 ethereal.pod: ethereal.pod.template  ../ethereal
-       ../ethereal -G | ./dfilter2pod ethereal.pod.template > ethereal.pod
-
+       rm -f ethereal-dump-fields
+       ln ../ethereal ethereal-dump-fields
+       ./ethereal-dump-fields | ./dfilter2pod ethereal.pod.template > ethereal.pod
+       rm -f ethereal-dump-fields
index 641049ed065912dd839e4ccbd2345f28f3c80473..441a21a5ebb6b67a12ea839bb6b6c1a5a4572aa5 100644 (file)
@@ -11,7 +11,6 @@ S<[ B<-b> bold font ]>
 S<[ B<-c> count ]>
 S<[ B<-F> ]>
 S<[ B<-f> filter expression ]>
-S<[ B<-G> ]>
 S<[ B<-h> ]>
 S<[ B<-i> interface ]> 
 S<[ B<-k> ]>
@@ -81,10 +80,6 @@ packets actually captured.
 
 Sets the capture filter expression.
 
-=item -G
-
-Dumps a glossary of display filter keywords to stdout and exits.
-
 =item -h
 
 Prints the version and options and exits.
index 038a0651bf9fd23f8c374fa6979bea84d8c4eac3..fc15a10f2b523b81cd8fb14e224ba99a8d1c2caf 100644 (file)
@@ -1,6 +1,6 @@
 /* ethereal.c
  *
- * $Id: ethereal.c,v 1.73 1999/08/04 03:37:44 gram Exp $
+ * $Id: ethereal.c,v 1.74 1999/08/05 06:34:34 guy Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -958,6 +958,7 @@ print_usage(void) {
 int
 main(int argc, char *argv[])
 {
+  char               *command_name;
   int                  i;
 #ifndef WIN32
   int                  opt;
@@ -979,10 +980,26 @@ main(int argc, char *argv[])
 
   ethereal_path = argv[0];
 
+  /* If invoked as "ethereal-dump-fields", we dump out a glossary of
+     display filter symbols; we specify that by checking the name,
+     so that we can do so before looking at the argument list -
+     we don't want to look at the argument list, because we don't
+     want to call "gtk_init()", because we don't want to have to
+     do any X stuff just to do a build. */
+  command_name = strchr(ethereal_path, '/');
+  if (command_name == NULL)
+    command_name = ethereal_path;
+  else
+    command_name++;
+  if (strcmp(command_name, "ethereal-dump-fields") == 0) {
+    ethereal_proto_init();
+    proto_registrar_dump();
+    exit(0);
+  }
+  
   /* Let GTK get its args */
   gtk_init (&argc, &argv);
   
-
   prefs = read_prefs(&pf_path);
   if (pf_path != NULL) {
     /* The preferences file exists, but couldn't be opened; "pf_path" is
@@ -1029,7 +1046,7 @@ main(int argc, char *argv[])
 
 #ifndef WIN32
   /* Now get our args */
-  while ((opt = getopt(argc, argv, "b:B:c:f:FGhi:km:nP:Qr:Ss:t:T:w:v")) != EOF) {
+  while ((opt = getopt(argc, argv, "b:B:c:f:Fhi:km:nP:Qr:Ss:t:T:w:v")) != EOF) {
     switch (opt) {
       case 'b':               /* Bold font */
        bold_font = g_strdup(optarg);
@@ -1048,10 +1065,6 @@ main(int argc, char *argv[])
         fork_mode = 1;
         break;
 #endif
-      case 'G':                /* print glossary of display filter symbols */
-       ethereal_proto_init();
-       proto_registrar_dump();
-       exit(0);
       case 'h':        /* Print help and exit */
        print_usage();
        exit(0);