Make `--version` a non-global option?

Offen
#142 1 Kommentar 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

  • #143 von @mkniewallner — ohne Merge geschlossen

Bewertung

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

Rechercherichtung

Start by tracing how Cleo registers global options and selects the default command. Compare poetry --version, poetry list --version, and poetry add httpx --version to identify the intended command-level behavior. Done means --version remains available for the default command, is rejected by add, and the breaking change is documented.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement

As reported in https://github.com/python-poetry/poetry/issues/5128, --version is currently a global option in cleo.

This makes the behavior of some commands pretty weird, since passing --version to any command will exit the command early and print the version.

For instance, in the case of Poetry:

$ poetry add httpx --version
Poetry (version 1.2.0b2.dev0)

This also prevents this option from being used for commands in other contexts, as the original issue in Poetry reports.

Proposal

As this is still nice to have --version option, maybe the option could only be available for the default command?
That way, in the case of Poetry, doing either poetry --version or poetry list --version would display the version, but poetry add httpx --version would raise The option "--version" does not exist, and in the future, we would be able to add --version for specific commands if needed.

Though this proposal would definitely be a breaking change worth mentioning.

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.