commandlineparser / commandlineparser/commandline

Parser fails when an empty value is given

オープン
#412 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
C#
スター
4.8k
フォーク
478
PR マージ指標
30日以内にマージされた PR はありません

説明

Example code

```C#
static class Program
{
static void Main(string[] args)
{
var configuration = new Configuration();
var parseResult = Parser.Default.ParseArguments(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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。