diff options
author | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2019-01-25 00:15:55 +0100 |
---|---|---|
committer | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2019-01-25 23:44:55 +0100 |
commit | ac0a3d7fb678cc35857d3e4a49bedd6a7d69b57c (patch) | |
tree | fe307ccacd53c7d9bff25348f0752c18fcd4d7f5 /src/cam | |
parent | 71ef5532d9777e9511bc982cab33e3d2d95cf4be (diff) |
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>
Diffstat (limited to 'src/cam')
-rw-r--r-- | src/cam/options.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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 += "]"; |