Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Parser fails when an empty value is given #412

Copy link
Copy link
@FreeApophis

Description

@FreeApophis
Issue body actions

Example code

    static class Program
    {
        static void Main(string[] args)
        {
            var configuration = new Configuration();
            var parseResult = Parser.Default.ParseArguments<Configuration>(args).WithParsed(result => configuration = result);

            System.Console.WriteLine(parseResult.Tag);
            System.Console.WriteLine(configuration.Description);
        }
    }

    internal class Configuration
    {
        [Option('d', "description", HelpText = "Set the description from the project")]
        public string Description { get; set; }
    }

Running the Program with progam.exe --description="" results in a Parse Error:

ERROR(S):
  Token '--description=' is not recognized

This is probably the same issue as #358 - but the example syntaxt was different (--description without an equal sign), which is not what I expect. But I expect an empty string to be a valid value.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.