From 84ab48482cc523a27acd94d70536d9d62d62ef19 Mon Sep 17 00:00:00 2001 From: joobisb Date: Thu, 3 Oct 2024 11:47:24 +0530 Subject: [PATCH 1/3] docs: explain --rich-parameter-file format --- docs/reference/cli/create.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/reference/cli/create.md b/docs/reference/cli/create.md index aefaf4d316d0b..9b85221c4cb0c 100644 --- a/docs/reference/cli/create.md +++ b/docs/reference/cli/create.md @@ -90,7 +90,12 @@ Rich parameter value in the format "name=value". | Type | string | | Environment | $CODER_RICH_PARAMETER_FILE | -Specify a file path with values for rich parameters defined in the template. +Specify a file path with values for rich parameters. The file should be in YAML format, containing key-value pairs for the parameters. For example: + +```yaml +param1: value1 +param2: value2 +``` ### --parameter-default From 990ce4e1155d08ce05bd7c2c83f0d5fc474a3b23 Mon Sep 17 00:00:00 2001 From: joobisb Date: Thu, 3 Oct 2024 15:27:44 +0530 Subject: [PATCH 2/3] generate docs --- cli/parameter.go | 2 +- docs/reference/cli/create.md | 7 +------ docs/reference/cli/restart.md | 2 +- docs/reference/cli/start.md | 2 +- docs/reference/cli/update.md | 2 +- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/cli/parameter.go b/cli/parameter.go index 2c09e9bbefc33..e674348fa1e06 100644 --- a/cli/parameter.go +++ b/cli/parameter.go @@ -58,7 +58,7 @@ func (wpf *workspaceParameterFlags) cliParameters() []serpent.Option { serpent.Option{ Flag: "rich-parameter-file", Env: "CODER_RICH_PARAMETER_FILE", - Description: "Specify a file path with values for rich parameters defined in the template.", + Description: "Specify a file path with values for rich parameters defined in the template. The file should be in YAML format, containing key-value pairs for the parameters.", Value: serpent.StringOf(&wpf.richParameterFile), }, } diff --git a/docs/reference/cli/create.md b/docs/reference/cli/create.md index 9b85221c4cb0c..d4003e2f9e6b3 100644 --- a/docs/reference/cli/create.md +++ b/docs/reference/cli/create.md @@ -90,12 +90,7 @@ Rich parameter value in the format "name=value". | Type | string | | Environment | $CODER_RICH_PARAMETER_FILE | -Specify a file path with values for rich parameters. The file should be in YAML format, containing key-value pairs for the parameters. For example: - -```yaml -param1: value1 -param2: value2 -``` +Specify a file path with values for rich parameters defined in the template. The file should be in YAML format, containing key-value pairs for the parameters. ### --parameter-default diff --git a/docs/reference/cli/restart.md b/docs/reference/cli/restart.md index 215917a8e0d22..33c8f94f27909 100644 --- a/docs/reference/cli/restart.md +++ b/docs/reference/cli/restart.md @@ -53,7 +53,7 @@ Rich parameter value in the format "name=value". | Type | string | | Environment | $CODER_RICH_PARAMETER_FILE | -Specify a file path with values for rich parameters defined in the template. +Specify a file path with values for rich parameters defined in the template. The file should be in YAML format, containing key-value pairs for the parameters. ### --parameter-default diff --git a/docs/reference/cli/start.md b/docs/reference/cli/start.md index 0852ec5b57400..7fa2f246846e7 100644 --- a/docs/reference/cli/start.md +++ b/docs/reference/cli/start.md @@ -53,7 +53,7 @@ Rich parameter value in the format "name=value". | Type | string | | Environment | $CODER_RICH_PARAMETER_FILE | -Specify a file path with values for rich parameters defined in the template. +Specify a file path with values for rich parameters defined in the template. The file should be in YAML format, containing key-value pairs for the parameters. ### --parameter-default diff --git a/docs/reference/cli/update.md b/docs/reference/cli/update.md index 562d32f8fd960..87665c79cd361 100644 --- a/docs/reference/cli/update.md +++ b/docs/reference/cli/update.md @@ -51,7 +51,7 @@ Rich parameter value in the format "name=value". | Type | string | | Environment | $CODER_RICH_PARAMETER_FILE | -Specify a file path with values for rich parameters defined in the template. +Specify a file path with values for rich parameters defined in the template. The file should be in YAML format, containing key-value pairs for the parameters. ### --parameter-default From 8c4e7177fa9264323bd57d47f88697eaf602a9da Mon Sep 17 00:00:00 2001 From: joobisb Date: Fri, 4 Oct 2024 10:30:09 +0530 Subject: [PATCH 3/3] fix test --- cli/testdata/coder_create_--help.golden | 3 ++- cli/testdata/coder_restart_--help.golden | 3 ++- cli/testdata/coder_start_--help.golden | 3 ++- cli/testdata/coder_update_--help.golden | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cli/testdata/coder_create_--help.golden b/cli/testdata/coder_create_--help.golden index 7101eec667d0a..e4949750f24f7 100644 --- a/cli/testdata/coder_create_--help.golden +++ b/cli/testdata/coder_create_--help.golden @@ -28,7 +28,8 @@ OPTIONS: --rich-parameter-file string, $CODER_RICH_PARAMETER_FILE Specify a file path with values for rich parameters defined in the - template. + template. The file should be in YAML format, containing key-value + pairs for the parameters. --start-at string, $CODER_WORKSPACE_START_AT Specify the workspace autostart schedule. Check coder schedule start diff --git a/cli/testdata/coder_restart_--help.golden b/cli/testdata/coder_restart_--help.golden index b0b036929cc9a..84d3e0f14996b 100644 --- a/cli/testdata/coder_restart_--help.golden +++ b/cli/testdata/coder_restart_--help.golden @@ -24,7 +24,8 @@ OPTIONS: --rich-parameter-file string, $CODER_RICH_PARAMETER_FILE Specify a file path with values for rich parameters defined in the - template. + template. The file should be in YAML format, containing key-value + pairs for the parameters. -y, --yes bool Bypass prompts. diff --git a/cli/testdata/coder_start_--help.golden b/cli/testdata/coder_start_--help.golden index 4985930b624d2..a4c77e4fa9698 100644 --- a/cli/testdata/coder_start_--help.golden +++ b/cli/testdata/coder_start_--help.golden @@ -24,7 +24,8 @@ OPTIONS: --rich-parameter-file string, $CODER_RICH_PARAMETER_FILE Specify a file path with values for rich parameters defined in the - template. + template. The file should be in YAML format, containing key-value + pairs for the parameters. -y, --yes bool Bypass prompts. diff --git a/cli/testdata/coder_update_--help.golden b/cli/testdata/coder_update_--help.golden index bff90868468ab..98537fade95f4 100644 --- a/cli/testdata/coder_update_--help.golden +++ b/cli/testdata/coder_update_--help.golden @@ -26,7 +26,8 @@ OPTIONS: --rich-parameter-file string, $CODER_RICH_PARAMETER_FILE Specify a file path with values for rich parameters defined in the - template. + template. The file should be in YAML format, containing key-value + pairs for the parameters. ——— Run `coder --help` for a list of global options.