From 675ff794bc4005923d191cb31f750e94a47cd90b Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sat, 2 Nov 2024 14:58:14 +0100 Subject: [PATCH] [tutorial 013] A variable with type "choice" (config and doc) --- README.md | 33 +++++++++++++++++++++++---------- config/04/output_ro.html | 8 ++++++-- config/05/output_ro.html | 4 +++- 3 files changed, 32 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index c84de44..fd0920f 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ - [Summary](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/branch/1.1/README.md) -- [[tutorial 011] The variable description](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_011/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_011~1..v1.1_011)) +- [[tutorial 012] A default value](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_012/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_012~1..v1.1_012)) -# [tutorial 012] A default value +# [tutorial 013] A variable with type "choice" -[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_012~1..v1.1_012) +[View the diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_013~1..v1.1_013) ## Screenshot @@ -22,6 +22,13 @@ --- proxy_mode: description: Configure Proxy Access to the Internet + type: choice + choices: + - No proxy + - Auto-detect proxy settings for this network + - Use system proxy settings + - Manual proxy configuration + - Automatic proxy configuration URL default: No proxy ``` @@ -32,9 +39,9 @@ foo@bar:~$ rougail -v 1.1 -m firefox/ -o doc -do github ``` ### Variables -| Variable                                                                                        | Description                                                                                     | -|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| **proxy_mode**
[`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Configure Proxy Access to the Internet.
**Default**: No proxy | +| Variable                                                                                                                                                                                             | Description                                                                                                                                                                                          | +|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **proxy_mode**
[`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | Configure Proxy Access to the Internet.
**Choices**:
- No proxy ← (default)
- Auto-detect proxy settings for this network
- Use system proxy settings
- Manual proxy configuration
- Automatic proxy configuration URL | ## User data @@ -125,14 +132,18 @@ proxy_mode: foo ```console foo@bar:~$ rougail -v 1.1 -m firefox/ -u file -ff config/04/config.yaml ``` -
╭────────────────────────── Caption ──────────────────────────╮
+
🛑 ERRORS
+┗━━ "foo" is an invalid choice for "proxy_mode (Configure Proxy Access to the Internet)", only 
+    "Auto-detect proxy settings for this network", "Automatic proxy configuration URL", "Manual proxy 
+    configuration", "No proxy" and "Use system proxy settings" are allowed
+╭────────────────────────── Caption ──────────────────────────╮
 │ Variable                           Default value            │
 │ Undocumented variable              Modified value           │
 │ Undocumented but modified variable (Original default value) │
 │ Unmodifiable variable                                       │
 ╰─────────────────────────────────────────────────────────────╯
 Variables:
-┗━━ 📓 proxy_mode: foo (No proxy)
+┗━━ 📓 proxy_mode: No proxy
 
### Example 5 @@ -150,7 +161,9 @@ proxy_mode: 1 foo@bar:~$ rougail -v 1.1 -m firefox/ -u file -ff config/05/config.yaml ```
🛑 ERRORS
-┗━━ "1" is an invalid string for "proxy_mode (Configure Proxy Access to the Internet)"
+┗━━ "1" is an invalid choice for "proxy_mode (Configure Proxy Access to the Internet)", only "Auto-detect
+    proxy settings for this network", "Automatic proxy configuration URL", "Manual proxy configuration", 
+    "No proxy" and "Use system proxy settings" are allowed
 ╭────────────────────────── Caption ──────────────────────────╮
 │ Variable                           Default value            │
 │ Undocumented variable              Modified value           │
@@ -162,4 +175,4 @@ Variables:
 
-- [[tutorial 013] A variable with type "choice"](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_013/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_013~1..v1.1_013)) +- [[tutorial 014] Choice type is optional](https://forge.cloud.silique.fr/stove/rougail-tutorials/src/commit/v1.1_014/README.md) ([diff](https://forge.cloud.silique.fr/stove/rougail-tutorials/compare/v1.1_014~1..v1.1_014)) diff --git a/config/04/output_ro.html b/config/04/output_ro.html index 55d31f3..5fe2e0d 100644 --- a/config/04/output_ro.html +++ b/config/04/output_ro.html @@ -1,9 +1,13 @@ -
╭────────────────────────── Caption ──────────────────────────╮
+
🛑 ERRORS
+┗━━ "foo" is an invalid choice for "proxy_mode (Configure Proxy Access to the Internet)", only 
+    "Auto-detect proxy settings for this network", "Automatic proxy configuration URL", "Manual proxy 
+    configuration", "No proxy" and "Use system proxy settings" are allowed
+╭────────────────────────── Caption ──────────────────────────╮
 │ Variable                           Default value            │
 │ Undocumented variable              Modified value           │
 │ Undocumented but modified variable (Original default value) │
 │ Unmodifiable variable                                       │
 ╰─────────────────────────────────────────────────────────────╯
 Variables:
-┗━━ 📓 proxy_mode: foo (No proxy)
+┗━━ 📓 proxy_mode: No proxy
 
diff --git a/config/05/output_ro.html b/config/05/output_ro.html index bf39385..071b4d5 100644 --- a/config/05/output_ro.html +++ b/config/05/output_ro.html @@ -1,5 +1,7 @@
🛑 ERRORS
-┗━━ "1" is an invalid string for "proxy_mode (Configure Proxy Access to the Internet)"
+┗━━ "1" is an invalid choice for "proxy_mode (Configure Proxy Access to the Internet)", only "Auto-detect
+    proxy settings for this network", "Automatic proxy configuration URL", "Manual proxy configuration", 
+    "No proxy" and "Use system proxy settings" are allowed
 ╭────────────────────────── Caption ──────────────────────────╮
 │ Variable                           Default value            │
 │ Undocumented variable              Modified value           │