Skip to content

Commit a9b4362

Browse files
committed
Update doc for infrahubctl and fix for hidden commands
1 parent 446668c commit a9b4362

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

docs/docs/infrahubctl/infrahubctl-object.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ $ infrahubctl object [OPTIONS] COMMAND [ARGS]...
1717
**Commands**:
1818

1919
* `load`: Load one or multiple objects files into...
20+
* `validate`: Validate one or multiple objects files.
2021

2122
## `infrahubctl object load`
2223

@@ -38,3 +39,24 @@ $ infrahubctl object load [OPTIONS] PATHS...
3839
* `--branch TEXT`: Branch on which to load the objects.
3940
* `--config-file TEXT`: [env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
4041
* `--help`: Show this message and exit.
42+
43+
## `infrahubctl object validate`
44+
45+
Validate one or multiple objects files.
46+
47+
**Usage**:
48+
49+
```console
50+
$ infrahubctl object validate [OPTIONS] PATHS...
51+
```
52+
53+
**Arguments**:
54+
55+
* `PATHS...`: [required]
56+
57+
**Options**:
58+
59+
* `--debug / --no-debug`: [default: no-debug]
60+
* `--branch TEXT`: Branch on which to validate the objects.
61+
* `--config-file TEXT`: [env var: INFRAHUBCTL_CONFIG; default: infrahubctl.toml]
62+
* `--help`: Show this message and exit.

tasks.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,23 @@ def _generate_infrahubctl_documentation(context: Context) -> None:
2424

2525
output_dir = DOCUMENTATION_DIRECTORY / "docs" / "infrahubctl"
2626
output_dir.mkdir(parents=True, exist_ok=True)
27+
28+
# Delete any existing infrahubctl- files in output dir
29+
for file in output_dir.glob("infrahubctl-*"):
30+
file.unlink()
31+
2732
print(" - Generate infrahubctl CLI documentation")
2833
for cmd in app.registered_commands:
34+
if cmd.hidden:
35+
continue
2936
exec_cmd = f'poetry run typer --func {cmd.name} infrahub_sdk.ctl.cli_commands utils docs --name "infrahubctl {cmd.name}"'
3037
exec_cmd += f" --output docs/docs/infrahubctl/infrahubctl-{cmd.name}.mdx"
3138
with context.cd(MAIN_DIRECTORY_PATH):
3239
context.run(exec_cmd)
3340

3441
for cmd in app.registered_groups:
42+
if cmd.hidden:
43+
continue
3544
exec_cmd = f"poetry run typer infrahub_sdk.ctl.{cmd.name} utils docs"
3645
exec_cmd += f' --name "infrahubctl {cmd.name}" --output docs/docs/infrahubctl/infrahubctl-{cmd.name}.mdx'
3746
with context.cd(MAIN_DIRECTORY_PATH):

0 commit comments

Comments
 (0)