Skip to content

Make --version a non-global option? #142

Description

@mkniewallner

As reported in python-poetry/poetry#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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement of an existing feature

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions