org.archive.crawler
Class CommandLineParser

java.lang.Object
  extended by org.archive.crawler.CommandLineParser

public class CommandLineParser
extends java.lang.Object

Print Heritrix command-line usage message.

Version:
$Id: CommandLineParser.java 4551 2006-08-29 00:47:56Z stack-sf $
Author:
stack

Nested Class Summary
 class CommandLineParser.HeritrixHelpFormatter
          Override so can customize usage output.
 
Constructor Summary
CommandLineParser(java.lang.String[] args, java.io.PrintWriter out, java.lang.String version)
          Constructor.
 
Method Summary
 org.apache.commons.cli.CommandLine getCommandLine()
           
 java.util.List getCommandLineArguments()
           
 org.apache.commons.cli.Option[] getCommandLineOptions()
           
 java.lang.String getVersion()
           
 void message(java.lang.String message, int exitCode)
          Print message and then exit.
 void usage()
          Print usage then exit.
 void usage(int exitCode)
          Print usage then exit.
 void usage(java.lang.String message, int exitCode)
          Print message then usage then exit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandLineParser

public CommandLineParser(java.lang.String[] args,
                         java.io.PrintWriter out,
                         java.lang.String version)
                  throws org.apache.commons.cli.ParseException
Constructor.

Parameters:
args - Command-line arguments to process.
out - PrintStream to write on.
version - Heritrix version
Throws:
org.apache.commons.cli.ParseException - Failied parse of command line.
Method Detail

usage

public void usage()
Print usage then exit.


usage

public void usage(int exitCode)
Print usage then exit.

Parameters:
exitCode -

usage

public void usage(java.lang.String message,
                  int exitCode)
Print message then usage then exit. The JVM exits inside in this method.

Parameters:
message - Message to print before we do usage.
exitCode - Exit code to use in call to System.exit.

message

public void message(java.lang.String message,
                    int exitCode)
Print message and then exit. The JVM exits inside in this method.

Parameters:
message - Message to print before we do usage.
exitCode - Exit code to use in call to System.exit.

getCommandLineOptions

public org.apache.commons.cli.Option[] getCommandLineOptions()
Returns:
Options passed on the command line.

getCommandLineArguments

public java.util.List getCommandLineArguments()
Returns:
Arguments passed on the command line.

getCommandLine

public org.apache.commons.cli.CommandLine getCommandLine()
Returns:
Command line.

getVersion

public java.lang.String getVersion()
Returns:
Returns the version.


Copyright © 2003-2011 Internet Archive. All Rights Reserved.