This commit is contained in:
Will McGugan
2023-05-20 19:53:02 +01:00
parent 0752be27f5
commit a7649443f5
3 changed files with 4 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = "trogon"
version = "0.2.0"
version = "0.2.1"
description = "Automatically generate a Textual TUI for your Cick CLI"
authors = ["Darren Burns <darrenb900@gmail.com>"]
readme = "README.md"

View File

@@ -167,6 +167,7 @@ class UserCommandData:
except ValueError:
# TODO: Not sure if this is the right thing to do
count = 1
count = max(1, min(count, 3))
if option_name.startswith("--"):
args.extend([option_name] * count)
else:

View File

@@ -286,11 +286,11 @@ def tui(name: str | None = None):
Trogon(app, app_name=name, click_context=ctx).run()
if isinstance(app, click.Group):
app.command(name="tui")(wrapped_tui)
app.command(name="tui", help="Open Textual TUI.")(wrapped_tui)
else:
new_group = click.Group()
new_group.add_command(app)
new_group.command(name="tui")(wrapped_tui)
new_group.command(name="tui", help="Open Textual TUI.")(wrapped_tui)
return new_group
return app