mirror of
https://ghfast.top/https://github.com/aeroxw/easy-tdx.git
synced 2026-09-12 14:34:15 +08:00
fix: remove hardcoded version in 'version' command, read from importlib.metadata
This commit is contained in:
@@ -43,4 +43,5 @@ def ping(timeout: float, use_table: bool, output_fmt: str) -> None:
|
||||
@click.command()
|
||||
def version() -> None:
|
||||
"""显示版本号。"""
|
||||
click.echo("easy-tdx 1.1.0")
|
||||
ver = __import__("importlib.metadata", fromlist=["version"]).version("easy-tdx")
|
||||
click.echo(f"easy-tdx {ver}")
|
||||
|
||||
Reference in New Issue
Block a user