nemec / clipr

Command Line Interface ParseR for .Net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AutomaticHelpGenerator fails with NullPointer when [NamedArgument] has no Description

GeneThomas opened this issue · comments

class NoDescription
{
    [NamedArgument("name")]
    public string Name = null;
}

class Help: AutomaticHelpGenerator<NoDescription>
{
    public Help()
    {
        ShortName = null;
        LongName = "help";
    }
}

    [TestMethod]
    [ExpectedException(typeof(ParserExit))]
    public void Help_WithNoDescription_NoNullPointer()
    {

        var args = "--help".Split();
        var opt = new NoDescription();
        var parser = new CliParser<NoDescription>(
            opt,
            ParserOptions.None,
            new Help());
        parser.Parse(args);
    }

pull request to follow...

commented

You fixed this one a while ago. Closing.