ID

Uploaded

Status

Description

Work Items

Action

9880
by jaymedalton987
Jul 7, 2011
10:12 AM

Being evaluated

**************************************************************************************************************************************

[b][url=http://twilightquiz.me]twilight quiz[/url][/b]

Download

8276
by DrewShafer
Feb 5, 2011
10:45 PM

Being evaluated

Adds a settings option to cause the parser to ignore invalid arguments. This allows apps to have multiple modes of operation while allowing each mode to use command-line args independent of other modes. Example Usage:

public class AppOptions
{
public enum ApplicationMode
{
mode1,
mode2
}

[Option("m", "mode",
Required=true,
HelpText="mode1|mode2")]
public ApplicationMode Mode;
}

public class Mode1Options : AppOptions
{
[Option("a", "abcd",
Required=true,
HelpText="Something Relevant to Mode1")]
public string abcd;
}
public class Mode2Options : AppOptions
{
[Option("a", "abcd",
Required=true,
HelpText="Something Relevant to Mode2")]
public bool abcd;
}

static int Main(string[] args)
{
AppOptions globalOptions = new AppOptions();
CommandLineParserSettings settings = new CommandLineParserSettings();
settings.IgnoreParserFailures = true;
if(new CommandLineParser(settings).ParseArguments(args, globalOptions))
switch (globalOptions.Mode)
{
case AppOptions.ApplicationMode.mode1:
{
settings.IgnoreParserFailures = false;
Mode1Options opts = new Mode1Options();
if(new CommandLineParser(settings).ParseArguments(args, Mode1Options))
DoSomethingInMode1(opts)
}
case AppOptions.ApplicationMode.mode2:
{
settings.IgnoreParserFailures = false;
Mode2Options opts = new Mode2Options();
if(new CommandLineParser(settings).ParseArguments(args, Mode2Options))
DoSomethingInMode2(opts)
}
}

Download

5458
by philr
Mar 4, 2010
4:06 PM

Being evaluated

Fixes HelpText OutOfMemoryException issue with long words (#10361).

10361

Download

View All
  • 1-3 of 3 Patches
    • Previous
    • 1
    • Next
    • Showing
    • All
    • Patches