From 1fcc1b616775491d69f96edadb3a1ec62a7eb73f Mon Sep 17 00:00:00 2001 From: Jan Materne Date: Wed, 3 Sep 2003 14:19:07 +0000 Subject: [PATCH] New shortcuts for ant options: -d --> -debug -e --> -emacs -h --> -help -p --> -projecthelp -s --> -find git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275178 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 5 ++++- src/main/org/apache/tools/ant/Main.java | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index 9ece8c1ce..c9b0f376e 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -585,6 +585,9 @@ Other changes: this type can be nested in the and tasks. Bugzilla Report 22533. +* additional shortcuts for ant options (-d --> -debug, -e --> -emacs, + -h --> -help, -p --> -projecthelp, -s --> -find) + Changes from Ant 1.5.3 to Ant 1.5.4 =================================== @@ -2491,4 +2494,4 @@ cases. * The packagelistloc attribute of 's child will be resolved as a file (i.e. it is either absolute or relative to - basedir). + basedir). \ No newline at end of file diff --git a/src/main/org/apache/tools/ant/Main.java b/src/main/org/apache/tools/ant/Main.java index 1d8131010..e2442021e 100644 --- a/src/main/org/apache/tools/ant/Main.java +++ b/src/main/org/apache/tools/ant/Main.java @@ -303,7 +303,7 @@ public class Main implements AntMain { for (int i = 0; i < args.length; i++) { String arg = args[i]; - if (arg.equals("-help")) { + if (arg.equals("-help") || arg.equals("-h")) { printUsage(); return; } else if (arg.equals("-version")) { @@ -317,7 +317,7 @@ public class Main implements AntMain { } else if (arg.equals("-verbose") || arg.equals("-v")) { printVersion(); msgOutputLevel = Project.MSG_VERBOSE; - } else if (arg.equals("-debug")) { + } else if (arg.equals("-debug") || arg.equals("-d")) { printVersion(); msgOutputLevel = Project.MSG_DEBUG; } else if (arg.equals("-noinput")) { @@ -407,12 +407,12 @@ public class Main implements AntMain { + " using the -inputhandler" + " argument"); } - } else if (arg.equals("-emacs")) { + } else if (arg.equals("-emacs") || arg.equals("-e")) { emacsMode = true; - } else if (arg.equals("-projecthelp")) { + } else if (arg.equals("-projecthelp") || arg.equals("-p")) { // set the flag to display the targets and quit projectHelp = true; - } else if (arg.equals("-find")) { + } else if (arg.equals("-find") || arg.equals("-s")) { // eat up next arg if present, default to build.xml if (i < args.length - 1) { searchForThis = args[++i]; @@ -796,15 +796,15 @@ public class Main implements AntMain { StringBuffer msg = new StringBuffer(); msg.append("ant [options] [target [target2 [target3] ...]]" + lSep); msg.append("Options: " + lSep); - msg.append(" -help print this message" + lSep); - msg.append(" -projecthelp print project help information" + lSep); + msg.append(" -help, -h print this message" + lSep); + msg.append(" -projecthelp, -p print project help information" + lSep); msg.append(" -version print the version information and exit" + lSep); msg.append(" -diagnostics print information that might be helpful to" + lSep); msg.append(" diagnose or report problems." + lSep); msg.append(" -quiet, -q be extra quiet" + lSep); msg.append(" -verbose, -v be extra verbose" + lSep); - msg.append(" -debug print debugging information" + lSep); - msg.append(" -emacs produce logging information without adornments" + lSep); + msg.append(" -debug, -d print debugging information" + lSep); + msg.append(" -emacs, -e produce logging information without adornments" + lSep); msg.append(" -logfile use given file for log" + lSep); msg.append(" -l ''" + lSep); msg.append(" -logger the class which is to perform logging" + lSep); @@ -819,8 +819,8 @@ public class Main implements AntMain { msg.append(" -propertyfile load all properties from file with -D" + lSep); msg.append(" properties taking precedence" + lSep); msg.append(" -inputhandler the class which will handle input requests" + lSep); - msg.append(" -find search for buildfile towards the root of the" + lSep); - msg.append(" filesystem and use it" + lSep); + msg.append(" -find (s)earch for buildfile towards the root of" + lSep); + msg.append(" -s the filesystem and use it" + lSep); System.out.println(msg.toString()); } @@ -1010,4 +1010,4 @@ public class Main implements AntMain { } project.log(msg.toString()); } -} +} \ No newline at end of file