C# Class Westwind.Utilities.System.CommandLineParser

Basic Command Line Parser class that can deal with simple switch based command line arguments supports: FirstParm (first commandline argume -pString or -p"String" -f switch/flag parameters
Mostrar archivo Open project: RickStrahl/AspNetFrameworksPerformance

Public Methods

Method Description
CommandLineParser ( ) : System
Parse ( ) : void

Override to provide parse switches\parameter into object structure

Protected Methods

Method Description
ParseParameterSwitch ( string parm ) : bool
ParseStringParameterSwitch ( string parm, string defaultValue = null ) : string

Parses a string Parameter switch in the format of: -p"c:\temp files\somefile.txt" -pc:\somefile.txt Note no spaces are allowed between swich and value.

Method Details

CommandLineParser() public method

public CommandLineParser ( ) : System
return System

Parse() public abstract method

Override to provide parse switches\parameter into object structure
public abstract Parse ( ) : void
return void

ParseParameterSwitch() protected method

protected ParseParameterSwitch ( string parm ) : bool
parm string
return bool

ParseStringParameterSwitch() protected method

Parses a string Parameter switch in the format of: -p"c:\temp files\somefile.txt" -pc:\somefile.txt Note no spaces are allowed between swich and value.
protected ParseStringParameterSwitch ( string parm, string defaultValue = null ) : string
parm string parameter switch key
defaultValue string value returned if switch is not found
return string