Hi Stephen,

On 2024/1/24 23:54, Stephen Hemminger wrote:
> On Tue, 21 Nov 2023 12:26:51 +0000
> Chengwen Feng <fengcheng...@huawei.com> wrote:
> 
>> Introduce argparse library (which was inspired by the thread [1]),
>> compared with getopt, the argparse has following advantages:
>> 1) Set the help information when defining parameters.
>> 2) Support positional parameters.
>>
>> The parameters parsing according following:
>> 1) positional: use callback to parse (passed the long-name as the key
>>    for callback).
>> 2) optional:
>>    In addition to callback to parse, but also support:
>> 2.1) no-val: support set default value to saver.
>> 2.2) has-val: support set value to saver, the value must be conform
>>               RTE_ARGPARSE_ARG_VAL_xxx.
>> 2.3) opt-val: if current without value then treat as no-val, else could
>>               treat as has-val.
> 
> How compatiable is this with Python or other implementations of argparse
> in C?

This library is a subset of Python argparse, and it don't support some advanced
features, such as: subcommand, exclusive group. We could extend it to support
if needed.

As for other implementation of argparse in C, I found a interesting site [1],
this library supports all features except the compact/order/wchar.

[1] 
https://attractivechaos.wordpress.com/2018/08/31/a-survey-of-argument-parsing-libraries-in-c-c/

Thanks

> 
> .
> 

Reply via email to