ruper2/src/java/core/org/krysalis/ruper2/tool RepositoriesTool.java,NONE,1.1

[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-serv20184/src/java/core/org/krysalis/ruper2/tool

Added Files:
	RepositoriesTool.java 
Log Message:
Started work on tools (ant and command line) to work on repo sets

--- NEW FILE: RepositoriesTool.java ---
/**
 * Copyright (C) The Apache Software Foundation. All rights reserved.        *
 * ------------------------------------------------------------------------- *
 * This software is published under the terms of the Apache Software License *
 * version 1.1, a copy of which has been included  with this distribution in *
 * the LICENSE file.                                                         *
 */
package org.krysalis.ruper2.tool;

import org.krysalis.ruper2.repository.RepositorySet;
import org.krysalis.ruper2.util.RuperConstants;
import org.krysalis.version.util.cli.CommandLine;
import org.krysalis.version.util.cli.Option;
import org.krysalis.version.util.debug.DebugUtils;

/**
 */
public class RepositoriesTool extends Tool {

	private static Option l_setOption = null;
	private static Option l_groupsOption = null;
	private static Option l_listOption = null;

	static {
		l_setOption = new Option("s", "set", true, "RepositorySet");
		l_groupsOption = new Option("g", "groups", false, "List groups");
		l_listOption = new Option("l", "list", true, "List resources");
	}

	protected void init() {
		getOptions().addOption(l_setOption);
		getOptions().addOption(l_groupsOption);
		getOptions().addOption(l_listOption);
	}

	public void execute(CommandLine cmdline) throws Exception {
		String setId =
			cmdline.isSet(l_setOption)
				? cmdline.getOptionValue(l_setOption)
				: RuperConstants.DEFAULT;

		//DebugUtils.printSeparator();
		//DebugUtils.dump(cmdline);

		RepositorySet reposet = RepositorySet.getRepositorySet(setId, true);

		DebugUtils.printSeparator();
		DebugUtils.dump(reposet);

		//:TODO:
		//		if (cmdline.isSet(l_groupsOption)) {
		//			DebugUtils.printSeparator();
		//			DebugUtils.dump(reposet.listGroups(AllSelector.getInstance()));
		//		}
		//
		//		if (cmdline.isSet(l_listOption)) {
		//			DebugUtils.printSeparator();
		//			DebugUtils.dump(
		//			reposet.listResources(
		//					new ResourceGroup(
		//						cmdline.getMandatoryOptionValue(l_listOption)),
		//					AllSelector.getInstance()));
		//		}
	}

	public static void main(String[] args) {
		(new RepositoryTool()).run(args);
	}
}




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
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.