From ac0a3d7fb678cc35857d3e4a49bedd6a7d69b57c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Fri, 25 Jan 2019 00:15:55 +0100 Subject: cam: options: optional arguments needs to be specified as --foo=bar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's not stated in the getopt_long documentation but optional arguments need to be specified 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(-) (limited to 'src') diff --git a/src/cam/options.cpp b/src/cam/options.cpp index 82acff9b..55c42540 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 += "]"; -- cgit v1.2.1