{"id":393,"url":"https://patchwork.libcamera.org/api/patches/393/?format=json","web_url":"https://patchwork.libcamera.org/patch/393/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190125174254.11890-1-niklas.soderlund@ragnatech.se>","date":"2019-01-25T17:42:54","name":"[libcamera-devel,v2] cam: options: optional arguments needs to be specified as --foo=bar","commit_ref":"ac0a3d7fb678cc35857d3e4a49bedd6a7d69b57c","pull_url":null,"state":"accepted","archived":false,"hash":"6154136c812ef354928165ea17ef4fda2c37d8b0","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/?format=json","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/393/mbox/","series":[{"id":134,"url":"https://patchwork.libcamera.org/api/series/134/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=134","date":"2019-01-25T17:42:54","name":"[libcamera-devel,v2] cam: options: optional arguments needs to be specified as --foo=bar","version":2,"mbox":"https://patchwork.libcamera.org/series/134/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/393/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/393/checks/","tags":{},"headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net\n\t[195.74.38.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6150960C65\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 25 Jan 2019 18:43:05 +0100 (CET)","from bismarck.berto.se (unknown [89.233.230.99])\n\tby bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid a366eea0-20c8-11e9-9adf-005056917a89;\n\tFri, 25 Jan 2019 18:42:59 +0100 (CET)"],"X-Halon-ID":"a366eea0-20c8-11e9-9adf-005056917a89","Authorized-sender":"niklas@soderlund.pp.se","From":"=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 25 Jan 2019 18:42:54 +0100","Message-Id":"<20190125174254.11890-1-niklas.soderlund@ragnatech.se>","X-Mailer":"git-send-email 2.20.1","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2] cam: options: optional arguments needs\n\tto 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 17:43:05 -0000"},"content":"It's not state in the documentation but optional arguments needs to be\nspecified using as '--foo=bar' instead of '--foo bar', otherwise the\nvalue is not propagated to optarg during argument parsing. Update the\nusage printing helper to reflect this requirement.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/cam/options.cpp | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)","diff":"diff --git a/src/cam/options.cpp b/src/cam/options.cpp\nindex 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","prefixes":["libcamera-devel","v2"]}