From patchwork Fri Jan 25 17:42:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 393 Return-Path: Received: from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net [195.74.38.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6150960C65 for ; Fri, 25 Jan 2019 18:43:05 +0100 (CET) X-Halon-ID: a366eea0-20c8-11e9-9adf-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [89.233.230.99]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id a366eea0-20c8-11e9-9adf-005056917a89; Fri, 25 Jan 2019 18:42:59 +0100 (CET) From: =?utf-8?q?Niklas_S=C3=B6derlund?= 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 Subject: [libcamera-devel] [PATCH v2] cam: options: optional arguments needs to be specified as --foo=bar X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Jan 2019 17:43:05 -0000 It's not state in the documentation but optional arguments needs to be specified using as '--foo=bar' instead of '--foo bar', otherwise the value is not propagated to optarg during argument parsing. Update the usage printing helper to reflect this requirement. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/cam/options.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cam/options.cpp b/src/cam/options.cpp index 82acff9bbeea476d..55c42540f92478e6 100644 --- a/src/cam/options.cpp +++ b/src/cam/options.cpp @@ -143,9 +143,10 @@ void OptionsParser::usage() }; if (option.argument != ArgumentNone) { - argument += std::string(" "); if (option.argument == ArgumentOptional) - argument += "["; + argument += "[="; + else + argument += " "; argument += option.argumentName; if (option.argument == ArgumentOptional) argument += "]";