org.apache.maven.cli
Class CLIManager

java.lang.Object
  extended byorg.apache.maven.cli.CLIManager

public class CLIManager
extends java.lang.Object

Utility for managing and parsing MavenSession's command-line.

implementation note: This is the class to modify when adding, removing or modifying MavenSession's command-line options and flags.

This class uses the commons-cli library for command-line parsing.

Author:
bob mcwhirter, Jason van Zyl

Constructor Summary
CLIManager()
           
 
Method Summary
static void displayHelp()
          Display usage information based upon current command-line option configuration.
static void displayInfo()
          Display system information.
static org.apache.commons.cli.CommandLine parse(java.lang.String[] args)
          Parse a string-array of command-line arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CLIManager

public CLIManager()
Method Detail

parse

public static org.apache.commons.cli.CommandLine parse(java.lang.String[] args)
                                                throws org.apache.commons.cli.ParseException
Parse a string-array of command-line arguments.

This will parse the arguments against the configured maven command-line options, and return a CommandLine object which may be queried for the presence of flags and options and their arguments, if any.

Parameters:
args - The command-line arguments to parse.
Returns:
The parsed CommandLine result.
Throws:
org.apache.commons.cli.ParseException - If an error occurs while parsing the command-line options.
See Also:
CLI

displayHelp

public static void displayHelp()
Display usage information based upon current command-line option configuration.


displayInfo

public static void displayInfo()
Display system information. This is generally useful, maybe this could be made part of CLI? But it definitely shouldn't be stuck in MavenSession.



Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.