some option order don't work in the rougail-cli usage #41

Open
opened 2025-09-03 17:17:54 +02:00 by gremond · 0 comments
Member

The following command line options don't work with the rougail versions I'm using:

  --console.key_is_description
                        In tree the key is the family or variable description inside of it's name (default: True)
  --console.no-key_is_description

Here are the rougail versions I'm using:

rougail --cli.versions 
tiramisu: 5.2.0a9
tiramisu-cmdline-parser: 0.7.0a1
rougail: 1.2.0a29
rougail-cli: 0.2.0a18
rougail-user-data-environment: 0.1.0a9
rougail-user-data-yaml: 0.2.0a11
rougail-output-console: 0.2.0a11
rougail-output-json: 0.2.0a8

Here is the rougail CLI usage that works:

env ROUGAIL_MANUAL.USE_FOR_HTTPS=true rougail --console.no-read_write -m structfile/proxy.yml -u yaml --yaml.filename userdata/proxy.yml -o json --json.get manual.https_proxy
{
  "address": "toto.fr",
  "port": "8888"
}

Now if I use this command line option order (that is, my console RW option at the end of the line):

env ROUGAIL_MANUAL.USE_FOR_HTTPS=true rougail -m structfile/proxy.yml -u yaml --yaml.filename userdata/proxy.yml -o json --json.get manual.https_proxy --console.read_write
usage: rougail --step.user_data "yaml" --step.output "json" --yaml.filename "userdata/proxy.yml" --json.get "manual.https_proxy" -m "structfile/proxy.yml"
       [-h] --secret_manager.pattern [PATTERN] [-u [{yaml,environment} ...]] -o [{console,json}] --cli.debug --cli.no-debug --cli.warnings --cli.no-warnings --cli.versions
       --cli.no-versions [-xn [NAMES ...]] [--extra_dictionaries.pop-names INDEX] -ff FILENAME [FILENAME ...] --yaml.file_with_secrets [{all,first,last,none}] --json.read_write
       --json.no-read_write --json.mandatory --json.no-mandatory [--json.get GET] [-v {1.0,1.1}] [-c [FUNCTIONS_FILES ...]] [--modes_level [MODES_LEVEL ...]] [-t TIRAMISU_CACHE]
       --force_optional --no-force_optional --define_default_params --no-define_default_params -m MAIN_DICTIONARIES [MAIN_DICTIONARIES ...] --sort_dictionaries_all
       --no-sort_dictionaries_all [-s MAIN_NAMESPACE]
rougail: error: unrecognized arguments: --console.no-read_write

Besides, this command line option order doesn't work either

env ROUGAIL_MANUAL.USE_FOR_HTTPS=true rougail -m structfile/proxy.yml -u yaml --yaml.filename userdata/proxy.yml -o json --json.get manual.https_proxy --console.no-read_write

  File "/usr/lib/python3.12/argparse.py", line 1016, in __call__
    setattr(namespace, self.dest, self.const)
  File "/home/ubuntu/workplace/structmem/.venv/lib/python3.12/site-packages/tiramisu_cmdline_parser/api.py", line 154, in __setattr__
    _setattr(option, true_key, key, value)
  File "/home/ubuntu/workplace/structmem/.venv/lib/python3.12/site-packages/tiramisu_cmdline_parser/api.py", line 184, in _setattr
    "unrecognized arguments: {}".format(self.arguments[key])
                                        ~~~~~~~~~~~~~~^^^^^
KeyError: 'console.no-read_write'
ERROR: 'console.no-read_write'

Wheras this order is working:

env ROUGAIL_MANUAL.USE_FOR_HTTPS=true rougail --console.no-read_write -m structfile/proxy.yml -u yaml --yaml.filename userdata/proxy.yml -o json --json.get manual.https_proxy
{
  "address": "toto.fr",
  "port": "8888"
}
The following command line options don't work with the rougail versions I'm using: ``` --console.key_is_description In tree the key is the family or variable description inside of it's name (default: True) --console.no-key_is_description ``` Here are the rougail versions I'm using: ``` rougail --cli.versions tiramisu: 5.2.0a9 tiramisu-cmdline-parser: 0.7.0a1 rougail: 1.2.0a29 rougail-cli: 0.2.0a18 rougail-user-data-environment: 0.1.0a9 rougail-user-data-yaml: 0.2.0a11 rougail-output-console: 0.2.0a11 rougail-output-json: 0.2.0a8 ``` Here is the rougail CLI usage that works: ``` env ROUGAIL_MANUAL.USE_FOR_HTTPS=true rougail --console.no-read_write -m structfile/proxy.yml -u yaml --yaml.filename userdata/proxy.yml -o json --json.get manual.https_proxy { "address": "toto.fr", "port": "8888" } ``` Now if I use this command line option order (that is, my console RW option at the end of the line): ``` env ROUGAIL_MANUAL.USE_FOR_HTTPS=true rougail -m structfile/proxy.yml -u yaml --yaml.filename userdata/proxy.yml -o json --json.get manual.https_proxy --console.read_write usage: rougail --step.user_data "yaml" --step.output "json" --yaml.filename "userdata/proxy.yml" --json.get "manual.https_proxy" -m "structfile/proxy.yml" [-h] --secret_manager.pattern [PATTERN] [-u [{yaml,environment} ...]] -o [{console,json}] --cli.debug --cli.no-debug --cli.warnings --cli.no-warnings --cli.versions --cli.no-versions [-xn [NAMES ...]] [--extra_dictionaries.pop-names INDEX] -ff FILENAME [FILENAME ...] --yaml.file_with_secrets [{all,first,last,none}] --json.read_write --json.no-read_write --json.mandatory --json.no-mandatory [--json.get GET] [-v {1.0,1.1}] [-c [FUNCTIONS_FILES ...]] [--modes_level [MODES_LEVEL ...]] [-t TIRAMISU_CACHE] --force_optional --no-force_optional --define_default_params --no-define_default_params -m MAIN_DICTIONARIES [MAIN_DICTIONARIES ...] --sort_dictionaries_all --no-sort_dictionaries_all [-s MAIN_NAMESPACE] rougail: error: unrecognized arguments: --console.no-read_write ``` Besides, this command line option order doesn't work either ``` env ROUGAIL_MANUAL.USE_FOR_HTTPS=true rougail -m structfile/proxy.yml -u yaml --yaml.filename userdata/proxy.yml -o json --json.get manual.https_proxy --console.no-read_write File "/usr/lib/python3.12/argparse.py", line 1016, in __call__ setattr(namespace, self.dest, self.const) File "/home/ubuntu/workplace/structmem/.venv/lib/python3.12/site-packages/tiramisu_cmdline_parser/api.py", line 154, in __setattr__ _setattr(option, true_key, key, value) File "/home/ubuntu/workplace/structmem/.venv/lib/python3.12/site-packages/tiramisu_cmdline_parser/api.py", line 184, in _setattr "unrecognized arguments: {}".format(self.arguments[key]) ~~~~~~~~~~~~~~^^^^^ KeyError: 'console.no-read_write' ERROR: 'console.no-read_write' ``` Wheras this order is working: ``` env ROUGAIL_MANUAL.USE_FOR_HTTPS=true rougail --console.no-read_write -m structfile/proxy.yml -u yaml --yaml.filename userdata/proxy.yml -o json --json.get manual.https_proxy { "address": "toto.fr", "port": "8888" } ```
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: stove/rougail#41
No description provided.