< prev index next >
src/java.scripting/share/classes/com/sun/tools/script/shell/Main.java
Print this page
rev 48074 : 8189102: All tools should support -?, -h and --help
Reviewed-by: kvn, jjg, weijun, alanb, rfield, ksrini
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -120,11 +120,15 @@
// do not allow empty property name
usage(EXIT_CMD_NO_PROPNAME);
}
}
continue;
- } else if (arg.equals("-?") || arg.equals("-help")) {
+ } else if (arg.equals("-?") ||
+ arg.equals("-h") ||
+ arg.equals("--help") ||
+ // -help: legacy.
+ arg.equals("-help")) {
usage(EXIT_SUCCESS);
} else if (arg.equals("-e")) {
seenScript = true;
if (++i == args.length)
usage(EXIT_CMD_NO_SCRIPT);
< prev index next >