The Sandbox Post

Single Post Permalink

View Thread: MSH-Style Command Line Parser for Console apps. V1.5
  • User profile image

    Thanks databyte.  But you will need to look closer.  This is nothing like those other parsers.  This is modeled after the MSH (i.e. Monad) parser.  Can handle all primitive types, arrays of those types, any other type you can define a converter for.  It also has integrated Detailed help and Usage help and a ton of validation such as:
    CmdHelp (Defines help for the whole command.)
    DefaultSet (Defines the default set when more sets match.)
    Parameter (base attribute)
    ParameterHelp (Defines help for the parm.)
    ParsingMandatoryParameter (Parm is required)
    ParsingParameterMapping (Maps parm to set name and position)
    ParsingPromptString (Prompt for input)
    ParsingVariableLengthParameterList (var list)
    SwitchParameter (a bool)
    ValidationCount (Array min/max count)
    ValidationLength (string min/max len)
    ValidationPattern (Regex pattern)
    ValidationRange (Object min/max range)
    ValidationSet (Set of strings that are valid.)

    You also get Parameter Sets, variable length parameter lists, Input Prompt, mandatory checks, various validations, etc.  In effect, allows you to Overload your command line parms into "Sets" and the engine figures out which set to use or throws proper error.  It also works with any combination of Named or Position parameters and figures out which set to use if possible.  You also get "Parcial" name support.  So "-n:hello" is the same as "-Name hello" or even "-na xyz" if we can disabiguate the name from other parms.  Other helpful things I need to write about.  Thanks.