Skip to content

Commit 3fb79ef

Browse files
committed
Add argument helpers for cli command
1 parent 8be8f26 commit 3fb79ef

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/docs/infrahubctl/infrahubctl-repository.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ Initialize a new Infrahub repository.
5555
**Usage**:
5656

5757
```console
58-
$ infrahubctl repository init [OPTIONS] DST
58+
$ infrahubctl repository init [OPTIONS] DIRECTORY
5959
```
6060

6161
**Arguments**:
6262

63-
* `DST`: [required]
63+
* `DIRECTORY`: Directory path for the new project. [required]
6464

6565
**Options**:
6666

67-
* `--data PATH`
67+
* `--data PATH`: Path to YAML file containing answers to CLI prompt.
6868
* `--config-file TEXT`: [env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
6969
* `--help`: Show this message and exit.
7070

infrahub_sdk/ctl/repository.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ async def list(
171171

172172
@app.command()
173173
async def init(
174-
dst: Path,
175-
data: Optional[Path] = None,
174+
directory: Path = typer.Argument(help="Directory path for the new project."),
175+
data: Optional[Path] = typer.Option(default=None, help="Path to YAML file containing answers to CLI prompt."),
176176
_: str = CONFIG_PARAM,
177177
) -> None:
178178
"""Initialize a new Infrahub repository."""
@@ -188,7 +188,7 @@ async def init(
188188
raise typer.Exit(code=1)
189189

190190
try:
191-
await asyncio.to_thread(run_copy, str(example_repo), str(dst), data=config_data)
191+
await asyncio.to_thread(run_copy, str(example_repo), str(directory), data=config_data)
192192
except Exception as e:
193193
typer.echo(f"Error running copier: {e}", err=True)
194194
raise typer.Exit(code=1)

0 commit comments

Comments
 (0)