< prev index next >

src/jdk.jdi/share/classes/com/sun/tools/example/debug/tty/TTY.java

Print this page
rev 47329 : 8189102: All tools should support -?, -h and --help


 990             } else if (token.equals("-listconnectors")) {
 991                 Commands evaluator = new Commands();
 992                 evaluator.commandConnectors(Bootstrap.virtualMachineManager());
 993                 return;
 994             } else if (token.equals("-connect")) {
 995                 /*
 996                  * -connect allows the user to pick the connector
 997                  * used in bringing up the target VM. This allows
 998                  * use of connectors other than those in the reference
 999                  * implementation.
1000                  */
1001                 if (connectSpec != null) {
1002                     usageError("cannot redefine existing connection", token);
1003                     return;
1004                 }
1005                 if (i == (argv.length - 1)) {
1006                     usageError("No connect specification.");
1007                     return;
1008                 }
1009                 connectSpec = argv[++i];
1010             } else if (token.equals("-help")) {

1011                 usage();
1012             } else if (token.equals("-version")) {
1013                 Commands evaluator = new Commands();
1014                 evaluator.commandVersion(progname,
1015                                          Bootstrap.virtualMachineManager());
1016                 System.exit(0);
1017             } else if (token.startsWith("-")) {
1018                 usageError("invalid option", token);
1019                 return;
1020             } else {
1021                 // Everything from here is part of the command line
1022                 cmdLine = addArgument("", token);
1023                 for (i++; i < argv.length; i++) {
1024                     cmdLine = addArgument(cmdLine, argv[i]);
1025                 }
1026                 break;
1027             }
1028         }
1029 
1030         /*




 990             } else if (token.equals("-listconnectors")) {
 991                 Commands evaluator = new Commands();
 992                 evaluator.commandConnectors(Bootstrap.virtualMachineManager());
 993                 return;
 994             } else if (token.equals("-connect")) {
 995                 /*
 996                  * -connect allows the user to pick the connector
 997                  * used in bringing up the target VM. This allows
 998                  * use of connectors other than those in the reference
 999                  * implementation.
1000                  */
1001                 if (connectSpec != null) {
1002                     usageError("cannot redefine existing connection", token);
1003                     return;
1004                 }
1005                 if (i == (argv.length - 1)) {
1006                     usageError("No connect specification.");
1007                     return;
1008                 }
1009                 connectSpec = argv[++i];
1010             // -help: legacy. Undocumented.
1011             } else if (token.equals("-?") || token.equals("-h") || token.equals("--help") || token.equals("-help")) {
1012                 usage();
1013             } else if (token.equals("-version")) {
1014                 Commands evaluator = new Commands();
1015                 evaluator.commandVersion(progname,
1016                                          Bootstrap.virtualMachineManager());
1017                 System.exit(0);
1018             } else if (token.startsWith("-")) {
1019                 usageError("invalid option", token);
1020                 return;
1021             } else {
1022                 // Everything from here is part of the command line
1023                 cmdLine = addArgument("", token);
1024                 for (i++; i < argv.length; i++) {
1025                     cmdLine = addArgument(cmdLine, argv[i]);
1026                 }
1027                 break;
1028             }
1029         }
1030 
1031         /*


< prev index next >