All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jwat.tools.HelpTaskCLI Maven / Gradle / Ivy

Go to download

JWAT-Tools uses the available JWAT libraries to make high level tasks available either from command-line or programmatically. Common tasks include: Test, Compress, Decompress, CDX, Arc2Warc. More specialised tasks include: Changed, ContainerMD, Delete, Extract, Interval, PathIndex, Unpack, Headers2CDX.

There is a newer version: 0.7.1
Show newest version
package org.jwat.tools;

import org.jwat.tools.tasks.TaskCLI;

import com.antiaction.common.cli.CommandLine;

public class HelpTaskCLI extends TaskCLI {

	public static final String commandName = "help";

	public static final String commandDescription = "display help information";

	public HelpTaskCLI() {
	}

	@Override
	public void show_help() {
		System.out.println("jwattools help []");
		System.out.println("");
		System.out.println("display help information");
		System.out.println("");
		System.out.println("\tIf no command is supplied overall help information is shown.");
		System.out.println("\tIf a command is supplied its help information is shown instead.");
	}

	@Override
	public void runtask(CommandLine cmdLine) {
		HelpOptions options = HelpTaskCLIParser.parseArguments(cmdLine);
		String command = options.command;
		if (command == null) {
			JWATTools.show_help();
		}
		else {
			Class clazz = JWATTools.commandMap.get(command);
			if (clazz != null) {
				try {
					TaskCLI taskcli = clazz.newInstance();
					taskcli.show_help();
				}
				catch (InstantiationException e) {
					e.printStackTrace();
				}
				catch (IllegalAccessException e) {
					e.printStackTrace();
				}
			}
			else {
				System.out.println("Unknown command -- " + command);
			}
		}
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy