From 5082fe7b5b9ea7e073e409fd8b73126951803456 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 7 Jul 2021 02:59:40 +0300 Subject: cam: Allow specifying directories in the --file option The value of the --file option is the full name of the file to which captured frames are written. To write files to a specific directory with the default naming scheme, the "frame-#.bin" name has to appear at the end of the file name. Simplify usage of the option by allowing --file to specify a directory only. If the file name ends with a '/', the default "frame-#.bin" file name is automatically appended. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/cam/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/cam/main.cpp') diff --git a/src/cam/main.cpp b/src/cam/main.cpp index a3f19d0f..6d7d45e1 100644 --- a/src/cam/main.cpp +++ b/src/cam/main.cpp @@ -118,7 +118,10 @@ int CamApp::parseOptions(int argc, char *argv[]) "capture", ArgumentOptional, "count"); parser.addOption(OptFile, OptionString, "Write captured frames to disk\n" - "The first '#' character in the file name is expanded to the stream name and frame sequence number.\n" + "If the file name ends with a '/', it sets the directory in which\n" + "to write files, using the default file name. Otherwise it sets the\n" + "full file path and name. The first '#' character in the file name\n" + "is expanded to the stream name and frame sequence number.\n" "The default file name is 'frame-#.bin'.", "file", ArgumentOptional, "filename"); parser.addOption(OptStream, &streamKeyValue, -- cgit v1.2.1