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

Add option "add_help=False" when creating an ArgumentParser object.

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python
領域
cli

調査の方向性

The issue points to lines 44–82 of vunit_cli.py and proposes passing an add_help option through VUnitCLI to the argparse.ArgumentParser it creates. Start by reading that constructor and _create_argument_parser, then check nearby CLI tests for parser creation and parent parser use. Done means callers can disable the help option when creating a VUnitCLI parser; run the relevant CLI tests.

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

説明

Right now there is no option for creating an ArgumentParser object without the help option. ArgumentParser() allows for the add_help=False option. Adding this option to the init of VUnitCLI would allow us to then use the resulting ArgumentParser object as a parent of other ArgumentParser() commands.

The argument for this is when I want to have Vunit as part of a larger script, and therefore add other options to the --help tag.

Changing the lines (line 44-82 in vunit_cli.py) to add this would be simple and only add usability.

class VUnitCLI(object):
    """
    VUnit command line interface
    """

    def __init__(self, description=None, add_help_descr=True):
        """
        :param description: A custom short description of the command line tool
        """
        self.parser = _create_argument_parser(description, add_help_descr=add_help_descr)
        self.add_help_descr = add_help_descr

    def parse_args(self, argv=None):
        """
        Parse command line arguments

        :param argv: Use explicit argv instead of actual command line argument
        :returns: The parsed argument namespace object
        """
        return self.parser.parse_args(args=argv)


def _create_argument_parser(description=None, for_documentation=False, add_help_descr=True):
    """
    Create the argument parser

    :param description: A custom short description of the command line tool
    :param for_documentation: When used for user guide documentation
    :returns: The created :mod:`argparse` parser object
    """
    if description is None:
        description = f"VUnit command line tool version {version()!s}"

    if for_documentation:
        default_output_path = "./vunit_out"
    else:
        default_output_path = str(Path(os.getcwd()).resolve() / "vunit_out")

    parser = argparse.ArgumentParser(description=description, add_help=add_help_descr)
主要言語
VHDL
スター
850
フォーク
305
平均マージ
2日 10時間
マージ済み PR(30日)
7

環境構築

はじめの一歩

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

VUnit/vunit のほかの issue

VUnit/vunit の issue をすべて見る

似ている issue

CLI の issue をもっと見る

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

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