Add option "add_help=False" when creating an ArgumentParser object.
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 45/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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)
- Lingua principale
- VHDL
- Stelle
- 850
- Fork
- 305
- Merge medio
- 2g 10h
- PR unite (30g)
- 7
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di VUnit/vunit
-
KeyError in test scheduler when using TestBench.scan_tests_from_file()Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
GHDL: generics leak between configurations when `ghdl.sim_flags` is setForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
VUnit/vunit#1223 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
AXI slave VCs have identical stalling behaviorForse già presa @Lay007 l’ha presa 27 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
VUnit/vunit#1219 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
bug: workspace access hint suggests a --subject command that fails for hyphen-leading OIDC subjectsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
griffinwork40/agent-afk#4356 ·
I maintainer di solito rispondono entro 1 giorno
-
level/task type/enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
wazuh/wazuh-installation-assistant#1177 ·
I maintainer di solito rispondono entro 1 giorno
-
0. Needs triage 35-feedback bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno