Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#1,083 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
python
Área
cli

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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)
Lenguaje dominante
VHDL
Estrellas
850
Forks
305
Merge medio
2 d 10 h
PR fusionados (30 d)
7

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de VUnit/vunit

Todos los issues de VUnit/vunit

Issues similares

Más issues de CLI

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.