Compare commits
1 commit
dc11436076
...
1a716f38d6
Author | SHA1 | Date | |
---|---|---|---|
1a716f38d6 |
1 changed files with 28 additions and 0 deletions
|
@ -135,6 +135,34 @@ def serve(
|
|||
)
|
||||
|
||||
|
||||
@app.command()
|
||||
def templates(
|
||||
templates: Annotated[
|
||||
list[str] | None,
|
||||
typer.Argument(
|
||||
help="List of included templates to copy. Suffix .html is optional. Argument is required unless --all is given.",
|
||||
show_default=False,
|
||||
),
|
||||
] = None,
|
||||
all: Annotated[
|
||||
bool,
|
||||
typer.Option(
|
||||
"-a", "--all", help="Write all included templates."
|
||||
),
|
||||
] = False,
|
||||
):
|
||||
if not all and not templates:
|
||||
raise typer.BadParameter(
|
||||
"Must provide template names unless --all is specified."
|
||||
)
|
||||
if not all:
|
||||
assert templates
|
||||
for t in templates:
|
||||
print(t)
|
||||
else:
|
||||
print("we do it")
|
||||
|
||||
|
||||
def version_callback(value: bool):
|
||||
if value:
|
||||
print(f"Zona version: {__version__('zona')}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue