Skip to content

Wrong interpretation of nested dots in --set-env #444

Description

@tomschr

Project Version

0.22.0

Python Version

3.12, 3.13, 3.14

Operating System

Generic

Steps to Reproduce

When you have dots in the TOML key names (for example, with the XSLT parameters in xslt.html), you can't set them.

Actual Behavior

The normal way creates a wrong output:

$ docbuild --set-env "xslt.html.show.edit.link=1" config list --env | sed '1,2d' | jq .xslt.html
{
  "show": {
    "edit": {
      "link": "1"
    }
}

Single quotes don't work:

$ docbuild --set-env "xslt.html.'show.edit.link'=1" config list --env | sed '1,2d' | jq .xslt.html
{
  "'show": {
    "edit": {
      "link'": "1"
    }
  }
}

Expected Behavior

The --set-env should handle quoted strings as one string and not separate:

$ docbuild --set-env "xslt.html.'show.edit.link'=1" config list --env | sed '1,2d' | jq .xslt.html
{
  "show.edit.link": "1"
}

Perhaps we should even go a little further and assume that the value of the key (here 1) is an actual integer, not a string. The output should be like this:

{
  "show.edit.link": 1
}

If we want a string, we need to quote that:

$ docbuild --set-env "xslt.html.'show.edit.link'='1'" config list --env | sed '1,2d' | jq 

or like this:

$ docbuild --set-env 'xslt.html."show.edit.link"="1"' config list --env | sed '1,2d' | jq 

Not sure if there is an easier way to do it.

Additional Information

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:configAnything related to Portal schema, configs, models etc.area:usabilityImprovements on user friendliness and overall usability.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions