From 71e84c22dafbc45836c971f2154463ccf20077fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Tue, 19 Feb 2019 17:29:00 +0100 Subject: cam: fix printing of camera name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since commit c8c546fe99a343c1 ("cam: options: Add option type handling to options parser") introduced type handling for options the context the option is read became important. When reading the camera option for printing there is no explicit context to print it as a string and instead the int context was chosen resulting in: $ cam --camera foo Camera 0 not found While the expected output is: $ cam --camera foo Camera foo not found Fix this by providing the correct context for the camera option when printing it. Fixes: c8c546fe99a343c1 ("cam: options: Add option type handling to options parser") Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/cam/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/cam/main.cpp b/src/cam/main.cpp index 70d86bcf..ddb416f6 100644 --- a/src/cam/main.cpp +++ b/src/cam/main.cpp @@ -230,7 +230,8 @@ int main(int argc, char **argv) if (options.isSet(OptCamera)) { camera = cm->get(options[OptCamera]); if (!camera) { - std::cout << "Camera " << options[OptCamera] + std::cout << "Camera " + << std::string(options[OptCamera]) << " not found" << std::endl; goto out; } -- cgit v1.2.1