C# Class GitSharp.CLI.TextBuiltin

Abstract command which can be invoked from the command line. Commands are configured with a single "current" repository and then the execute(String[]) method is invoked with the arguments that appear after the subcommand. Command constructors should perform as little work as possible as they may be invoked very early during process loading, and the command may not execute even though it was constructed.
Show file Open project: nestalk/GitSharp Class Usage Examples

Public Properties

Property Type Description
arguments List
options CmdParserOptionSet

Protected Properties

Property Type Description
argWalk GitSharp.Core.RevWalk.RevWalk

Public Methods

Method Description
Execute ( String args ) : void

Parses the command line and runs the corresponding subcommand

GetCommand ( ) : Command

Returns the current command for lightweight referencing.

Init ( Core repo, DirectoryInfo path ) : void

Initializes a command for use including the repository and output support.

OnlineHelp ( ) : void

Opens the default webbrowser to display the command specific help.

ParseOptions ( string args ) : List

Parses the options for all subcommands and executes the corresponding code for each option.

Run ( String args ) : void

Provides an abstract layer to perform the action of this command. This method should only be invoked by the Execute(String[] args) method.

getCommandHelp ( ) : string

Used by CommandRef to get the command help website during initial creation.

getCommandName ( ) : string

Used by CommandRef to get the command name during initial creation.

Protected Methods

Method Description
die ( String why ) : Die

Generic method used to return an exception during fatal conditions.

Private Methods

Method Description
Resolve ( string s ) : GitSharp.ObjectId

Method Details

Execute() public method

Parses the command line and runs the corresponding subcommand
public Execute ( String args ) : void
args String Specifies the command line arguments passed after the command name.
return void

GetCommand() public method

Returns the current command for lightweight referencing.
public GetCommand ( ) : Command
return Command

Init() public method

Initializes a command for use including the repository and output support.
public Init ( Core repo, DirectoryInfo path ) : void
repo Core Specifies the repository to use.
path System.IO.DirectoryInfo
return void

OnlineHelp() public method

Opens the default webbrowser to display the command specific help.
public OnlineHelp ( ) : void
return void

ParseOptions() public method

Parses the options for all subcommands and executes the corresponding code for each option.
public ParseOptions ( string args ) : List
args string Specifies the string from the options to the end of the command line.
return List

Run() public abstract method

Provides an abstract layer to perform the action of this command. This method should only be invoked by the Execute(String[] args) method.
public abstract Run ( String args ) : void
args String
return void

die() protected static method

Generic method used to return an exception during fatal conditions.
protected static die ( String why ) : Die
why String Specifies the textual explanation of why the exception was thrown.
return Die

getCommandHelp() public method

Used by CommandRef to get the command help website during initial creation.
public getCommandHelp ( ) : string
return string

getCommandName() public method

Used by CommandRef to get the command name during initial creation.
public getCommandName ( ) : string
return string

Property Details

argWalk protected property

RevWalk used during command line parsing, if it was required.
protected RevWalk,GitSharp.Core.RevWalk argWalk
return GitSharp.Core.RevWalk.RevWalk

arguments public property

Contains the remaining arguments after the options listed in the command line.
public List arguments
return List

options public static property

Custom OptionSet to allow special option handling rules such as --option dir
public static CmdParserOptionSet,GitSharp.CLI options
return CmdParserOptionSet