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?
As a CLI developer, I want to have an auto-generated
--versionflag support.API
The first and obvious solution is to use an explicit version value:
But it could lead to problems, because CLI apps are usually distributed through, for example, PyPi, so the
--versionflag should match the version of the package itself.Questions