On 08/08/2024 06:02, Stefano Brivio wrote:Given that pasta supports specifying a command to be executed on the command line, even without the usual -- separator as long as there's no ambiguity, we shouldn't eat up options that are not meant for us. Paul reports, for instance, that with: pasta --config-net ip -6 route -6 is taken by pasta to mean --ipv6-only, and we execute 'ip route'. That's because getopt_long(), by default, shuffles the argument list to shift non-option arguments at the end. Avoid that by adding '+' at the beginning of 'optstring'. Reported-by: Paul Holzinger <pholzing(a)redhat.com> Signed-off-by: Stefano Brivio <sbrivio(a)redhat.com> --- v3: Use '+' in optstring and drop first non-option tracking v2: Instead of overriding 'name' in the getopt_long() loop, to force exiting the loop, adjust the exit condition conf.c | 4 ++-- util.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)I like this change but I like to point out that this is a breaking change for any user that sets options after the main argument, i.e. pid. I can tell you that this will not effect podman but I don't know what other users exists out there... I am not sure if it is worth the risk just to improve the UX for the command use case but I guess you already decided it is otherwise you would have not posted this patch. -- Paul Holzinger