Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Enum list options not displayed in help text

オープン
#893 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
csharp
領域
cli

調査の方向性

まず、報告に示されている Parser と HelpText.AutoBuild の設定を使用して、IEnumerable 型のオプションで問題を再現します。AddEnumValuesToHelpText がコレクションのオプション型をどのように処理するかを追跡します。完了条件は、生成された --help の出力にリストオプションの enum の有効な値が含まれ、スカラー enum に対する既存の動作が維持されることです。

索引モデルが issue の本文から書いたものです。

説明

Apologies if this question/bug was already open

Describe the bug
The property: HelpText.AddenumValuesToHelpText does not work when the option is of type IEnummerable<{Enum}>. I'm guessing the list is masking the fact that its containing an enum.

Is it possible to have the same Valid values: {enum values} in the help text to be displayed when its a list of enums?

To Reproduce

  1. Create an option of type IEnummerable<{Enum}>
  2. configure a parser as follows:
var parser = new Parser(with =>
{
    with.CaseInsensitiveEnumValues = true;
    with.HelpWriter = null;
    with.AutoVersion = false;
});

    var parserResult = parser.ParseArguments<TArgs>(args.SplitArgs());
    parserResult
        .WithNotParsed(_ =>
        {
            var helpText = HelpText.AutoBuild(parserResult, h =>
            {
                h.AutoVersion = false;
                h.Heading = string.Empty;
                h.Copyright = string.Empty;
                h.AddEnumValuesToHelpText = true;

                return h;
            });
            Console.WriteLine(helpText);
        });
  1. use the --help to find no Valid values: {enum values} in the help text.

Expected behavior
I expected a list of enums to still show available options

Screenshots
image
image
image

主要言語
C#
スター
4.8k
フォーク
478
PR マージ指標
30日以内にマージされた PR はありません

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

commandlineparser/commandline のほかの issue

commandlineparser/commandline の issue をすべて見る

似ている issue

C# の issue をもっと見る

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

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