Skip to content

Commit ab09bb8

Browse files
committed
docstring
1 parent 654c623 commit ab09bb8

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/textual_dev/cli.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,18 +227,29 @@ def _run_app(
227227
run_app(import_name, args, environment)
228228

229229
@run.command("serve")
230+
@click.argument("command")
230231
@click.option("-h", "--host", type=str, default="localhost", help="Host to serve on")
231232
@click.option("-p", "--port", type=int, default=8000, help="Port of server")
232233
@click.option("-t", "--title", type=str, default="Textual App", help="Name of the app being served")
233234
@click.option("-u", "--url", type=str, default=None, help="Public URL")
234235
@click.option("--dev", type=bool, default=False, is_flag=True, help="Enable debug mode")
235-
@click.argument("command", nargs=-1, type=click.UNPROCESSED)
236-
def serve(host:str, port:int, title:str, url:str | None, dev:bool, command:tuple[str]) -> None:
237-
"""Run a local web server to serve the application. """
236+
237+
def serve(command:str, host:str, port:int, title:str, url:str | None, dev:bool) -> None:
238+
"""Run a local web server to serve the application.
239+
240+
The command to run should be appended to "textual serve", and should include any python invocation.
241+
242+
textual serve "python -m textual"
243+
244+
You may also want to add the `--dev` switch, which will enable textual devtools.
245+
246+
textual serve --dev "python -m textual"
247+
248+
249+
"""
238250
from textual_serve.server import Server
239251

240-
run_command = " ".join(command)
241-
server = Server(run_command, host, port, title=title, public_url=url)
252+
server = Server(command, host, port, title=title, public_url=url)
242253
server.serve(debug=dev)
243254

244255

0 commit comments

Comments
 (0)