rust-cli / rust-cli/config-rs

The keys that insert by with_list_parse_key() function should to_lowercase

Open
#428 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-env
Dominant language
Rust
Stars
3.2k
Forks
265
Avg merge
2h 42m
Merged PRs (30d)
4

Description

I'm trying to prase the key in the environment like

prefix_keylist : value1_value2
prefix_key: value

I define the source like

            config::Environment::with_prefix("PREFIX")
                .with_list_parse_key("KEYLIST")
                .separator("_")
                .list_separator("_")
                .try_parsing(true),

When try_parsing the key value, I find I can't get the correct result, so I try to debug and then find the list_parse_key not covert to lowercase as in the below image.
image

Maybe we should convert the list parse key to lowercase when insert the keys

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing with_list_parse_key() through the environment key insertion and try-parsing path, using the configuration shown in the issue as the reproducer. Check where list_parse_key is normalized and verify that the prefix_keylist and prefix_key example produces the expected parsed values after the change.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.