From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 54D625A026D for ; Thu, 15 Jun 2023 14:57:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686833863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hpPrdpjlSgtoXYW1tDdWmikYMSHyhngTC5W9qCLWZ7E=; b=MEWFzYKxH11jjtSNOBLSMAMH4C1/eNH3pO2F9IIeUyRpG7joCzcLjBf8zDWNaBHZ9EAhgv C85W1wu9ETs4zKu/Ba6ydXhDawPrx5UBCUUAS1XdVQ4u8YDXSMfO9kZeV/cA27jIawUlrw L7sFdGBjBx2WZeC2eyhgfKp+5pI+4Jc= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-203-mCBdhZaWPKmrzySxdw4bQQ-1; Thu, 15 Jun 2023 08:57:42 -0400 X-MC-Unique: mCBdhZaWPKmrzySxdw4bQQ-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-62ff96335b0so166236d6.0 for ; Thu, 15 Jun 2023 05:57:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686833861; x=1689425861; h=content-transfer-encoding:subject:cc:to:from:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=hpPrdpjlSgtoXYW1tDdWmikYMSHyhngTC5W9qCLWZ7E=; b=V60K6LdJ1IOTMFw/2C4wSkSJnWTQ5FverpGQtst4/J3q1Nme6PyxBoYIZNkqJVGFq5 IHC4sb9Ni1BuhVQkpxCpYUhRRpjRZYWmcQBeTY/Y6fmQ9SJ/QNgqE+HCHxy0mr85MN55 GNjPWMjYkadCBEJaqVhoDCjPL5q3iLUWhgXY2g1cAUeXlDj+qNpAGQr1tuOLQo9dFszt eGHFPJ1GfDhB4N2iS0rrmNY2cJGcLlApV6kjRfL0Azsn5kN8dD4EI22nNTt+6w6OGC4a qhhS0p/tKMUviXNSZT1PKJy4G97ccTzZM42lfWVc7TvSmz3I0fz7+pSqn+pB5JLG5NFa lP4Q== X-Gm-Message-State: AC+VfDzo0tCA6oJjq3GtLWcBQvlf8fGNyilrU8x/9sHM2qZJADORzvvA l8kvF/xD+t6ZeMFcm6Ogq45ocrkqER7jb3XRSnbt864Cb3khxHmpmRK3eALqHDwAF2ww+nmSe4Z xxkStkiFUSiNjGqN0K2//xq2I2PCjLs4hSq8CiNXNsEKRXTDl7BIDS10vHy2SpHrxXdEyNXkP X-Received: by 2002:a05:6214:29ce:b0:616:4b40:5ea9 with SMTP id gh14-20020a05621429ce00b006164b405ea9mr17853780qvb.40.1686833861373; Thu, 15 Jun 2023 05:57:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6buasB8pWM8fWHJCi2OMP0NuUSDHn0Jg8/Oi1DvIT+LOG91+o3gQNM2OcC8rcsjp9ETefg+w== X-Received: by 2002:a05:6214:29ce:b0:616:4b40:5ea9 with SMTP id gh14-20020a05621429ce00b006164b405ea9mr17853759qvb.40.1686833860942; Thu, 15 Jun 2023 05:57:40 -0700 (PDT) Received: from [192.168.188.25] ([80.243.52.136]) by smtp.gmail.com with ESMTPSA id o20-20020a0cf4d4000000b0061b63237be3sm5817120qvm.131.2023.06.15.05.57.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Jun 2023 05:57:40 -0700 (PDT) Message-ID: <895dae7d-3e61-4ef7-829a-87966ab0bb3a@redhat.com> Date: Thu, 15 Jun 2023 14:57:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.1 From: Paul Holzinger To: passt-dev@passt.top Subject: Option parsing: Allow the same option multiple times X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID-Hash: 7QDFLY3IVTIVLE5L6G2D7ZMRSI5GQ644 X-Message-ID-Hash: 7QDFLY3IVTIVLE5L6G2D7ZMRSI5GQ644 X-MailFrom: pholzing@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Stefano Brivio X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: 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