Documentation for the C# command-line option parsing library

CommandLine.OptParse Namespace

Contains the functionality for parsing command-line options. The primary classes to focus on are the Parser and UsageBuilder classes.

Namespace hierarchy

Classes

Class Description
DefaultUsageInfo Obsolete. A simple, default implementation of IProgUsageInfo that is fairly easy to use
DictionaryParserHelper Class that parses option results into a dictionary interface
EnumDescriptorReader Class that assists with reading DescriptionAttribute values for enumeration values
InvalidValueException Parsing exception that is thrown if a value is given that is not of the expected type
LongOptionNameAttribute Defines a long option for a field or property
OptDefAttribute Define that a property or field can be given as an option
OptionDefinition Definition of an option
OptionResult Stores the information on the result of parsing an option
OptionResultsDictionary Dictionary of option results
OptionWarningEventArgs Event args for parse warnings
ParseException Exception thrown if the parser encounters an error
Parser Class that parses the command line options. Use the ParserFactory to construct an instance of a parser
ParserFactory Factory to build parser instances
PropertyFieldParserHelper Helper class for the parser that stores values into properties and fields of a class.
ShortOptionNameAttribute Defines a short option name for a field or property
UsageBuilder Class to assist the building of program usage information
UseNameAsLongOptionAttribute Gives the ability to stop the name of a field or property being used to be used as an option name

Interfaces

Interface Description
IOptionContainer Interface that describes an object that contains option definitions
IOptionResults Interface for interacting with the results of parsing the options
IProgUsageInfo Obsolete. Interface for the parser to use to be able to print usage information for the given program.

Delegates

Delegate Description
WarningEventHandler Delegate to receive warning events from a parser

Enumerations

Enumeration Description
DupOptHandleType Define the behavior of the parser if an option is duplicated
ListType Type of list to create in the usage
OptStyle The platform style of option
OptValType Type of value that the option permits
UnixShortOption Specify how short options may be given for Unix-style arguments
UnknownOptHandleType Define the behavior of the parser if an option is given that is not reconginzed