For PR libgcj/5303:
* gnu/java/rmi/registry/RegistryImpl.java (main): Recognize --help and --version. (help): New method. (version): Likewise. * gnu/gcj/convert/Convert.java (version): Removed extraneous "GNU". * gnu/java/rmi/rmic/RMIC.java (parseOptions): Removed extraneous "GNU". From-SVN: r51343
This commit is contained in:
parent
355426abb3
commit
f695acf69c
4 changed files with 41 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (c) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
|
||||
Copyright (c) 1996, 1997, 1998, 1999, 2002 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
|
@ -103,9 +103,35 @@ public String[] list() throws RemoteException, AccessException {
|
|||
return (strings);
|
||||
}
|
||||
|
||||
public static void version() {
|
||||
System.out.println("rmiregistry ("
|
||||
+ System.getProperty("java.vm.name")
|
||||
+ ") "
|
||||
+ System.getProperty("java.vm.version"));
|
||||
System.out.println("Copyright 2002 Free Software Foundation, Inc.");
|
||||
System.out.println("This is free software; see the source for copying conditions. There is NO");
|
||||
System.out.println("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.");
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public static void help() {
|
||||
System.out.println(
|
||||
"Usage: rmiregistry [OPTION | PORT]\n" +
|
||||
"\n" +
|
||||
" --help Print this help, then exit\n" +
|
||||
" --version Print version number, then exit\n");
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
int port = Registry.REGISTRY_PORT;
|
||||
if (args.length > 0) {
|
||||
if (args[0].equals("--version")) {
|
||||
version();
|
||||
}
|
||||
else if (args[0].equals("--help")) {
|
||||
help();
|
||||
}
|
||||
try {
|
||||
port = Integer.parseInt(args[0]);
|
||||
}
|
||||
|
|
|
@ -939,7 +939,7 @@ private void parseOptions() {
|
|||
usage();
|
||||
}
|
||||
else if (arg.equals("-version")) {
|
||||
System.out.println("rmic (GNU "
|
||||
System.out.println("rmic ("
|
||||
+ System.getProperty("java.vm.name")
|
||||
+ ") "
|
||||
+ System.getProperty("java.vm.version"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue