public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* Option parsing: Allow the same option multiple times
@ 2023-06-15 12:57 Paul Holzinger
  2023-06-16 21:04 ` Stefano Brivio
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Holzinger @ 2023-06-15 12:57 UTC (permalink / raw)
  To: passt-dev; +Cc: Stefano Brivio

Hi all,

following up on a quick discussion with Stefano on IRC.

passt/pasta currently rejects most (not all) options when specified 
multiple times, i.e. pasta -I eth0 -I eth1 ... fails. I think it makes 
more sense to just use the last one instead.

My use case: In podman I added a new containers.conf option[1] which 
allows users to set default pasta cli options. However users can also 
add options on the podman cli with podman run --net=pasta:... For me it 
would make the most sense to just append those to the config options and 
then let pasta deal with it. This allows some form of overwrite 
mechanism, i.e. by default I may have "-I" , "eth0" in containers.conf 
but for one specific container I want to use a different interface name 
and set --net=pasta:-I,eth1 on the cli. Then podman should just hand "-I 
eth0 -I eth1" to pasta and then pasta picks the last one.

If we keep the current behavior it means I am forced to parse the 
options in podman and dedup them which is hard to maintain as podman 
would need to keep up with pasta upstream.

I am willing to send a patch to change this so please let me know if 
anyone would object to that.


[1] 
https://github.com/containers/common/commit/da3ac5d6d025f2933e655a0541eddbcf26070583

Thanks, Paul


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-06-20 15:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-15 12:57 Option parsing: Allow the same option multiple times Paul Holzinger
2023-06-16 21:04 ` Stefano Brivio
2023-06-19  4:49   ` David Gibson
2023-06-19  6:18     ` Stefano Brivio
2023-06-20 14:50       ` Paul Holzinger
2023-06-20 15:09         ` Stefano Brivio

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).