mirror of
https://github.com/Textualize/trogon.git
synced 2023-05-22 11:05:13 +03:00
fixes
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user