Search Results for

    Show / Hide Table of Contents

    Class CommandLineArgParser

    A class for common operations around resolving command line arguments

    Inheritance
    object
    CommandLineArgParser
    Inherited Members
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: LemonEdge.Utils
    Assembly: LemonEdge.Utils.dll
    Syntax
    public class CommandLineArgParser

    Constructors

    CommandLineArgParser(CommandLineArgOptions, string[])

    Creates a a command line parser with the specified options

    Declaration
    public CommandLineArgParser(CommandLineArgOptions options, string[] args)
    Parameters
    Type Name Description
    CommandLineArgOptions options

    The options for the parameters to be parsed

    string[] args

    The list of args from the main command line method

    Methods

    GetOptionArgument(string, short)

    Returns the argument associated with the specified option parsed from the command line arguments

    Declaration
    public string GetOptionArgument(string optionName, short argumentIndex)
    Parameters
    Type Name Description
    string optionName

    The name of the option to return an argument for

    short argumentIndex

    The index (0 based) of the argument to return for this option

    Returns
    Type Description
    string

    The argument associated with the specified option parsed from the command line arguments

    HasOption(string)

    Returns true if the specified option has been included in the parsed arguments

    Declaration
    public bool HasOption(string optionName)
    Parameters
    Type Name Description
    string optionName

    The name of the option to check for in the parsed arguments

    Returns
    Type Description
    bool

    True if the specified option has been included in the parsed arguments

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.