On Tue, May 20, 2025 at 05:40:20PM +0100, Bruce Richardson wrote:
> The argparse library was missing two key features which made it
> unsuitable for use by EAL or any program wanting similar behaviour.
> 
> 1. It didn't stop parsing arguments when it hit a "--" character
> 2. It never returned the number of arguments parsed
> 
> Fix both these issues - the latter is a change to the ABI, since we now
> return >= 0 rather than == 0 on success. However, the ABI is still
> experimental so we can make exactly these sorts of tweaks to it.
> 
> Signed-off-by: Bruce Richardson <bruce.richard...@intel.com>
> ---

Thinking about it further, for EAL we can actually do without these changes
to the argparse library*. However, this is also functionality that may be
useful in other cases, so looking for feedback on whether to continue with
this patch, or drop it?

Question:
* should argparse library stop processing args at "--"?
* should argparse library return number of args parsed, or zero on success?

/Bruce

*The reason we don't need these is because we clone the argv data on
eal_init so we can return it via telemetry library. This splits the args
into eal and non-eal args, so we can use just the "eal" arg array to pass to
arg-parse, if we don't include this patch.

Reply via email to