Skip to content

Commit eba494f

Browse files
authored
feat: add --version flag to CLI (#15)
Add click.version_option decorator to the main CLI group so that `wtf --version` prints the version. Previously only the `wtf version` subcommand was available.
1 parent 3de0732 commit eba494f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/worktreeflow/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def format_help_text(self, ctx: click.Context, formatter: click.HelpFormatter) -
7070

7171

7272
@click.group(cls=AliasGroup, invoke_without_command=True)
73+
@click.version_option(version=__version__, prog_name="worktreeflow")
7374
@click.option("--debug", "-d", is_flag=True, help="Enable debug output (shows bash commands)", envvar="WTF_DEBUG")
7475
@click.option("--dry-run", "-n", is_flag=True, help="Preview commands without execution", envvar="WTF_DRY_RUN")
7576
@click.option("--save-history", is_flag=True, help="Save command history to .wtf_history.json")

0 commit comments

Comments
 (0)