From 2691be46d2695d2af2b8661f03a778f29fd6ff0a Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 15 Jun 2026 09:42:41 +0200 Subject: [PATCH] feat: support commandline user data --- README.fr.md | 357 ++++++++++++++++-- README.md | 357 ++++++++++++++++-- locale/fr/LC_MESSAGES/rougail_cli.po | 103 +++-- locale/rougail_cli.pot | 110 ++++-- src/rougail/cli/__main__.py | 43 ++- .../cli/locale/fr/LC_MESSAGES/rougail_cli.mo | Bin 5108 -> 6130 bytes src/rougail/cli/rougailconfig.py | 1 + tests/rougailcli_file/warnings.txt | 2 +- tests/rougailcli_file/warnings3.txt | 2 +- 9 files changed, 834 insertions(+), 141 deletions(-) diff --git a/README.fr.md b/README.fr.md index 2e3aaf1..f16f539 100644 --- a/README.fr.md +++ b/README.fr.md @@ -1,31 +1,334 @@ ---- -gitea: none -include_toc: true ---- -[🇬🇧 (EN)](README.md) - [đŸ‡«đŸ‡· (FR)](README.fr.md) +Options de la ligne de commande +=============================== -## Options de la ligne de commande +.. note:: -> [!NOTE] -> -> Il est possible d'utiliser Rougail directement en ligne de commande. Il est possible de dĂ©finir et configurer facilement les donnĂ©es utilisateur chargĂ©es, ainsi que la dĂ©finition de la sortie souhaitĂ©.\ -> **Chemin** : cli - -| Variable | Description | Valeur par dĂ©faut | Type | ContrĂŽle des accĂšs | Validateur | -|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------| -| **cli.config_file**
**Variable d'environnement** : CLI.CONFIG_FILE | Charger les paramĂštres de la ligne de commande depuis un fichier. | ‱ .rougailcli.yml | [`UNIX filename`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` | | ‱ le nom de fichier peut ĂȘtre une chemin relatif
‱ type de fichier autorisĂ©: "fichier" et "rĂ©pertoire". | -| **cli.debug**
**Ligne de commande** :
‱ --cli.debug
‱ --cli.no-debug
**Variable d'environnement** : CLI.DEBUG | Afficher les informations de debug. | false | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | | | -| **cli.warnings**
**Ligne de commande** :
‱ --cli.warnings
‱ --cli.no-warnings
**Variable d'environnement** : CLI.WARNINGS | Afficher les avertissements de chargement des options de la ligne de commande. | true | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | | | -| **cli.versions**
**Ligne de commande** :
‱ --cli.versions
‱ --cli.no-versions
**Variable d'environnement** : CLI.VERSIONS | Afficher la version de Rougail et de tous ces composants. | false | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | | | -| **cli.invalid_user_data_error**
**Ligne de commande** :
‱ --cli.invalid_user_data_error
‱ --cli.no-invalid_user_data_error
**Variable d'environnement** : CLI.INVALID_USER_DATA_ERROR | Les valeurs invalides dans les données utilisateur ne sont pas autorisées. | false | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | | | -| **cli.unknown_user_data_error**
**Ligne de commande** :
‱ --cli.unknown_user_data_error
‱ --cli.no-unknown_user_data_error
**Variable d'environnement** : CLI.UNKNOWN_USER_DATA_ERROR | Les variables inconnues dans les données utilisateur ne sont pas autorisées. | false | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | | | -| **cli.layers**
**Ligne de commande** :
‱ -cl, --cli.layers
‱ -ncl, --cli.no-layers
**Variable d'environnement** : CLI.LAYERS | Charger chaque données utilisateurs dans des couches séparées. | false | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | *`cachée`*
**Cachée** : si seulement un type de données utilisateur est renseigné dans "[Sélection pour données utilisateur](#step.user_data)" | | -| **cli.load_from_tiramisu_cache**
**Ligne de commande** :
‱ --cli.load_from_tiramisu_cache
‱ --cli.no-load_from_tiramisu_cache
**Variable d'environnement** : CLI.LOAD_FROM_TIRAMISU_CACHE | Utiliser le cache pour charger les objets Tiramisu.
Il sera chargé à partir du cache uniquement si celui-ci existe déjà.

Attention, certain donnĂ©es utilisateur ou sortie peuvent changer la maniĂšre dont sont chargĂ©s les fichiers de structure (c'est notamment le cas avec la sortie doc). Il est prĂ©fĂ©rable de n'utiliser le cache pour le mĂȘme type de donnĂ©es utilisateur et sortie. | false | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | *`dĂ©sactivĂ©`*
**Désactivé** : lorsque la variable "[Enregistrer le cache Tiramisu dans le fichier](#tiramisu_cache)" a la valeur "null" | | -| **cli.root**
**Ligne de commande** :
-cr, --cli.root
**Variable d'environnement** : CLI.ROOT | Utiliser la sortie uniquement pour les variables enfants de la famille.
Par dĂ©faut, toutes les variables accessible sont inclus dans la sortie. Il est possible de dĂ©finir la famille a partir de laquelle la sortie devra ĂȘtre gĂ©nĂ©rĂ©e. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) | | | -| **cli.read_write**
**Ligne de commande** :
‱ --cli.read_write
‱ --cli.no-read_write
**Variable d'environnement** : CLI.READ_WRITE | La configuration dans l'état de sortie est dans mode lecture-écriture. | false | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | | | -| **cli.description_type**
**Ligne de commande** :
-cd, --cli.description_type
**Variable d'environnement** : CLI.DESCRIPTION_TYPE | Type de description des variables.
Pour identifier les différentes variables, on utilise la description de la variable. Il y a quatre type de descriptions:
- name_and_description : qui contient le nom de la variable suivi de sa description - path : le chemin de la variable - name : le nom de la variable - description : la description de la variable. | description | [`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `obligatoire` | | **Choix** :
‱ path_and_description
‱ name_and_description
‱ path
‱ name
‱ description | -| **cli.inaccessible_read_only_modes**
**Ligne de commande** :
--cli.inaccessible_read_only_modes
**Variable d'environnement** : CLI.INACCESSIBLE_READ_ONLY_MODES | Modes quoi doivent ĂȘtre inaccessible en mode lecture seule. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` | *`dĂ©sactivĂ©`*
**Désactivé** : si aucun mode n'est défini dans "[Tous les niveaux de modes valides](#modes_level)" | `unique`
Un mode doit exister dans "[Tous les niveaux de modes valides](#modes_level)". | -| **cli.inaccessible_read_write_modes**
**Ligne de commande** :
--cli.inaccessible_read_write_modes
**Variable d'environnement** : CLI.INACCESSIBLE_READ_WRITE_MODES | Modes quoi doivent ĂȘtre inaccessible en mode lecture-Ă©criture. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` | *`dĂ©sactivĂ©`*
**Désactivé** : si aucun mode n'est défini dans "[Tous les niveaux de modes valides](#modes_level)" | `unique`
Un mode doit exister dans "[Tous les niveaux de modes valides](#modes_level)". | -| **cli.inaccessible_modes**
**Ligne de commande** :
-ci, --cli.inaccessible_modes
**Variable d'environnement** : CLI.INACCESSIBLE_MODES | Modes quoi doivent ĂȘtre inaccessible. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` | *`dĂ©sactivĂ©`*
**Désactivé** : si aucun mode n'est défini dans "[Tous les niveaux de modes valides](#modes_level)" | `unique`
Un mode doit exister dans "[Tous les niveaux de modes valides](#modes_level)". | + | Il est possible d'utiliser Rougail directement en ligne de commande. Il est possible de dĂ©finir et configurer facilement les donnĂ©es utilisateur chargĂ©es, ainsi que la dĂ©finition de la sortie souhaitĂ©. + | **Chemin** : cli + +.. list-table:: + + * - Variable + - Description + + * - **cli.config_file** + + `UNIX filename `__ `multiple` `obligatoire` `unique` + + **Variable d'environnement** : ROUGAILCLI_CLI.CONFIG_FILE + - Charger les paramĂštres de la ligne de commande depuis un fichier. + + **Validateurs** : + + + + - le nom de fichier peut ĂȘtre une chemin relatif + + - 'type de fichier autorisĂ©: "directory" et "file"' + + + + **DĂ©faut** : + + + + - .rougailcli.yml + + * - **cli.debug** + + `boolean `__ `obligatoire` + + **Ligne de commande** : + + + + - --cli.debug + + - --cli.no-debug + + + + **Variable d'environnement** : ROUGAILCLI_CLI.DEBUG + - Afficher les informations de debug. + + **DĂ©faut** : false + + * - **cli.warnings** + + `boolean `__ `obligatoire` + + **Ligne de commande** : + + + + - --cli.warnings + + - --cli.no-warnings + + + + **Variable d'environnement** : ROUGAILCLI_CLI.WARNINGS + - Afficher les avertissements de chargement des options de la ligne de commande. + + **DĂ©faut** : true + + * - **cli.versions** + + `boolean `__ `obligatoire` + + **Ligne de commande** : + + + + - --cli.versions + + - --cli.no-versions + + + + **Variable d'environnement** : ROUGAILCLI_CLI.VERSIONS + - Afficher la version de Rougail et de tous ces composants. + + **DĂ©faut** : false + + * - **cli.invalid_user_data_error** + + `boolean `__ `obligatoire` + + **Ligne de commande** : + + + + - --cli.invalid_user_data_error + + - --cli.no-invalid_user_data_error + + + + **Variable d'environnement** : ROUGAILCLI_CLI.INVALID_USER_DATA_ERROR + - Les valeurs invalides dans les donnĂ©es utilisateur ne sont pas autorisĂ©es. + + **DĂ©faut** : false + + * - **cli.unknown_user_data_error** + + `boolean `__ `obligatoire` + + **Ligne de commande** : + + + + - --cli.unknown_user_data_error + + - --cli.no-unknown_user_data_error + + + + **Variable d'environnement** : ROUGAILCLI_CLI.UNKNOWN_USER_DATA_ERROR + - Les variables inconnues dans les donnĂ©es utilisateur ne sont pas autorisĂ©es. + + **DĂ©faut** : false + + * - **cli.layers** + + `boolean `__ `obligatoire` `*cachĂ©e*` + + **Ligne de commande** : + + + + - -cl, --cli.layers + + - -ncl, --cli.no-layers + + + + **Variable d'environnement** : ROUGAILCLI_CLI.LAYERS + - Charger chaque donnĂ©es utilisateurs dans des couches sĂ©parĂ©es. + + **DĂ©faut** : false + + **CachĂ©e** : si seulement un type de donnĂ©es utilisateur est renseignĂ© dans "sĂ©lection pour user data" (step.user_data). + + * - **cli.tiramisu_cache** + + `UNIX filename `__ + + **Ligne de commande** : + + -ct, --cli.tiramisu_cache + + **Variable d'environnement** : ROUGAILCLI_CLI.TIRAMISU_CACHE + - Nom du fichier d'enregistrement du cache de Tiramisu. + + Ce fichier contient les instructions Tiramisu utilisĂ© en interne pour charger les variables." + + + + Ce fichier peut est utilisĂ© pour charger Tiramisu depuis un cache au lieu de le regĂ©nĂ©rer". + + **Validateurs** : + + + + - le nom de fichier peut ĂȘtre une chemin relatif + + - 'type de fichier autorisĂ©: "file"' + + * - **cli.load_from_tiramisu_cache** + + `boolean `__ `obligatoire` `*dĂ©sactivĂ©*` + + **Ligne de commande** : + + + + - --cli.load_from_tiramisu_cache + + - --cli.no-load_from_tiramisu_cache + + + + **Variable d'environnement** : ROUGAILCLI_CLI.LOAD_FROM_TIRAMISU_CACHE + - Utiliser le cache pour charger les objets Tiramisu. + + Il sera chargĂ© Ă  partir du cache uniquement si celui-ci existe dĂ©jĂ . + + + + Attention, certain donnĂ©es utilisateur ou sortie peuvent changer la maniĂšre dont sont chargĂ©s les fichiers de structure (c'est notamment le cas avec la sortie doc). Il est prĂ©fĂ©rable de n'utiliser le cache pour le mĂȘme type de donnĂ©es utilisateur et sortie. + + **DĂ©faut** : false + + **DĂ©sactivĂ©** : lorsque la variable "Nom du fichier d'enregistrement du cache de Tiramisu" (cli.tiramisu_cache) a la valeur "null". + + * - **cli.root** + + `string `__ + + **Ligne de commande** : + + -cr, --cli.root + + **Variable d'environnement** : ROUGAILCLI_CLI.ROOT + - Utiliser la sortie uniquement pour les variables enfants de la famille. + + Par dĂ©faut, toutes les variables accessible sont inclus dans la sortie. Il est possible de dĂ©finir la famille a partir de laquelle la sortie devra ĂȘtre gĂ©nĂ©rĂ©e. + + * - **cli.read_write** + + `boolean `__ `obligatoire` + + **Ligne de commande** : + + + + - --cli.read_write + + - --cli.no-read_write + + + + **Variable d'environnement** : ROUGAILCLI_CLI.READ_WRITE + - La configuration dans l'Ă©tat de sortie est dans mode lecture-Ă©criture. + + **DĂ©faut** : false + + * - **cli.mandatory** + + `boolean `__ `obligatoire` + + **Ligne de commande** : + + + + - --cli.mandatory + + - --cli.no-mandatory + + + + **Variable d'environnement** : ROUGAILCLI_CLI.MANDATORY + - Test les valeurs obligatoires. + + Cette configuration doit ĂȘtre valide avant de lancer le processus de sortie. Il est prĂ©fĂ©rable de valider les valeurs au dĂ©but du processus. + + **DĂ©faut** : si "La configuration dans l'Ă©tat de sortie est dans mode lecture-Ă©criture" (cli.read_write) est false. + + * - **cli.description_type** + + `choice `__ `obligatoire` + + **Ligne de commande** : + + -cd, --cli.description_type + + **Variable d'environnement** : ROUGAILCLI_CLI.DESCRIPTION_TYPE + - Type de description des variables. + + Pour identifier les diffĂ©rentes variables, on utilise la description de la variable. Il y a quatre type de descriptions: + + - name_and_description : qui contient le nom de la variable suivi de sa description - path : le chemin de la variable - name : le nom de la variable - description : la description de la variable. + + + + **Choix** : + + + + - path_and_description + + - name_and_description + + - path + + - name + + - description **← (dĂ©faut)** + + * - **cli.inaccessible_read_only_modes** + + `string `__ `multiple` `*dĂ©sactivĂ©*` `unique` + + **Ligne de commande** : + + --cli.inaccessible_read_only_modes + + **Variable d'environnement** : ROUGAILCLI_CLI.INACCESSIBLE_READ_ONLY_MODES + - Modes quoi doivent ĂȘtre inaccessible en mode lecture seule. + + **Validateur** : un mode doit exister dans "Tous les niveaux de modes valides" (modes_level) + + **DĂ©sactivĂ©** : si aucun mode n'est dĂ©fini dans "Tous les niveaux de modes valides" (modes_level). + + * - **cli.inaccessible_read_write_modes** + + `string `__ `multiple` `*dĂ©sactivĂ©*` `unique` + + **Ligne de commande** : + + --cli.inaccessible_read_write_modes + + **Variable d'environnement** : ROUGAILCLI_CLI.INACCESSIBLE_READ_WRITE_MODES + - Modes quoi doivent ĂȘtre inaccessible en mode lecture-Ă©criture. + + **Validateur** : un mode doit exister dans "Tous les niveaux de modes valides" (modes_level) + + **DĂ©sactivĂ©** : si aucun mode n'est dĂ©fini dans "Tous les niveaux de modes valides" (modes_level). + + * - **cli.inaccessible_modes** + + `string `__ `multiple` `*dĂ©sactivĂ©*` `unique` + + **Ligne de commande** : + + -ci, --cli.inaccessible_modes + + **Variable d'environnement** : ROUGAILCLI_CLI.INACCESSIBLE_MODES + - Modes quoi doivent ĂȘtre inaccessible. + + **Validateur** : un mode doit exister dans "Tous les niveaux de modes valides" (modes_level) + + **DĂ©sactivĂ©** : si aucun mode n'est dĂ©fini dans "Tous les niveaux de modes valides" (modes_level). diff --git a/README.md b/README.md index 7a400e2..25ed9e8 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,334 @@ ---- -gitea: none -include_toc: true ---- -[🇬🇧 (EN)](README.md) - [đŸ‡«đŸ‡· (FR)](README.fr.md) +Command line options +==================== -## Command line options +.. note:: -> [!NOTE] -> -> It is possible to use Rougail directly from the command line. This makes it easy to define and configure the loaded user data and to define the desired output.\ -> **Path**: cli - -| Variable | Description | Default value | Type | Access control | Validator | -|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------| -| **cli.config_file**
**Environment variable**: CLI.CONFIG_FILE | Loads command line parameters from a file. | ‱ .rougailcli.yml | [`UNIX filename`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` | | ‱ this filename could be a relative path
‱ file type allowed: "directory" and "file". | -| **cli.debug**
**Command line**:
‱ --cli.debug
‱ --cli.no-debug
**Environment variable**: CLI.DEBUG | Displays debug informations. | false | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | | | -| **cli.warnings**
**Command line**:
‱ --cli.warnings
‱ --cli.no-warnings
**Environment variable**: CLI.WARNINGS | Displays command line option warnings informations. | true | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | | | -| **cli.versions**
**Command line**:
‱ --cli.versions
‱ --cli.no-versions
**Environment variable**: CLI.VERSIONS | Displays Rougail version and all its components. | false | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | | | -| **cli.invalid_user_data_error**
**Command line**:
‱ --cli.invalid_user_data_error
‱ --cli.no-invalid_user_data_error
**Environment variable**: CLI.INVALID_USER_DATA_ERROR | Invalid value in user data is not allowed. | false | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | | | -| **cli.unknown_user_data_error**
**Command line**:
‱ --cli.unknown_user_data_error
‱ --cli.no-unknown_user_data_error
**Environment variable**: CLI.UNKNOWN_USER_DATA_ERROR | Unknown variable in user data is not allowed. | false | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | | | -| **cli.layers**
**Command line**:
‱ -cl, --cli.layers
‱ -ncl, --cli.no-layers
**Environment variable**: CLI.LAYERS | Open each user data in separate layers. | false | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | *`hidden`*
**Hidden**: if only one user data is set in "[Select for user datas](#step.user_data)" | | -| **cli.load_from_tiramisu_cache**
**Command line**:
‱ --cli.load_from_tiramisu_cache
‱ --cli.no-load_from_tiramisu_cache
**Environment variable**: CLI.LOAD_FROM_TIRAMISU_CACHE | Use cache for load Tiramisu objects.
It will only be loaded from the cache if it already exists

Note that certain user data or output can change how structure files are loaded (this is particularly true for the doc output). It is best to use the cache only for the same type of user data and output. | false | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | *`disabled`*
**Disabled**: when the variable "[Store Tiramisu cache filename](#tiramisu_cache)" has the value "null" | | -| **cli.root**
**Command line**:
-cr, --cli.root
**Environment variable**: CLI.ROOT | Use output only for the children variables of the family.
By default, all accessible variables are included in output. It is possible to define the family from which the output should be generated. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) | | | -| **cli.read_write**
**Command line**:
‱ --cli.read_write
‱ --cli.no-read_write
**Environment variable**: CLI.READ_WRITE | Configuration in output step is in read_write mode. | false | [`boolean`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | | | -| **cli.description_type**
**Command line**:
-cd, --cli.description_type
**Environment variable**: CLI.DESCRIPTION_TYPE | Type of variables description.
To identify different variables, we use the variable description. There are four types of description:
- path_and_description: which contains the variable path followed by its description - name_and_description: which contains the variable name followed by its description - path: the variable's path - name: the variable name - description: the variable's description. | description | [`choice`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `mandatory` | | **Choices**:
‱ path_and_description
‱ name_and_description
‱ path
‱ name
‱ description | -| **cli.inaccessible_read_only_modes**
**Command line**:
--cli.inaccessible_read_only_modes
**Environment variable**: CLI.INACCESSIBLE_READ_ONLY_MODES | Modes that should not be accessible in read_only mode. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` | *`disabled`*
**Disabled**: if any mode is set in "[All modes level available](#modes_level)" | `unique`
Mode must exists in "[All modes level available](#modes_level)". | -| **cli.inaccessible_read_write_modes**
**Command line**:
--cli.inaccessible_read_write_modes
**Environment variable**: CLI.INACCESSIBLE_READ_WRITE_MODES | Modes that should not be accessible in read_write mode. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` | *`disabled`*
**Disabled**: if any mode is set in "[All modes level available](#modes_level)" | `unique`
Mode must exists in "[All modes level available](#modes_level)". | -| **cli.inaccessible_modes**
**Command line**:
-ci, --cli.inaccessible_modes
**Environment variable**: CLI.INACCESSIBLE_MODES | Modes that should not be accessible. | | [`string`](https://rougail.readthedocs.io/en/latest/variable.html#variables-types) `multiple` | *`disabled`*
**Disabled**: if any mode is set in "[All modes level available](#modes_level)" | `unique`
Mode must exists in "[All modes level available](#modes_level)". | + | It is possible to use Rougail directly from the command line. This makes it easy to define and configure the loaded user data and to define the desired output. + | **Path**: cli + +.. list-table:: + + * - Variable + - Description + + * - **cli.config_file** + + `UNIX filename `__ `multiple` `mandatory` `unique` + + **Environment variable**: ROUGAILCLI_CLI.CONFIG_FILE + - Loads command line parameters from a file. + + **Validators**: + + + + - this filename could be a relative path + + - 'file type allowed: "directory" and "file"' + + + + **Default**: + + + + - .rougailcli.yml + + * - **cli.debug** + + `boolean `__ `mandatory` + + **Command line**: + + + + - --cli.debug + + - --cli.no-debug + + + + **Environment variable**: ROUGAILCLI_CLI.DEBUG + - Displays debug informations. + + **Default**: false + + * - **cli.warnings** + + `boolean `__ `mandatory` + + **Command line**: + + + + - --cli.warnings + + - --cli.no-warnings + + + + **Environment variable**: ROUGAILCLI_CLI.WARNINGS + - Displays command line option warnings informations. + + **Default**: true + + * - **cli.versions** + + `boolean `__ `mandatory` + + **Command line**: + + + + - --cli.versions + + - --cli.no-versions + + + + **Environment variable**: ROUGAILCLI_CLI.VERSIONS + - Displays Rougail version and all its components. + + **Default**: false + + * - **cli.invalid_user_data_error** + + `boolean `__ `mandatory` + + **Command line**: + + + + - --cli.invalid_user_data_error + + - --cli.no-invalid_user_data_error + + + + **Environment variable**: ROUGAILCLI_CLI.INVALID_USER_DATA_ERROR + - Invalid value in user data is not allowed. + + **Default**: false + + * - **cli.unknown_user_data_error** + + `boolean `__ `mandatory` + + **Command line**: + + + + - --cli.unknown_user_data_error + + - --cli.no-unknown_user_data_error + + + + **Environment variable**: ROUGAILCLI_CLI.UNKNOWN_USER_DATA_ERROR + - Unknown variable in user data is not allowed. + + **Default**: false + + * - **cli.layers** + + `boolean `__ `mandatory` `*hidden*` + + **Command line**: + + + + - -cl, --cli.layers + + - -ncl, --cli.no-layers + + + + **Environment variable**: ROUGAILCLI_CLI.LAYERS + - Open each user data in separate layers. + + **Default**: false + + **Hidden**: if only one user data is set in "select for user data" (step.user_data). + + * - **cli.tiramisu_cache** + + `UNIX filename `__ + + **Command line**: + + -ct, --cli.tiramisu_cache + + **Environment variable**: ROUGAILCLI_CLI.TIRAMISU_CACHE + - Store Tiramisu cache filename. + + This file contains the Tiramisu instructions used internally to load the variables." + + + + This file can be used for load Tiramisu from cache instead of regenerates it". + + **Validators**: + + + + - this filename could be a relative path + + - 'file type allowed: "file"' + + * - **cli.load_from_tiramisu_cache** + + `boolean `__ `mandatory` `*disabled*` + + **Command line**: + + + + - --cli.load_from_tiramisu_cache + + - --cli.no-load_from_tiramisu_cache + + + + **Environment variable**: ROUGAILCLI_CLI.LOAD_FROM_TIRAMISU_CACHE + - Use cache for load Tiramisu objects. + + It will only be loaded from the cache if it already exists + + + + Note that certain user data or output can change how structure files are loaded (this is particularly true for the doc output). It is best to use the cache only for the same type of user data and output. + + **Default**: false + + **Disabled**: when the variable "Store Tiramisu cache filename" (cli.tiramisu_cache) has the value "null". + + * - **cli.root** + + `string `__ + + **Command line**: + + -cr, --cli.root + + **Environment variable**: ROUGAILCLI_CLI.ROOT + - Use output only for the children variables of the family. + + By default, all accessible variables are included in output. It is possible to define the family from which the output should be generated. + + * - **cli.read_write** + + `boolean `__ `mandatory` + + **Command line**: + + + + - --cli.read_write + + - --cli.no-read_write + + + + **Environment variable**: ROUGAILCLI_CLI.READ_WRITE + - Configuration in output step is in read_write mode. + + **Default**: false + + * - **cli.mandatory** + + `boolean `__ `mandatory` + + **Command line**: + + + + - --cli.mandatory + + - --cli.no-mandatory + + + + **Environment variable**: ROUGAILCLI_CLI.MANDATORY + - Test mandatories variables. + + The configuration must be valid before process output. It's better to validate the values at the beginning of the process. + + **Default**: if "Configuration in output step is in read_write mode" (cli.read_write) is false. + + * - **cli.description_type** + + `choice `__ `mandatory` + + **Command line**: + + -cd, --cli.description_type + + **Environment variable**: ROUGAILCLI_CLI.DESCRIPTION_TYPE + - Type of variables description. + + To identify different variables, we use the variable description. There are four types of description: + + - path_and_description: which contains the variable path followed by its description - name_and_description: which contains the variable name followed by its description - path: the variable's path - name: the variable name - description: the variable's description. + + + + **Choices**: + + + + - path_and_description + + - name_and_description + + - path + + - name + + - description **← (default)** + + * - **cli.inaccessible_read_only_modes** + + `string `__ `multiple` `*disabled*` `unique` + + **Command line**: + + --cli.inaccessible_read_only_modes + + **Environment variable**: ROUGAILCLI_CLI.INACCESSIBLE_READ_ONLY_MODES + - Modes that should not be accessible in read_only mode. + + **Validator**: mode must exists in "All modes level available" (modes_level) + + **Disabled**: if any mode is set in "All modes level available" (modes_level). + + * - **cli.inaccessible_read_write_modes** + + `string `__ `multiple` `*disabled*` `unique` + + **Command line**: + + --cli.inaccessible_read_write_modes + + **Environment variable**: ROUGAILCLI_CLI.INACCESSIBLE_READ_WRITE_MODES + - Modes that should not be accessible in read_write mode. + + **Validator**: mode must exists in "All modes level available" (modes_level) + + **Disabled**: if any mode is set in "All modes level available" (modes_level). + + * - **cli.inaccessible_modes** + + `string `__ `multiple` `*disabled*` `unique` + + **Command line**: + + -ci, --cli.inaccessible_modes + + **Environment variable**: ROUGAILCLI_CLI.INACCESSIBLE_MODES + - Modes that should not be accessible. + + **Validator**: mode must exists in "All modes level available" (modes_level) + + **Disabled**: if any mode is set in "All modes level available" (modes_level). diff --git a/locale/fr/LC_MESSAGES/rougail_cli.po b/locale/fr/LC_MESSAGES/rougail_cli.po index de2beca..666dff7 100644 --- a/locale/fr/LC_MESSAGES/rougail_cli.po +++ b/locale/fr/LC_MESSAGES/rougail_cli.po @@ -5,8 +5,8 @@ msgid "" msgstr "" "Project-Id-Version: \n" -"POT-Creation-Date: 2026-01-04 19:05+0100\n" -"PO-Revision-Date: 2026-01-04 19:07+0100\n" +"POT-Creation-Date: 2026-06-15 09:38+0200\n" +"PO-Revision-Date: 2026-06-15 09:41+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: fr\n" @@ -14,13 +14,17 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: pygettext.py 1.5\n" -"X-Generator: Poedit 3.8\n" +"X-Generator: Poedit 3.9\n" -#: src/rougail/cli/__main__.py:253 +#: src/rougail/cli/__main__.py:115 +msgid "unable to load {0}, {1}" +msgstr "impossible de charger {0}, {1}" + +#: src/rougail/cli/__main__.py:251 msgid "cannot find \"user_data\" module \"{0}\"" msgstr "ne peut trouve le module \"user_data\" \"{0}\"" -#: src/rougail/cli/__main__.py:261 +#: src/rougail/cli/__main__.py:267 msgid "" "interactive user data \"{0}\" is loader before uninteractive user data " "\"{1}\"" @@ -28,19 +32,19 @@ msgstr "" "les donnĂ©es utilisateur interactifs \"{0}\" sont chargĂ©es avant les donnĂ©es " "utilisateur non interactif \"{1}\"" -#: src/rougail/cli/__main__.py:297 +#: src/rougail/cli/__main__.py:345 msgid "cannot find cli file for \"output_name\" module \"{0}\"" msgstr "ne peut trouve le fichier cli pour le module \"output_name\" \"{0}\"" -#: src/rougail/cli/__main__.py:328 +#: src/rougail/cli/__main__.py:375 msgid "ERROR: {0}" msgstr "ERREUR : {0}" -#: src/rougail/cli/config.py:28 +#: src/rougail/cli/config.py:33 msgid "Command line options" msgstr "Options de la ligne de commande" -#: src/rougail/cli/config.py:29 +#: src/rougail/cli/config.py:34 msgid "" "It is possible to use Rougail directly from the command line. This makes it " "easy to define and configure the loaded user data and to define the desired " @@ -50,52 +54,71 @@ msgstr "" "possible de dĂ©finir et configurer facilement les donnĂ©es utilisateur " "chargĂ©es, ainsi que la dĂ©finition de la sortie souhaitĂ©." -#: src/rougail/cli/config.py:32 +#: src/rougail/cli/config.py:37 msgid "Loads command line parameters from a file" msgstr "Charger les paramĂštres de la ligne de commande depuis un fichier" -#: src/rougail/cli/config.py:40 +#: src/rougail/cli/config.py:45 msgid "Displays debug informations" msgstr "Afficher les informations de debug" -#: src/rougail/cli/config.py:42 +#: src/rougail/cli/config.py:47 msgid "Displays command line option warnings informations" msgstr "" "Afficher les avertissements de chargement des options de la ligne de commande" -#: src/rougail/cli/config.py:44 +#: src/rougail/cli/config.py:49 msgid "Displays Rougail version and all its components" msgstr "Afficher la version de Rougail et de tous ces composants" -#: src/rougail/cli/config.py:46 +#: src/rougail/cli/config.py:51 msgid "Invalid value in user data is not allowed" msgstr "" "Les valeurs invalides dans les donnĂ©es utilisateur ne sont pas autorisĂ©es" -#: src/rougail/cli/config.py:48 +#: src/rougail/cli/config.py:53 msgid "Unknown variable in user data is not allowed" msgstr "" "Les variables inconnues dans les donnĂ©es utilisateur ne sont pas autorisĂ©es" -#: src/rougail/cli/config.py:51 +#: src/rougail/cli/config.py:56 msgid "Open each user data in separate layers" msgstr "Charger chaque donnĂ©es utilisateurs dans des couches sĂ©parĂ©es" -#: src/rougail/cli/config.py:58 +#: src/rougail/cli/config.py:63 msgid "if only one user data is set in \"__.step.user_data\"" msgstr "" "si seulement un type de donnĂ©es utilisateur est renseignĂ© dans " "\"__.step.user_data\"" -#: src/rougail/cli/config.py:65 +#: src/rougail/cli/config.py:70 +msgid "Store Tiramisu cache filename" +msgstr "Nom du fichier d'enregistrement du cache de Tiramisu" + +#: src/rougail/cli/config.py:72 +msgid "" +"This file contains the Tiramisu instructions used internally to load the " +"variables." +msgstr "" +"Ce fichier contient les instructions Tiramisu utilisĂ© en interne pour " +"charger les variables." + +#: src/rougail/cli/config.py:74 +msgid "" +"This file can be used for load Tiramisu from cache instead of regenerates it" +msgstr "" +"Ce fichier peut est utilisĂ© pour charger Tiramisu depuis un cache au lieu de " +"le regĂ©nĂ©rer" + +#: src/rougail/cli/config.py:84 msgid "Use cache for load Tiramisu objects" msgstr "Utiliser le cache pour charger les objets Tiramisu" -#: src/rougail/cli/config.py:67 +#: src/rougail/cli/config.py:86 msgid "It will only be loaded from the cache if it already exists" msgstr "Il sera chargĂ© Ă  partir du cache uniquement si celui-ci existe dĂ©jĂ ." -#: src/rougail/cli/config.py:69 +#: src/rougail/cli/config.py:88 msgid "" "Note that certain user data or output can change how structure files are " "loaded (this is particularly true for the doc output). It is best to use the " @@ -106,11 +129,11 @@ msgstr "" "sortie doc). Il est prĂ©fĂ©rable de n'utiliser le cache pour le mĂȘme type de " "donnĂ©es utilisateur et sortie." -#: src/rougail/cli/config.py:76 +#: src/rougail/cli/config.py:95 msgid "Use output only for the children variables of the family" msgstr "Utiliser la sortie uniquement pour les variables enfants de la famille" -#: src/rougail/cli/config.py:77 +#: src/rougail/cli/config.py:96 msgid "" "By default, all accessible variables are included in output. It is possible " "to define the family from which the output should be generated." @@ -119,15 +142,31 @@ msgstr "" "est possible de dĂ©finir la famille a partir de laquelle la sortie devra ĂȘtre " "gĂ©nĂ©rĂ©e." -#: src/rougail/cli/config.py:81 +#: src/rougail/cli/config.py:100 msgid "Configuration in output step is in read_write mode" msgstr "La configuration dans l'Ă©tat de sortie est dans mode lecture-Ă©criture" -#: src/rougail/cli/config.py:84 +#: src/rougail/cli/config.py:103 +msgid "test mandatories variables" +msgstr "test les valeurs obligatoires" + +#: src/rougail/cli/config.py:105 +msgid "" +"The configuration must be valid before process output. It's better to " +"validate the values at the beginning of the process." +msgstr "" +"Cette configuration doit ĂȘtre valide avant de lancer le processus de sortie. " +"Il est prĂ©fĂ©rable de valider les valeurs au dĂ©but du processus." + +#: src/rougail/cli/config.py:110 +msgid "if \"cli.read_write\" is false" +msgstr "si \"cli.read_write\" est false" + +#: src/rougail/cli/config.py:113 msgid "Type of variables description" msgstr "Type de description des variables" -#: src/rougail/cli/config.py:87 +#: src/rougail/cli/config.py:116 msgid "" "To identify different variables, we use the variable description. There are " "four types of description:\n" @@ -149,25 +188,25 @@ msgstr "" " - name : le nom de la variable\n" " - description : la description de la variable" -#: src/rougail/cli/config.py:103 +#: src/rougail/cli/config.py:132 msgid "Modes that should not be accessible in read_only mode" msgstr "Modes quoi doivent ĂȘtre inaccessible en mode lecture seule" -#: src/rougail/cli/config.py:110 src/rougail/cli/config.py:127 -#: src/rougail/cli/config.py:145 +#: src/rougail/cli/config.py:139 src/rougail/cli/config.py:156 +#: src/rougail/cli/config.py:174 msgid "if any mode is set in \"modes_level\"" msgstr "si aucun mode n'est dĂ©fini dans \"modes_level\"" -#: src/rougail/cli/config.py:117 src/rougail/cli/config.py:134 -#: src/rougail/cli/config.py:152 +#: src/rougail/cli/config.py:146 src/rougail/cli/config.py:163 +#: src/rougail/cli/config.py:181 msgid "mode must exists in \"modes_level\"" msgstr "un mode doit exister dans \"modes_level\"" -#: src/rougail/cli/config.py:120 +#: src/rougail/cli/config.py:149 msgid "Modes that should not be accessible in read_write mode" msgstr "Modes quoi doivent ĂȘtre inaccessible en mode lecture-Ă©criture" -#: src/rougail/cli/config.py:137 +#: src/rougail/cli/config.py:166 msgid "Modes that should not be accessible" msgstr "Modes quoi doivent ĂȘtre inaccessible" diff --git a/locale/rougail_cli.pot b/locale/rougail_cli.pot index 669f3c9..1813451 100644 --- a/locale/rougail_cli.pot +++ b/locale/rougail_cli.pot @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2026-01-04 19:07+0100\n" +"POT-Creation-Date: 2026-06-15 09:42+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -15,91 +15,119 @@ msgstr "" "Generated-By: pygettext.py 1.5\n" -#: src/rougail/cli/__main__.py:253 +#: src/rougail/cli/__main__.py:115 +msgid "unable to load {0}, {1}" +msgstr "" + +#: src/rougail/cli/__main__.py:251 msgid "cannot find \"user_data\" module \"{0}\"" msgstr "" -#: src/rougail/cli/__main__.py:261 +#: src/rougail/cli/__main__.py:267 msgid "interactive user data \"{0}\" is loader before uninteractive user data \"{1}\"" msgstr "" -#: src/rougail/cli/__main__.py:297 +#: src/rougail/cli/__main__.py:345 msgid "cannot find cli file for \"output_name\" module \"{0}\"" msgstr "" -#: src/rougail/cli/__main__.py:328 +#: src/rougail/cli/__main__.py:375 msgid "ERROR: {0}" msgstr "" -#: src/rougail/cli/config.py:28 +#: src/rougail/cli/config.py:33 msgid "Command line options" msgstr "" -#: src/rougail/cli/config.py:29 +#: src/rougail/cli/config.py:34 msgid "It is possible to use Rougail directly from the command line. This makes it easy to define and configure the loaded user data and to define the desired output." msgstr "" -#: src/rougail/cli/config.py:32 +#: src/rougail/cli/config.py:37 msgid "Loads command line parameters from a file" msgstr "" -#: src/rougail/cli/config.py:40 +#: src/rougail/cli/config.py:45 msgid "Displays debug informations" msgstr "" -#: src/rougail/cli/config.py:42 +#: src/rougail/cli/config.py:47 msgid "Displays command line option warnings informations" msgstr "" -#: src/rougail/cli/config.py:44 +#: src/rougail/cli/config.py:49 msgid "Displays Rougail version and all its components" msgstr "" -#: src/rougail/cli/config.py:46 +#: src/rougail/cli/config.py:51 msgid "Invalid value in user data is not allowed" msgstr "" -#: src/rougail/cli/config.py:48 +#: src/rougail/cli/config.py:53 msgid "Unknown variable in user data is not allowed" msgstr "" -#: src/rougail/cli/config.py:51 +#: src/rougail/cli/config.py:56 msgid "Open each user data in separate layers" msgstr "" -#: src/rougail/cli/config.py:58 +#: src/rougail/cli/config.py:63 msgid "if only one user data is set in \"__.step.user_data\"" msgstr "" -#: src/rougail/cli/config.py:65 -msgid "Use cache for load Tiramisu objects" +#: src/rougail/cli/config.py:70 +msgid "Store Tiramisu cache filename" msgstr "" -#: src/rougail/cli/config.py:67 -msgid "It will only be loaded from the cache if it already exists" +#: src/rougail/cli/config.py:72 +msgid "This file contains the Tiramisu instructions used internally to load the variables." msgstr "" -#: src/rougail/cli/config.py:69 -msgid "Note that certain user data or output can change how structure files are loaded (this is particularly true for the doc output). It is best to use the cache only for the same type of user data and output." -msgstr "" - -#: src/rougail/cli/config.py:76 -msgid "Use output only for the children variables of the family" -msgstr "" - -#: src/rougail/cli/config.py:77 -msgid "By default, all accessible variables are included in output. It is possible to define the family from which the output should be generated." -msgstr "" - -#: src/rougail/cli/config.py:81 -msgid "Configuration in output step is in read_write mode" +#: src/rougail/cli/config.py:74 +msgid "This file can be used for load Tiramisu from cache instead of regenerates it" msgstr "" #: src/rougail/cli/config.py:84 +msgid "Use cache for load Tiramisu objects" +msgstr "" + +#: src/rougail/cli/config.py:86 +msgid "It will only be loaded from the cache if it already exists" +msgstr "" + +#: src/rougail/cli/config.py:88 +msgid "Note that certain user data or output can change how structure files are loaded (this is particularly true for the doc output). It is best to use the cache only for the same type of user data and output." +msgstr "" + +#: src/rougail/cli/config.py:95 +msgid "Use output only for the children variables of the family" +msgstr "" + +#: src/rougail/cli/config.py:96 +msgid "By default, all accessible variables are included in output. It is possible to define the family from which the output should be generated." +msgstr "" + +#: src/rougail/cli/config.py:100 +msgid "Configuration in output step is in read_write mode" +msgstr "" + +#: src/rougail/cli/config.py:103 +msgid "test mandatories variables" +msgstr "" + +#: src/rougail/cli/config.py:105 +msgid "The configuration must be valid before process output. It's better to validate the values at the beginning of the process." +msgstr "" + +#: src/rougail/cli/config.py:110 +msgid "if \"cli.read_write\" is false" +msgstr "" + +#: src/rougail/cli/config.py:113 msgid "Type of variables description" msgstr "" -#: src/rougail/cli/config.py:87 +#: src/rougail/cli/config.py:116 msgid "" "To identify different variables, we use the variable description. There are four types of description:\n" "\n" @@ -110,25 +138,25 @@ msgid "" " - description: the variable's description" msgstr "" -#: src/rougail/cli/config.py:103 +#: src/rougail/cli/config.py:132 msgid "Modes that should not be accessible in read_only mode" msgstr "" -#: src/rougail/cli/config.py:110 src/rougail/cli/config.py:127 -#: src/rougail/cli/config.py:145 +#: src/rougail/cli/config.py:139 src/rougail/cli/config.py:156 +#: src/rougail/cli/config.py:174 msgid "if any mode is set in \"modes_level\"" msgstr "" -#: src/rougail/cli/config.py:117 src/rougail/cli/config.py:134 -#: src/rougail/cli/config.py:152 +#: src/rougail/cli/config.py:146 src/rougail/cli/config.py:163 +#: src/rougail/cli/config.py:181 msgid "mode must exists in \"modes_level\"" msgstr "" -#: src/rougail/cli/config.py:120 +#: src/rougail/cli/config.py:149 msgid "Modes that should not be accessible in read_write mode" msgstr "" -#: src/rougail/cli/config.py:137 +#: src/rougail/cli/config.py:166 msgid "Modes that should not be accessible" msgstr "" diff --git a/src/rougail/cli/__main__.py b/src/rougail/cli/__main__.py index 3ac9ec5..e519940 100644 --- a/src/rougail/cli/__main__.py +++ b/src/rougail/cli/__main__.py @@ -53,7 +53,7 @@ def _main(arguments, do_not_print): rougailconfig = get_rougail_config( backward_compatibility=False, add_extra_options=False ) - cmd_config = load_cmd_user_data(rougailconfig, arguments) + cmd_config, parser = load_cmd_user_data(rougailconfig, arguments) print_traceback = rougailconfig["cli.debug"] if rougailconfig["cli.versions"]: versions = display_version(cmd_config) @@ -62,7 +62,7 @@ def _main(arguments, do_not_print): for version in versions: print(version) exit() - layer_datas, metaconfig, config, err_warn = load_user_data(rougailconfig) + layer_datas, metaconfig, config, err_warn = load_user_data(rougailconfig, parser) if config and (not rougailconfig["cli.load_config"] or not rougailconfig["cli.read_write"]): config.property.read_only() if config and rougailconfig["cli.mandatory"]: @@ -123,15 +123,25 @@ def load_cmd_user_data(rougailconfig, arguments): cmd_config, short_name_max_len=2, ) - parser.parse_args(arguments) + try: + is_commandline = "commandline" in cmd_config.unrestraint.option(f'step.user_data').value.get() + except: + is_commandline = False + if is_commandline: + parser.parse_known_args(arguments) + else: + parser.parse_args(arguments) + else: + parser = None if user_data["errors"]: raise Exception(user_data["errors"][0]) - + else: + parser = None cmd_config.property.setdefault(origin_prop, "read_write", "append") cmd_config.property.read_only() cmd_config.property.remove("not_for_commandline") - return cmd_config + return cmd_config, parser def display_version(cmd_config): @@ -177,7 +187,7 @@ def manage_warnings(warnings): filterwarnings("default", category=RougailWarning) -def load_user_data(rougailconfig): +def load_user_data(rougailconfig, cmdline_parser): layer_datas = [] if not rougailconfig["cli.load_config"]: return None, None, None, {"errors": [], "warnings": []} @@ -253,10 +263,10 @@ def load_user_data(rougailconfig): if not idx: has_interactive_user_data = hasattr(rougail_user_data, 'interactive_user_data') and rougail_user_data.interactive_user_data if has_interactive_user_data: + if rougail_user_datas: + raise Exception(_('interactive user data "{0}" is loader before uninteractive user data "{1}"').format(list(interactive_user_datas), user_data_name)) interactive_user_datas[user_data_name] = rougail_user_data else: - if interactive_user_datas: - raise Exception(_('interactive user data "{0}" is loader before uninteractive user data "{1}"').format(list(interactive_user_datas), user_data_name)) rougail_user_datas[user_data_name] = rougail_user_data root_metaconfig = metaconfig err_warn = {"errors": [], "warnings": []} @@ -265,12 +275,20 @@ def load_user_data(rougailconfig): user_datas = [] for idx, user_data_name in enumerate(reversed(rougail_user_datas)): rougail_user_data = rougail_user_datas[user_data_name] - if has_layers and idx: - metaconfig = metaconfig.config(user_data_name) + if has_layers: + if idx: + metaconfig = metaconfig.config(user_data_name) metaconfig.owner.set(metaconfig.path()) + if user_data_name == 'commandline': + extras = {"parents": [cmdline_parser], + "add_help": False, + } + else: + extras = {} for ud_idx, user_data in enumerate(rougail_user_data( subconfig, rougailconfig=rougailconfig, + **extras, ).run()): if has_layers and ud_idx: metaconfig = metaconfig.config(user_data_name) @@ -291,8 +309,9 @@ def load_user_data(rougailconfig): user_datas = [] for idx, user_data_name in enumerate(reversed(interactive_user_datas)): rougail_user_data = interactive_user_datas[user_data_name] - if has_layers and idx: - metaconfig = metaconfig.config(user_data_name) + if has_layers: + if idx: + metaconfig = metaconfig.config(user_data_name) metaconfig.owner.set(metaconfig.path()) for ud_idx, user_data in enumerate(rougail_user_data( subconfig, diff --git a/src/rougail/cli/locale/fr/LC_MESSAGES/rougail_cli.mo b/src/rougail/cli/locale/fr/LC_MESSAGES/rougail_cli.mo index 715dc53f300dcf64e6af466f93e5bd51eac4ffce..e08bccbd3143a38027f75d5ea364b04b90e0d430 100644 GIT binary patch delta 1707 zcmZXSO^6&t6vy9AHk;kmHOXkA*{r7AXa+Tz{V)mnP>ckO(I~>Mmk^Pj>6+Psp6;Q$ zdPT!Bc<|!4EUO0(IVns|hQ*5qgA7Da5JW+8(1Yk*)Po3uzp9>{tfrvnS2b1j-v7OS z{aN{art?#Icug4l`KI^|4~fjcb0vNlqgzDYfMf6uxCZCpW$4cR*k4Z!i|l263Xa1I z@B!F_m*9Kw1f1Ji{2#&nA{}|3$q_a_gGb?S@M~BZ5jg<=fOo^mZ6dG0WAGeYhYL_f zMczU5B6R0|8521OOQ;}$%)n!C0p17Sgb%|jaEko$D-(CHbW5>u06xX~JiHfv1SjE_ z@J{$M{0IIGKZbwZDzXn=nh-eyuR@n_+ifDxz*BG~+QD$|kiz|NZFH4j@lAtgOp-;tA>em9JI77vZyC2`Gj!oQDNyGosk5whN$-ELo#V%!@=}?hRMM)6eklaXu?;xrlP#XyDBN95^SY}sD>9iF`Ed|MFS{Ci&O(1`f?A}r>iVlAYo$HY^~h9H zvcC9IYOJ1CPIVAvdbK=uZJzX2wSqVd=(9n~a?rmndF;XrVqctHIjAnqt*rhqR-HI{ zXzqxbJ$~Zw+(WbTtL5=8hK{d)KYo5|=UHkEbJ|j0GBh`==$J|k+I36E*6kG*hBr)= z)6R+i`4}d~s@`Sp74~QqEC()tR#6bwiH)|t7kTFX&XUx2jK~(9o7dD7iMbV&ywr1DG%dLq_*6XTvlBcS^6r@d}4PIub+qvoB zP28`L*pbmBK(Tgy_qs81bh`|^B$ujluB;Q4)@@9+5)DTZ=;e&?cy zmgD@3m&jck1M%E0&EX3?gC*=mze9@PD4O#up2K%ogP*Vqzv2r1#$jA?TI=8Of|S!g zZu)s}-X#s-9sG>*cp2|iaZfQb*vj1RmabwHd4cX@0$<}re2;y&fBZb)vF3w#ll5oV ziR)Nme{FM9U}1~0+wqlGx`A)deDMKJV4II3F@s#1XSjvSxQT~2jvKYo2&&HNWD2h_ zeTvs{72SN$4@|PZe%4F3S?D=sRW^It+OU9TYl}FBA-~j(Q<%gh?7IMratjVoQQIb40KA=P>vv@d46{~ul5Ve^fR0)0qRg;{an#m^eEO`=U zhp4Ok&(J_MkTlwg)O5$A$4?$+GcS#RquObt-3#`-%lk3^#~ZGVg`@F~*wAov@Jck6 XkNZB@62_75uFLoqShE{%8-uq0fy7J` diff --git a/src/rougail/cli/rougailconfig.py b/src/rougail/cli/rougailconfig.py index 3d0e07f..a527e48 100644 --- a/src/rougail/cli/rougailconfig.py +++ b/src/rougail/cli/rougailconfig.py @@ -80,4 +80,5 @@ def from_cmdline(cmd_config, arguments, add_help): short_name_max_len=2, arguments=arguments, add_help=add_help, + allow_unknown=True, ).run() diff --git a/tests/rougailcli_file/warnings.txt b/tests/rougailcli_file/warnings.txt index a03528c..dc4f33b 100644 --- a/tests/rougailcli_file/warnings.txt +++ b/tests/rougailcli_file/warnings.txt @@ -1 +1 @@ -["unable to load \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), family \"bitwarden\" (Secrets are in Bitwarden) has property disabled, so cannot access to \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), it will be ignored when loading from the YAML file \"warnings.yml\""] \ No newline at end of file +["unable to load \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), family \"bitwarden\" (Load user data secrets from Bitwarden) has property disabled, so cannot access to \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), it will be ignored when loading from the YAML file \"warnings.yml\""] \ No newline at end of file diff --git a/tests/rougailcli_file/warnings3.txt b/tests/rougailcli_file/warnings3.txt index 2d71bb2..0e9bbfe 100644 --- a/tests/rougailcli_file/warnings3.txt +++ b/tests/rougailcli_file/warnings3.txt @@ -1 +1 @@ -["unable to load \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), family \"bitwarden\" (Secrets are in Bitwarden) has property disabled, so cannot access to \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), it will be ignored when loading from the YAML file \"warnings3.yml\""] \ No newline at end of file +["unable to load \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), family \"bitwarden\" (Load user data secrets from Bitwarden) has property disabled, so cannot access to \"bitwarden.mock_enable\" (Simulate password generation instead of retrieve them), it will be ignored when loading from the YAML file \"warnings3.yml\""] \ No newline at end of file