aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>1999-08-05 06:34:43 +0000
committerGuy Harris <guy@alum.mit.edu>1999-08-05 06:34:43 +0000
commiteca1e74373de9fc1fb0ae1e3fa9a3e3bd1587824 (patch)
tree93047b4b7fa14f6a61f522da518de9b917884868 /ethereal.c
parentd7dc4260928708469a6be81213600f63dbf0b5cc (diff)
Have Ethereal, when invoked as "ethereal-dump-fields", dump out a
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. svn path=/trunk/; revision=444
Diffstat (limited to 'ethereal.c')
-rw-r--r--ethereal.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/ethereal.c b/ethereal.c
index 038a0651bf..fc15a10f2b 100644
--- a/ethereal.c
+++ b/ethereal.c
@@ -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);