Commit 233f10d3 by Tom Tromey Committed by Tom Tromey

* jcf-dump.c (main): Correctly recognize `--'-style long options.

From-SVN: r23607
parent 2a55b8e8
1998-11-11 Tom Tromey <tromey@cygnus.com>
* jcf-dump.c (main): Correctly recognize `--'-style long options.
Tue Nov 10 12:34:03 1998 Alexandre Petit-Bianco <apbianco@cygnus.com> Tue Nov 10 12:34:03 1998 Alexandre Petit-Bianco <apbianco@cygnus.com>
* class.c (is_compiled_class): Call safe_layout_class for class * class.c (is_compiled_class): Call safe_layout_class for class
......
...@@ -718,39 +718,37 @@ DEFUN(main, (argc, argv), ...@@ -718,39 +718,37 @@ DEFUN(main, (argc, argv),
{ {
char *arg = argv[argi]; char *arg = argv[argi];
/* Just let all arguments be given in either "-" or "--" form. */
if (arg[0] != '-' || ! strcmp (arg, "--")) if (arg[0] != '-' || ! strcmp (arg, "--"))
break; break;
if (arg[0] == '-') /* Just let all arguments be given in either "-" or "--" form. */
if (arg[1] == '-')
++arg;
if (strcmp (arg, "-o") == 0 && argi + 1 < argc)
output_file = argv[++argi];
else if (strcmp (arg, "-classpath") == 0 && argi + 1 < argc)
jcf_path_classpath_arg (argv[++argi]);
else if (strcmp (arg, "-CLASSPATH") == 0 && argi + 1 < argc)
jcf_path_CLASSPATH_arg (argv[++argi]);
else if (strncmp (arg, "-I", 2) == 0)
jcf_path_include_arg (arg + 2);
else if (strcmp (arg, "-verbose") == 0)
verbose++;
else if (strcmp (arg, "-print-main") == 0)
flag_print_main++;
else if (strcmp (arg, "-c") == 0)
flag_disassemble_methods++;
else if (strcmp (arg, "-javap") == 0)
{ {
if (strcmp (arg, "-o") == 0 && argi + 1 < argc) flag_javap_compatible++;
output_file = argv[++argi]; flag_print_constant_pool = 0;
else if (strcmp (arg, "-classpath") == 0 && argi + 1 < argc)
jcf_path_classpath_arg (argv[++argi]);
else if (strcmp (arg, "-CLASSPATH") == 0 && argi + 1 < argc)
jcf_path_CLASSPATH_arg (argv[++argi]);
else if (strncmp (arg, "-I", 2) == 0)
jcf_path_include_arg (arg + 2);
else if (strcmp (arg, "-verbose") == 0)
verbose++;
else if (strcmp (arg, "-print-main") == 0)
flag_print_main++;
else if (strcmp (arg, "-c") == 0)
flag_disassemble_methods++;
else if (strcmp (arg, "-javap") == 0)
{
flag_javap_compatible++;
flag_print_constant_pool = 0;
}
else
{
fprintf (stderr, "%s: illegal argument\n", argv[argi]);
exit (FATAL_EXIT_CODE);
}
} }
else else
break; {
fprintf (stderr, "%s: illegal argument\n", argv[argi]);
exit (FATAL_EXIT_CODE);
}
} }
if (argi == argc) if (argi == argc)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment