On Tue, 20 Feb 2024 03:58:40 +0000
Chengwen Feng <fengcheng...@huawei.com> wrote:

> The cfgfile supports duplicate section name and entry name when parsing
> config file, which may confused and hard to debug when accidentally set
> duplicate name.
> 
> So add unique name flag, it will treat as error if encounter duplicate
> section name or entry name.
> 
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Chengwen Feng <fengcheng...@huawei.com>

https://en.wikipedia.org/wiki/INI_file

        Interpretation of multiple section declarations with the same name also 
varies. 
        In some implementations, duplicate sections simply merge their 
properties, as if
        they occurred contiguously. Others may abort, or ignore some aspect of 
the INI file.

The standard reference for INI file parsing on Linux is the Python configparser
https://docs.python.org/3/library/configparser.html

        strict, default value: True

        When set to True, the parser will not allow for any section or option 
duplicates while reading from a single source     (using read_file(), 
read_string() or read_dict()). It is recommended to use strict parsers in new 
applications.

The problem I see is that cfgfile allows duplicates on names, and sections.
Perhaps there should be a new strict flag for this.

Reply via email to