Update of /cvsroot/krysalis/krysalis-version/src/main/org/krysalis/version/util/cli
In directory sc8-pr-cvs1:/tmp/cvs-serv12766/src/main/org/krysalis/version/util/cli
Modified Files:
CommandLine.java
Log Message:
CLI tweak for Ruper2
Index: CommandLine.java
===================================================================
RCS file: /cvsroot/krysalis/krysalis-version/src/main/org/krysalis/version/util/cli/CommandLine.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** CommandLine.java 12 Oct 2003 17:02:39 -0000 1.7
--- CommandLine.java 21 Nov 2003 23:55:28 -0000 1.8
***************
*** 88,92 ****
if (null == values) {
! values = new EntityList("Args:"+option.getOpt());
m_options.put(option, values);
}
--- 88,92 ----
if (null == values) {
! values = new EntityList("Args:" + option.getOpt());
m_options.put(option, values);
}
***************
*** 127,131 ****
public String getMandatoryOptionValue(Option option)
throws ParseException {
! String value = getOptionValue(option);
if ((null == value) || (0 == value.length()))
--- 127,136 ----
public String getMandatoryOptionValue(Option option)
throws ParseException {
! return getMandatoryOptionValue(option, null);
! }
!
! public String getMandatoryOptionValue(Option option, String defaultValue)
! throws ParseException {
! String value = getOptionValue(option, defaultValue);
if ((null == value) || (0 == value.length()))
***************
*** 136,139 ****
--- 141,148 ----
public String getOptionValue(Option option) {
+ return getOptionValue(option, null);
+ }
+
+ public String getOptionValue(Option option, String defaultValue) {
String array[] = getOptionValues(option);
***************
*** 144,147 ****
--- 153,159 ----
}
+ if (null == value)
+ value = defaultValue;
+
return value;
}
***************
*** 156,162 ****
public void print() {
! DebugUtils.dump("Command Line Provided: ",m_options);
}
!
public void dump(PrintWriter out, int depth, boolean verbose) {
String indent = DebugUtils.getIndent(depth);
--- 168,174 ----
public void print() {
! DebugUtils.dump("Command Line Provided: ", m_options);
}
!
public void dump(PrintWriter out, int depth, boolean verbose) {
String indent = DebugUtils.getIndent(depth);
***************
*** 164,168 ****
out.print(indent);
out.println("Command Line: ");
!
DebugUtils.dump(m_options);
}
--- 176,180 ----
out.print(indent);
out.println("Command Line: ");
!
DebugUtils.dump(m_options);
}
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.