krysalis-version/src/main/org/krysalis/version/tool VersionTool.java,1.7,1.8 VersionToolImpl.java,1.14,1.15

[email protected]
Newsgroups gmane.comp.krysalis.cvs
Message-ID <[email protected]>
Update of /cvsroot/krysalis/krysalis-version/src/main/org/krysalis/version/tool
In directory sc8-pr-cvs1:/tmp/cvs-serv6646/src/main/org/krysalis/version/tool

Modified Files:
	VersionTool.java VersionToolImpl.java 
Log Message:
Start on environment analysis (comparison against a fixed base)

Index: VersionTool.java
===================================================================
RCS file: /cvsroot/krysalis/krysalis-version/src/main/org/krysalis/version/tool/VersionTool.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** VersionTool.java	22 Oct 2003 01:46:57 -0000	1.7
--- VersionTool.java	2 Nov 2003 22:11:12 -0000	1.8
***************
*** 88,93 ****
  	private static final String DEBUG_LONG = "debug";
  
! //	private static final String FILE_SHORT = "f";
! //	private static final String FILE_LONG = "file";
  
  	private static Option l_versionId;
--- 88,97 ----
  	private static final String DEBUG_LONG = "debug";
  
! 	private static final String OUTPUT_SHORT = "o";
! 	private static final String OUTPUT_LONG = "output";
! 
! 	private static final String BASE_SHORT = "b";
! 	private static final String BASE_LONG = "base";
! 
  
  	private static Option l_versionId;
***************
*** 96,100 ****
  	private static Option l_verbose;
  	private static Option l_debug;
! 	private static Option l_file;
  	private static Options l_options;
  	static {
--- 100,105 ----
  	private static Option l_verbose;
  	private static Option l_debug;
! 	private static Option l_output;
! 	private static Option l_base;
  	private static Options l_options;
  	static {
***************
*** 114,118 ****
  		l_verbose = new Option(VERBOSE_SHORT, VERBOSE_LONG, false, "verbose");
  		l_debug = new Option(DEBUG_SHORT, DEBUG_LONG, false, "debug");
! //		l_file = new Option(FILE_SHORT, FILE_LONG, true, "output file");
  
  		l_options = new Options();
--- 119,124 ----
  		l_verbose = new Option(VERBOSE_SHORT, VERBOSE_LONG, false, "verbose");
  		l_debug = new Option(DEBUG_SHORT, DEBUG_LONG, false, "debug");
! 		l_output = new Option(OUTPUT_SHORT, OUTPUT_LONG, true, "output file");
! 		l_base = new Option(BASE_SHORT, BASE_LONG, true, "base (original) file");
  
  		l_options = new Options();
***************
*** 122,126 ****
  		l_options.addOption(l_verbose);
  		l_options.addOption(l_debug);
! //		l_options.addOption(l_file);
  	}
  
--- 128,133 ----
  		l_options.addOption(l_verbose);
  		l_options.addOption(l_debug);
! 		l_options.addOption(l_output);
! 		l_options.addOption(l_base);
  	}
  
***************
*** 139,154 ****
  			boolean verbose = cmd.isSet(l_verbose);
  			boolean debug = cmd.isSet(l_debug);
! 			
  			// Set logging context
  			int level = LogConstants.INFO;
  			if (verbose || debug)
  				level = debug ? LogConstants.DEBUG : LogConstants.VERBOSE;
! 			Logger logger = Logger.pushContext(level, new StandardLogListener());
  
! 			if (verbose) 
  				tool.setVerbose(true);
  
  			if (cmd.isSet(l_env)) {
  				tool.displayEnvironment();
  			}
  			else if (cmd.isSet(l_check)) {
--- 146,173 ----
  			boolean verbose = cmd.isSet(l_verbose);
  			boolean debug = cmd.isSet(l_debug);
! 
  			// Set logging context
  			int level = LogConstants.INFO;
  			if (verbose || debug)
  				level = debug ? LogConstants.DEBUG : LogConstants.VERBOSE;
! 			Logger logger =
! 				Logger.pushContext(level, new StandardLogListener());
  
! 			if (verbose)
  				tool.setVerbose(true);
  
  			if (cmd.isSet(l_env)) {
  				tool.displayEnvironment();
+ 
+ 				String output = cmd.getOptionValue(l_output);
+ 				if (null != output) {
+ 					tool.writeEnvironment(output);
+ 				}
+ 				
+ 				String base = cmd.getOptionValue(l_base);
+ 				if (null != base) {
+ 					tool.compareEnvironment(base);
+ 				}
+ 				
  			}
  			else if (cmd.isSet(l_check)) {

Index: VersionToolImpl.java
===================================================================
RCS file: /cvsroot/krysalis/krysalis-version/src/main/org/krysalis/version/tool/VersionToolImpl.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** VersionToolImpl.java	22 Oct 2003 01:46:57 -0000	1.14
--- VersionToolImpl.java	2 Nov 2003 22:11:12 -0000	1.15
***************
*** 65,68 ****
--- 65,69 ----
  import org.krysalis.version.context.VersionInformation;
  import org.krysalis.version.util.debug.DebugUtils;
+ import org.krysalis.version.util.note.AnnotationScratchpad;
  
  /**
***************
*** 109,112 ****
--- 110,124 ----
  	public void displayEnvironment() throws VersionException {
  		m_runtime.printEnvironment(m_out,m_verbose);
+ 	}
+ 
+ 	public void writeEnvironment(String output) throws VersionException {
+ 		m_runtime.writeEnvironment(output);
+ 	}
+ 
+ 	
+ 	public AnnotationScratchpad compareEnvironment(String base) throws VersionException {
+ 		AnnotationScratchpad pad = m_runtime.compareEnvironment(base);				
+ 		DebugUtils.dump(m_out, m_verbose, pad);
+ 		return pad;
  	}
  




-------------------------------------------------------
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.