Skip to content

Commit bf38237

Browse files
improve: add name to all typer commands (#985)
Co-authored-by: aghasemi <[email protected]>
1 parent 1baeab6 commit bf38237

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

datacontract/cli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def common(
6767
pass
6868

6969

70-
@app.command()
70+
@app.command(name="init")
7171
def init(
7272
location: Annotated[
7373
str, typer.Argument(help="The location of the data contract file to create.")
@@ -90,7 +90,7 @@ def init(
9090
console.print("📄 data contract written to " + location)
9191

9292

93-
@app.command()
93+
@app.command(name="lint")
9494
def lint(
9595
location: Annotated[
9696
str,
@@ -125,7 +125,7 @@ def enable_debug_logging(debug: bool):
125125
)
126126

127127

128-
@app.command()
128+
@app.command(name="test")
129129
def test(
130130
location: Annotated[
131131
str,
@@ -187,7 +187,7 @@ def test(
187187
write_test_result(run, console, output_format, output, data_contract)
188188

189189

190-
@app.command()
190+
@app.command(name="export")
191191
def export(
192192
format: Annotated[ExportFormat, typer.Option(help="The export format.")],
193193
output: Annotated[
@@ -467,7 +467,7 @@ def _get_uvicorn_arguments(port: int, host: str, context: typer.Context) -> dict
467467
return default_args | dict(zip(trimmed_keys, context.args[1::2]))
468468

469469

470-
@app.command(context_settings={"allow_extra_args": True, "ignore_unknown_options": True})
470+
@app.command(name="api", context_settings={"allow_extra_args": True, "ignore_unknown_options": True})
471471
def api(
472472
ctx: Annotated[typer.Context, typer.Option(help="Extra arguments to pass to uvicorn.run().")],
473473
port: Annotated[int, typer.Option(help="Bind socket to this port.")] = 4242,

0 commit comments

Comments
 (0)