diff --git a/CHANGELOG.md b/CHANGELOG.md index 27c79cb..f1e8c68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 1.13.1 - 2024-11-24 +## 1.13.2 - 2024-11-24 ### Internal diff --git a/litecli/main.py b/litecli/main.py index e10212c..a0607ab 100644 --- a/litecli/main.py +++ b/litecli/main.py @@ -825,15 +825,8 @@ def get_last_query(self): return self.query_history[-1][0] if self.query_history else None -def version_callback(ctx: click.Context, param: click.Parameter, value: bool) -> None: - if not value or ctx.resilient_parsing: - return - click.echo(f"Version: {__version__}", color=ctx.color) - ctx.exit() - - @click.command() -@click.option("-V", "--version", callback=version_callback, expose_value=False, is_eager=True, is_flag=True, help="Show version.") +@click.version_option(__version__, "-V", "--version") @click.option("-D", "--database", "dbname", help="Database to use.") @click.option( "-R", diff --git a/pyproject.toml b/pyproject.toml index 6ee919d..5caeb84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,9 +17,15 @@ dependencies = [ ] [build-system] -requires = ["setuptools>=64.0", "setuptools-scm>=8"] +requires = [ + "setuptools>=64.0", + "setuptools-scm>=8;python_version>='3.8'", + "setuptools-scm<8;python_version<'3.8'", +] build-backend = "setuptools.build_meta" +[tool.setuptools_scm] + [project.scripts] litecli = "litecli.main:cli"