mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Merge pull request #1108 from jspv/main
Set `argv` when importing app via `textual run`.
This commit is contained in:
@@ -118,6 +118,8 @@ def import_app(import_name: str) -> App:
|
|||||||
except AttributeError:
|
except AttributeError:
|
||||||
raise AppFail(f"Unable to find {name!r} in {module!r}")
|
raise AppFail(f"Unable to find {name!r} in {module!r}")
|
||||||
|
|
||||||
|
sys.argv[:] = [import_name, *argv]
|
||||||
|
|
||||||
if inspect.isclass(app) and issubclass(app, App):
|
if inspect.isclass(app) and issubclass(app, App):
|
||||||
app = app()
|
app = app()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user