rust-cli / rust-cli/config-rs

Are defaults for an array of tables supported?

Open
#94 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Is it possible to set defaults for an array of tables, so that omitted values are automatically populated? I've checked through the examples and documentation and I can't find a clear answer.

Example:

[MyTableDefaults]
item1 = false
item2 = false
item3 = false
item4 = false
item5 = false

[[MyTable]]
item1 = true
item2 = true

[[MyTable]]
item3 = true
item4 = true

After merging the effective configuration would be:

[[MyTable]]
item1 = true
item2 = true
item3 = false
item4 = false
item5 = false

[[MyTable]]
item1 = false
item2 = false
item3 = true
item4 = true
item5 = false

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

No files, tests, or entry points are named in the issue. Start by locating the configuration merge logic for array-of-table values and determine how defaults are represented; done means the example produces the shown merged configuration, with tests covering omitted values.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.