X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fcreate_cli.cc;h=81e35389383383c870ef1cc529a05425f15a7b41;hp=2cbff6e85bc2900ec6342cccb72e7d6371d00905;hb=e1aac965a70ad8f50716325ef31a1829161dc6d3;hpb=87354b0a1d1f9ad48202f13e3bc2c6c3937b8a81 diff --git a/src/lib/create_cli.cc b/src/lib/create_cli.cc index 2cbff6e85..81e353893 100644 --- a/src/lib/create_cli.cc +++ b/src/lib/create_cli.cc @@ -123,7 +123,6 @@ CreateCLI::CreateCLI (int argc, char* argv[]) , threed (false) , dcp_content_type (nullptr) , container_ratio (nullptr) - , still_length (10) , standard (dcp::Standard::SMPTE) , no_use_isdcf_name (false) , twok (false) @@ -184,12 +183,20 @@ CreateCLI::CreateCLI (int argc, char* argv[]) return boost::filesystem::path(s); }; + std::function (string s)> string_to_nonzero_int = [](string s) { + auto const value = dcp::raw_convert(s); + if (value == 0) { + return boost::optional(); + } + return boost::optional(value); + }; + argument_option(i, argc, argv, "-n", "--name", &claimed, &error, &name); argument_option(i, argc, argv, "-t", "--template", &claimed, &error, &template_name_string); argument_option(i, argc, argv, "-c", "--dcp-content-type", &claimed, &error, &dcp_content_type_string); argument_option(i, argc, argv, "-f", "--dcp-frame-rate", &claimed, &error, &dcp_frame_rate_int); argument_option(i, argc, argv, "", "--container-ratio", &claimed, &error, &container_ratio_string); - argument_option(i, argc, argv, "-s", "--still-length", &claimed, &error, &still_length); + argument_option(i, argc, argv, "-s", "--still-length", &claimed, &error, &still_length, string_to_nonzero_int); argument_option(i, argc, argv, "", "--standard", &claimed, &error, &standard_string); argument_option(i, argc, argv, "", "--config", &claimed, &error, &config_dir, string_to_path); argument_option(i, argc, argv, "-o", "--output", &claimed, &error, &output_dir, string_to_path);