This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: gcj-dbtool help output
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 29 Nov 2004 15:22:20 -0700
- Subject: Patch: FYI: gcj-dbtool help output
- Reply-to: tromey at redhat dot com
I'm checking this in.
This adds "--version" and "--help" to gcj-dbtool and cleans up the
help messages to have the correct program name. Whether this is a
regression depends on your point of view; I think it falls into
"documentation fixes".
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* gnu/gcj/tools/gcj_dbtool/Main.java (main): Mention gcj-dbtool.
Recognize --help and --version.
(usage): Mention gcj-dbtool. Added "out" argument.
(insist): Updated.
Index: gnu/gcj/tools/gcj_dbtool/Main.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/gcj/tools/gcj_dbtool/Main.java,v
retrieving revision 1.2
diff -u -r1.2 Main.java
--- gnu/gcj/tools/gcj_dbtool/Main.java 25 Nov 2004 03:46:59 -0000 1.2
+++ gnu/gcj/tools/gcj_dbtool/Main.java 29 Nov 2004 22:21:48 -0000
@@ -21,10 +21,10 @@
public static void main (String[] s)
{
insist (s.length >= 1);
- if (s[0].equals("-v"))
+ if (s[0].equals("-v") || s[0].equals("--version"))
{
insist (s.length == 1);
- System.out.println("jv-dbtool ("
+ System.out.println("gcj-dbtool ("
+ System.getProperty("java.vm.name")
+ ") "
+ System.getProperty("java.vm.version"));
@@ -34,6 +34,11 @@
System.out.println("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.");
return;
}
+ if (s[0].equals("--help"))
+ {
+ usage(System.out);
+ return;
+ }
if (s[0].equals("-n"))
{
@@ -60,7 +65,7 @@
if (capacity <= 2)
{
- usage();
+ usage(System.err);
System.exit(1);
}
}
@@ -199,7 +204,7 @@
return;
}
- usage();
+ usage(System.err);
System.exit(1);
}
@@ -207,22 +212,22 @@
{
if (! ok)
{
- usage();
+ usage(System.err);
System.exit(1);
}
}
- private static void usage()
+ private static void usage(PrintStream out)
{
- System.err.println
- ("jv-dbtool: Manipulate gcj map database files\n"
+ out.println
+ ("gcj-dbtool: Manipulate gcj map database files\n"
+ "\n"
+ " Usage: \n"
- + " jv-dbtool -n file.gcjdb [size] - Create a new gcj map database\n"
- + " jv-dbtool -a file.gcjdb file.jar file.so\n"
+ + " gcj-dbtool -n file.gcjdb [size] - Create a new gcj map database\n"
+ + " gcj-dbtool -a file.gcjdb file.jar file.so\n"
+ " - Add the contents of file.jar to the database\n"
- + " jv-dbtool -t file.gcjdb - Test a gcj map database\n"
- + " jv-dbtool -l file.gcjdb - List a gcj map database\n");
+ + " gcj-dbtool -t file.gcjdb - Test a gcj map database\n"
+ + " gcj-dbtool -l file.gcjdb - List a gcj map database\n");
}