[{"id":611,"web_url":"https://patchwork.libcamera.org/comment/611/","msgid":"<20190125214935.GA4385@pendragon.ideasonboard.com>","date":"2019-01-25T21:49:35","subject":"Re: [libcamera-devel] [PATCH v2] cam: options: optional arguments\n\tneeds to be specified as --foo=bar","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Niklas,\n\nThank you for the patch.\n\nOn Fri, Jan 25, 2019 at 06:42:54PM +0100, Niklas Söderlund wrote:\n> It's not state in the documentation but optional arguments needs to be\n\ns/state/stated/\ns/documentation/getopt_long documentation/\ns/needs/need/\n\n> specified using as '--foo=bar' instead of '--foo bar', otherwise the\n\ns/using as/as/\n\n> value is not propagated to optarg during argument parsing. Update the\n> usage printing helper to reflect this requirement.\n> \n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/cam/options.cpp | 5 +++--\n>  1 file changed, 3 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/cam/options.cpp b/src/cam/options.cpp\n> index 82acff9bbeea476d..55c42540f92478e6 100644\n> --- a/src/cam/options.cpp\n> +++ b/src/cam/options.cpp\n> @@ -143,9 +143,10 @@ void OptionsParser::usage()\n>  \t\t};\n>  \n>  \t\tif (option.argument != ArgumentNone) {\n> -\t\t\targument += std::string(\" \");\n>  \t\t\tif (option.argument == ArgumentOptional)\n> -\t\t\t\targument += \"[\";\n> +\t\t\t\targument += \"[=\";\n> +\t\t\telse\n> +\t\t\t\targument += \" \";\n>  \t\t\targument += option.argumentName;\n>  \t\t\tif (option.argument == ArgumentOptional)\n>  \t\t\t\targument += \"]\";","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 791C460C65\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Jan 2019 22:49:37 +0100 (CET)","from pendragon.ideasonboard.com (unknown\n\t[IPv6:2a02:a03f:3c6a:b300:cba4:9bfe:2eae:a6b4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 01EFE325;\n\tFri, 25 Jan 2019 22:49:35 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1548452976;\n\tbh=Sl2Gxnc078Gx6anPgQvk932RllphyTfJuE/iwEu003Q=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=HkyBGFNGO1roYNUXuZ6kQcEyWzNowGjLsYSbCe0rcO4wZ8CqfxrSwkpMx6zyhGfC4\n\tTHX/8mfNit+ulD/xNv13FT6yLY9bqNepMq2Q1D1un++dhO/00RqRbhbMv7G6qJhoD7\n\tUogPtf1FUXYHMsrZTDrrLrDP0gF7V9pUc+ickDg4=","Date":"Fri, 25 Jan 2019 23:49:35 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190125214935.GA4385@pendragon.ideasonboard.com>","References":"<20190125174254.11890-1-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190125174254.11890-1-niklas.soderlund@ragnatech.se>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v2] cam: options: optional arguments\n\tneeds to be specified as --foo=bar","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Fri, 25 Jan 2019 21:49:37 -0000"}},{"id":616,"web_url":"https://patchwork.libcamera.org/comment/616/","msgid":"<20190125224859.GS4127@bigcity.dyn.berto.se>","date":"2019-01-25T22:48:59","subject":"Re: [libcamera-devel] [PATCH v2] cam: options: optional arguments\n\tneeds to be specified as --foo=bar","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi,\n\nOn 2019-01-25 23:49:35 +0200, Laurent Pinchart wrote:\n> Hi Niklas,\n> \n> Thank you for the patch.\n> \n> On Fri, Jan 25, 2019 at 06:42:54PM +0100, Niklas Söderlund wrote:\n> > It's not state in the documentation but optional arguments needs to be\n> \n> s/state/stated/\n> s/documentation/getopt_long documentation/\n> s/needs/need/\n> \n> > specified using as '--foo=bar' instead of '--foo bar', otherwise the\n> \n> s/using as/as/\n> \n> > value is not propagated to optarg during argument parsing. Update the\n> > usage printing helper to reflect this requirement.\n> > \n> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nWith the changes above pushed to master.\n\n> \n> > ---\n> >  src/cam/options.cpp | 5 +++--\n> >  1 file changed, 3 insertions(+), 2 deletions(-)\n> > \n> > diff --git a/src/cam/options.cpp b/src/cam/options.cpp\n> > index 82acff9bbeea476d..55c42540f92478e6 100644\n> > --- a/src/cam/options.cpp\n> > +++ b/src/cam/options.cpp\n> > @@ -143,9 +143,10 @@ void OptionsParser::usage()\n> >  \t\t};\n> >  \n> >  \t\tif (option.argument != ArgumentNone) {\n> > -\t\t\targument += std::string(\" \");\n> >  \t\t\tif (option.argument == ArgumentOptional)\n> > -\t\t\t\targument += \"[\";\n> > +\t\t\t\targument += \"[=\";\n> > +\t\t\telse\n> > +\t\t\t\targument += \" \";\n> >  \t\t\targument += option.argumentName;\n> >  \t\t\tif (option.argument == ArgumentOptional)\n> >  \t\t\t\targument += \"]\";\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lj1-x241.google.com (mail-lj1-x241.google.com\n\t[IPv6:2a00:1450:4864:20::241])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6695060B1B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Jan 2019 23:49:32 +0100 (CET)","by mail-lj1-x241.google.com with SMTP id t18-v6so9700179ljd.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Jan 2019 14:49:32 -0800 (PST)","from localhost (89-233-230-99.cust.bredband2.com. [89.233.230.99])\n\tby smtp.gmail.com with ESMTPSA id\n\tb69sm1748063lfl.28.2019.01.25.14.48.59\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tFri, 25 Jan 2019 14:48:59 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=CfXmkyUbos6vMUxkR9nNK+1CEF/VfwvB32b48Oym6/M=;\n\tb=SqPEbA63IbeKESLNmn8VD0Mn3Zrv6z+tXTkoUYTxUzxa9v0yUhafjXN9W5pq7iWzE/\n\tdvRqHvfMVaUKvyN63PqoEkaEH7p0Ol18LvYI9GM8RdQFpwKqhEJhTCSC7GRKarWWxsGI\n\tLzZwQ1Z4Oe2cGZdv/hGB+4T0VqSsgrBN6BH68F1XVEYxnVZcUrNcreWi3oDvI2M6te0b\n\tPWgzqxxiIVxYjwO4EMkyt3jjhELYMWIG2uvps8L/QKlHbUxRDUvQSeNW5LmXStO8h5oP\n\ttcGEk9qzLAmUu6dWdBqAG1IxXTKdWdZWUtZS7ZetTW0bXfkOKWgBdZrKJ2TPOpcXKTJY\n\t/7uQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=CfXmkyUbos6vMUxkR9nNK+1CEF/VfwvB32b48Oym6/M=;\n\tb=pK7DpRaUGwza1NbUoqXuKWaOW2AuClTS9cPghGiw+AEk8XOV5rzy4jxnLEFyTb9qxr\n\tdQfWIUwWCKQ31rPXvi6SIS0+kmqXmkin9qDmEtsPnmdVNIDAbvvWQ37O+V5i+XRF5zMM\n\tFtlbjpvtJJoD2DpjsosKHkdnK7AkbBSmJ0a3sqDWgD0ObIEE0OpXDS8kYhNvXQKX9Pwx\n\ts6pm5igG94kGsT5NuvjBwK2cTrgY7XbEtKvjL3/+7WS4w3HW1OPCXiwbJgvw8dgKqnm8\n\tENDfWR2hpz+AIN6XPAxPCp1FLqlRU5TG6e9GVQWEpNllHGED3GUO7jFxvaieXpNAjUyG\n\tgMWQ==","X-Gm-Message-State":"AJcUukc2r0jm8gM3CqPj/kFoWhbA9yISkaMRm4BbD2rkMli7kC5V0Dni\n\tflXu3jwqzJBOCr5OTqg5HsqCBQ==","X-Google-Smtp-Source":"ALg8bN6PUuyqk9n5fgdUiUjzAfYa6Ri/KeGqaNx6Whdd53JSqQEBTSlp3bfgF9pWhjqdHV+Ie/GUzQ==","X-Received":"by 2002:a2e:145a:: with SMTP id\n\t26-v6mr10124713lju.116.1548456540602; \n\tFri, 25 Jan 2019 14:49:00 -0800 (PST)","Date":"Fri, 25 Jan 2019 23:48:59 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190125224859.GS4127@bigcity.dyn.berto.se>","References":"<20190125174254.11890-1-niklas.soderlund@ragnatech.se>\n\t<20190125214935.GA4385@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190125214935.GA4385@pendragon.ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v2] cam: options: optional arguments\n\tneeds to be specified as --foo=bar","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Fri, 25 Jan 2019 22:49:32 -0000"}}]