Can't add an option with name `n`

Offen
#91 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
python
Bereich
cli

Rechercherichtung

Reproduce the option definition from vkquick/main.py and follow the traceback through clikit's CommandConfig.build_args_format and ArgsFormatBuilder.add_option. Determine whether the existing -n option is built in and whether overriding it is intended; done means the behavior is documented or supported with a regression test.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement

I want to add an option with name n

{--n|names=* : Some description}

But I get this:

Traceback (most recent call last):
  File "/Users/an/Desktop/vkquick/env/bin/vq", line 2, in <module>
    from vkquick.__main__ import app
  File "/Users/an/Desktop/vkquick/vkquick/__main__.py", line 23, in <module>
    app.add_commands(New(), DebugRun(), ReleaseRun(), Com())
  File "/Users/an/Desktop/vkquick/env/lib/python3.8/site-packages/cleo/application.py", line 36, in add_commands
    self.add(command)
  File "/Users/an/Desktop/vkquick/env/lib/python3.8/site-packages/cleo/application.py", line 42, in add
    self.add_command(command.config)
  File "/Users/an/Desktop/vkquick/env/lib/python3.8/site-packages/clikit/console_application.py", line 163, in add_command
    command = Command(config, self)
  File "/Users/an/Desktop/vkquick/env/lib/python3.8/site-packages/clikit/api/command/command.py", line 35, in __init__
    self._args_format = config.build_args_format(self.base_format)
  File "/Users/an/Desktop/vkquick/env/lib/python3.8/site-packages/clikit/api/config/command_config.py", line 159, in build_args_format
    builder.add_options(*self.options.values())
  File "/Users/an/Desktop/vkquick/env/lib/python3.8/site-packages/clikit/api/args/format/args_format_builder.py", line 292, in add_options
    self.add_option(option)
  File "/Users/an/Desktop/vkquick/env/lib/python3.8/site-packages/clikit/api/args/format/args_format_builder.py", line 302, in add_option
    raise CannotAddOptionException.already_exists(short_name)
clikit.api.args.exceptions.CannotAddOptionException: An option named "-n" exists already.

There aren't any options with name n so I think it is a "built-in". Can I override it?

Vorherrschende Sprache
Python
Sterne
1.4k
Forks
108
Ø Merge
15 Min.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus python-poetry/cleo

Alle Issues in python-poetry/cleo

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.