mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-14 14:17:49 +00:00
1 parent
d6ea5bffde
commit
7067963d6e
2 files changed
+23
No files matched your search
@@ -2,6 +2,9 @@
|
||||
|
||||
Status of the `main` branch. Changes prior to the next official version change will appear here.
|
||||
|
||||
* General:
|
||||
- Support `serena --version` CLI command for displaying the current version #1347
|
||||
|
||||
# v1.1.2 (2026-04-14)
|
||||
|
||||
* General:
|
||||
|
||||
@@ -139,6 +139,26 @@ class TopLevelCommands(AutoRegisteringGroup):
|
||||
"that separate entrypoint for performance reasons, see `serena-hooks --help`. You can run `<command> --help` for more info on each command.",
|
||||
)
|
||||
|
||||
# register --version / -V flag
|
||||
self.params.append(
|
||||
click.Option(
|
||||
["--version", "-V"],
|
||||
is_flag=True,
|
||||
expose_value=False,
|
||||
is_eager=True,
|
||||
callback=self._print_version,
|
||||
help="Show the version and exit.",
|
||||
)
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def _print_version(ctx: click.Context, _param: click.Parameter, value: bool) -> None:
|
||||
"""Print version string and exit if the flag is set."""
|
||||
if not value:
|
||||
return
|
||||
click.echo(f"Serena {serena_version()}")
|
||||
ctx.exit()
|
||||
|
||||
@staticmethod
|
||||
@click.command(
|
||||
"init",
|
||||
|
||||
Reference in new issue
Block a user