ruper2/src/java/core/org/krysalis/ruper2/tool Tool.java,1.5,1.6 RepositoriesTool.java,1.1,1.2 FileTool.java,1.2,1.3 RepositoryTool.java,1.8,1.9 ResourceTool.java,1.6,1.7

[email protected]
Newsgroups gmane.comp.krysalis.metamorphosis.cvs
Message-ID <[email protected]>
Update of /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/tool
In directory sc8-pr-cvs1:/tmp/cvs-serv25787/src/java/core/org/krysalis/ruper2/tool

Modified Files:
	Tool.java RepositoriesTool.java FileTool.java 
	RepositoryTool.java ResourceTool.java 
Log Message:
Some doc tweaks...

Index: Tool.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/tool/Tool.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Tool.java	9 Oct 2003 20:30:26 -0000	1.5
--- Tool.java	14 Oct 2003 20:48:07 -0000	1.6
***************
*** 12,15 ****
--- 12,16 ----
  import org.krysalis.ruper2.monitor.Monitor;
  import org.krysalis.ruper2.monitor.StatisticsMonitor;
+ import org.krysalis.ruper2.version.Version;
  import org.krysalis.version.util.SystemUtils;
  import org.krysalis.version.util.cli.CommandLine;
***************
*** 29,32 ****
--- 30,34 ----
  	private static Option l_statsOption = null;
  	private static Option l_helpOption = null;
+ 	private static Option l_versionOption = null;
  	private static Options l_options = null;
  
***************
*** 34,42 ****
  	private static boolean l_verbose = false;
  	private static boolean l_help = false;
  
  	private static StatisticsMonitor l_statistics = null;
  
  	static {
! 		l_helpOption = new Option("h", "help", false, "print help");
  		l_debugOption = new Option("d", "debug", false, "debug output");
  		l_verboseOption = new Option("v", "verbose", false, "verbose output");
--- 36,46 ----
  	private static boolean l_verbose = false;
  	private static boolean l_help = false;
+ 	private static boolean l_version = false;
  
  	private static StatisticsMonitor l_statistics = null;
  
  	static {
! 		l_versionOption = new Option("V", "version", false, "print version, and exit");
! 		l_helpOption = new Option("h", "help", false, "print help, and exit");
  		l_debugOption = new Option("d", "debug", false, "debug output");
  		l_verboseOption = new Option("v", "verbose", false, "verbose output");
***************
*** 46,49 ****
--- 50,54 ----
  		l_options = new Options();
  		l_options.addOption(l_helpOption);
+ 		l_options.addOption(l_versionOption);
  		l_options.addOption(l_debugOption);
  		l_options.addOption(l_verboseOption);
***************
*** 59,67 ****
  	}
  
  	protected abstract void init();
  
! 	protected void printHelp() {
! 		getOptions().display();
  	}
  	protected abstract void execute(CommandLine cmdline) throws Exception;
  
--- 64,81 ----
  	}
  
+ 	protected abstract String getTitle();
  	protected abstract void init();
  
! 	protected void printVersion() {
! 		String version = Version.VERSION.getLongVersion();		
! 		System.out.println(getTitle() + " : " + version);
! 		
  	}
+ 	
+ 	protected void printHelp() {
+ 			printVersion();		
+ 			getOptions().display();
+ 		}
+ 	
  	protected abstract void execute(CommandLine cmdline) throws Exception;
  
***************
*** 76,79 ****
--- 90,94 ----
  
  			l_help = cmdline.isSet(l_helpOption);
+ 			l_version = cmdline.isSet(l_versionOption);
  			l_verbose = cmdline.isSet(l_verboseOption);
  			l_debug = cmdline.isSet(l_debugOption);
***************
*** 102,105 ****
--- 117,124 ----
  		if (l_help) {
  			printHelp();
+ 			System.exit(0);
+ 		}
+ 		if (l_version) {
+ 			printVersion();
  			System.exit(0);
  		}

Index: RepositoriesTool.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/tool/RepositoriesTool.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** RepositoriesTool.java	2 Oct 2003 14:41:30 -0000	1.1
--- RepositoriesTool.java	14 Oct 2003 20:48:07 -0000	1.2
***************
*** 34,37 ****
--- 34,41 ----
  	}
  
+ 	protected String getTitle() {
+ 		return "Ruper Repositories Tool";
+ 	}
+ 
  	public void execute(CommandLine cmdline) throws Exception {
  		String setId =

Index: FileTool.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/tool/FileTool.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FileTool.java	10 Oct 2003 21:26:23 -0000	1.2
--- FileTool.java	14 Oct 2003 20:48:07 -0000	1.3
***************
*** 6,48 ****
   * the LICENSE file.                                                         *
   */
- package org.krysalis.ruper2.tool;
  
! import org.krysalis.ruper2.FileUpdater;
! import org.krysalis.ruper2.log.Logger;
! import org.krysalis.ruper2.query.ResourceResult;
! import org.krysalis.version.util.cli.CommandLine;
! import org.krysalis.version.util.cli.Option;
! import org.krysalis.version.util.debug.DebugUtils;
! 
! /**
!  */
! public class FileTool extends Tool {
! 
! 	private static Option l_fileOption = null;
! 
! 	static {
! 		l_fileOption = new Option("f", "file", true, "Filename");
! 	}
! 
! 	protected void init() {
! 		getOptions().addOption(l_fileOption);
! 	}
! 
! 	public void execute(CommandLine cmdline) throws Exception {
! 
! 		String fileName = cmdline.getMandatoryOptionValue(l_fileOption);
! 
! 		FileUpdater fu = new FileUpdater();
! 
! 		getOutput().println("File: [" + fileName + "]");
! 
! 		ResourceResult result = fu.determineFilesUpdates(fileName);
! 
! 		if (Logger.getLog().isDebug())
! 			DebugUtils.dump(result);
! 	}
  
! 	public static void main(String[] args) {
! 		(new FileTool()).run(args);
! 	}
! }
--- 6,51 ----
   * the LICENSE file.                                                         *
   */
  
! // Maybe delete this file...
  
! //package org.krysalis.ruper2.tool;
! //
! //import org.krysalis.ruper2.FileUpdater;
! //import org.krysalis.ruper2.log.Logger;
! //import org.krysalis.ruper2.query.ResourceResult;
! //import org.krysalis.version.util.cli.CommandLine;
! //import org.krysalis.version.util.cli.Option;
! //import org.krysalis.version.util.debug.DebugUtils;
! //
! ///**
! // */
! //public class FileTool extends Tool {
! //
! //	private static Option l_fileOption = null;
! //
! //	static {
! //		l_fileOption = new Option("f", "file", true, "Filename");
! //	}
! //
! //	protected void init() {
! //		getOptions().addOption(l_fileOption);
! //	}
! //
! //	public void execute(CommandLine cmdline) throws Exception {
! //
! //		String fileName = cmdline.getMandatoryOptionValue(l_fileOption);
! //
! //		FileUpdater fu = new FileUpdater();
! //
! //		getOutput().println("File: [" + fileName + "]");
! //
! //		ResourceResult result = fu.determineFilesUpdates(fileName);
! //
! //		if (Logger.getLog().isDebug())
! //			DebugUtils.dump(result);
! //	}
! //
! //	public static void main(String[] args) {
! //		(new FileTool()).run(args);
! //	}
! //}

Index: RepositoryTool.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/tool/RepositoryTool.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** RepositoryTool.java	14 Oct 2003 17:07:17 -0000	1.8
--- RepositoryTool.java	14 Oct 2003 20:48:07 -0000	1.9
***************
*** 48,51 ****
--- 48,55 ----
  	}
  
+ 	protected String getTitle() {
+ 		return "Ruper Repository Tool";
+ 	}
+ 	
  	protected void init() {
  		getOptions().addOption(l_repoOption);

Index: ResourceTool.java
===================================================================
RCS file: /cvsroot/metamorphosis/ruper2/src/java/core/org/krysalis/ruper2/tool/ResourceTool.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ResourceTool.java	9 Oct 2003 16:02:19 -0000	1.6
--- ResourceTool.java	14 Oct 2003 20:48:07 -0000	1.7
***************
*** 28,31 ****
--- 28,35 ----
  	}
  
+ 	protected String getTitle() {
+ 		return "Ruper Resource Tool";
+ 	}
+ 	
  	protected void init() {
  		getOptions().addOption(l_resourceOption);




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
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.