Search Results for

    Show / Hide Table of Contents

    Class CliOptionParser<T>

    This class provides a routine to put application arguments into properties of an object of type T, where matching CliAttribute are applied to the properties.

    Inheritance
    System.Object
    CliOptionParser<T>
    Namespace: TeleScope.UI.Cli.Options
    Assembly: TeleScope.UI.Cli.dll
    Syntax
    public class CliOptionParser<T> : object where T : new()
    Type Parameters
    Name Description
    T

    The type of the arguments class.

    Constructors

    | Improve this Doc View Source

    CliOptionParser()

    The default constructor creates a new instance of the options and sets the prefix to -. The format is set to InvariantCulture.

    Declaration
    public CliOptionParser()
    | Improve this Doc View Source

    CliOptionParser(IFormatProvider)

    The constructor calls the default constructor and overrides the Format property.

    Declaration
    public CliOptionParser(IFormatProvider format)
    Parameters
    Type Name Description
    IFormatProvider format

    The format specifies how the strings are parsed into types of the target properties.

    | Improve this Doc View Source

    CliOptionParser(String)

    The constructor calls the default constructor and overrides the Prefix property.

    Declaration
    public CliOptionParser(string prefix)
    Parameters
    Type Name Description
    System.String prefix

    The prefix that is used for identifying application arguments in the string array.

    | Improve this Doc View Source

    CliOptionParser(String, IFormatProvider)

    he constructor calls the default constructor and overrides the Prefix and Format properties.

    Declaration
    public CliOptionParser(string prefix, IFormatProvider format)
    Parameters
    Type Name Description
    System.String prefix

    The prefix that is used for identifying application arguments in the string array.

    IFormatProvider format

    The format specifies how the strings are parsed into types of the target properties.

    Properties

    | Improve this Doc View Source

    Format

    Gets or sets the format how the strings are parsed into types of the target properties.

    Declaration
    public IFormatProvider Format { get; set; }
    Property Value
    Type Description
    IFormatProvider
    | Improve this Doc View Source

    Prefix

    Gets or sets the Prefix that is used to identify options.

    Declaration
    public string Prefix { get; set; }
    Property Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    ReadArguments(String[])

    Reads the command line arguments and places them into the properties of the according instance of type T.

    Declaration
    public T ReadArguments(string[] args)
    Parameters
    Type Name Description
    System.String[] args

    The cli options of the main method.

    Returns
    Type Description
    T

    The resulting instance of type T.

    • GITHUB
    • Improve this Doc
    • View Source
    ☀
    ☾
    In This Article
    Back to top
    Copyright 2020-2022 TeleScope-dotnet. Generated by DocFX.
    ☀
    ☾