cam: options: optional arguments needs to be specified as --foo=bar
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 <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
71ef5532d9
commit
ac0a3d7fb6
1 changed files with 3 additions and 2 deletions
|
@ -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 += "]";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue