Skip to content

--version flag #49

Description

@joshua-light

As a CLI developer, I want to have an auto-generated --version flag support.

API

The first and obvious solution is to use an explicit version value:

# test.py

from candies.cli import cli

@cli(version='1.0')
def main():
    ...

But it could lead to problems, because CLI apps are usually distributed through, for example, PyPi, so the --version flag should match the version of the package itself.

Questions

  • How something similar is implemented in Click or Fire?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions