diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-07-09 22:53:27 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-07-10 20:50:32 +0200 |
| commit | 62c34b28567a097e8f22576e7d7891bd3dbe0ac0 (patch) | |
| tree | 2a0440ed2bdb58c608582b75da6c877527dd6bda /src/lib/create_cli.cc | |
| parent | 2c499921a9f8615c8368d8161cb43c9a93c67311 (diff) | |
Replace String::compose with fmt.
sed -i "/Plural-Forms/n;/%100/n;/scanf/n;s/%[123456789]/{}/g" src/lib/*.cc src/lib/*.h src/wx/*.cc src/tools/*.cc src/lib/po/*.po src/wx/po/*.po src/tools/po/*.po test/*.cc
sed -i "s/String::compose */fmt::format/g" src/lib/*.cc src/lib/*.h src/wx/*.cc src/tools/*.cc test/*.cc
Diffstat (limited to 'src/lib/create_cli.cc')
| -rw-r--r-- | src/lib/create_cli.cc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/lib/create_cli.cc b/src/lib/create_cli.cc index 51518ae82..3701f2597 100644 --- a/src/lib/create_cli.cc +++ b/src/lib/create_cli.cc @@ -61,8 +61,8 @@ help() DCPOMATIC_ASSERT(colour_conversions.length() > 2); colour_conversions = colour_conversions.substr(0, colour_conversions.length() - 2); - return string("\nSyntax: %1 [OPTION] <CONTENT> [OPTION] [<CONTENT> ...]\n") + - variant::insert_dcpomatic(" -v, --version show %1 version\n") + + return string("\nSyntax: {} [OPTION] <CONTENT> [OPTION] [<CONTENT> ...]\n") + + variant::insert_dcpomatic(" -v, --version show {} version\n") + " -h, --help show this help\n" " -n, --name <name> film name\n" " -t, --template <name> template name\n" @@ -107,7 +107,7 @@ argument_option (int& n, int argc, char* argv[], string short_name, string long_ } if ((n + 1) >= argc) { - **error = String::compose("%1: option %2 requires an argument", argv[0], long_name); + **error = fmt::format("{}: option {} requires an argument", argv[0], long_name); return; } @@ -126,7 +126,7 @@ argument_option(int& n, int argc, char* argv[], string short_name, string long_n } if ((n + 1) >= argc) { - **error = String::compose("%1: option %2 requires an argument", argv[0], long_name); + **error = fmt::format("{}: option {} requires an argument", argv[0], long_name); return; } @@ -155,14 +155,14 @@ argument_option( } if ((n + 1) >= argc) { - **error = String::compose("%1: option %2 requires an argument", argv[0], long_name); + **error = fmt::format("{}: option {} requires an argument", argv[0], long_name); return; } auto const arg = argv[++n]; auto const value = convert(arg); if (!value) { - *error = String::compose("%1: %2 is not valid for %3", argv[0], arg, long_name); + *error = fmt::format("{}: {} is not valid for {}", argv[0], arg, long_name); *claimed = true; return; } @@ -203,7 +203,7 @@ CreateCLI::CreateCLI(int argc, char* argv[]) } else if (a == "-h" || a == "--help") { error = "Create a film directory (ready for making a DCP) or metadata file from some content files.\n" "A film directory will be created if -o or --output is specified, otherwise a metadata file\n" - "will be written to stdout.\n" + String::compose(help(), argv[0]); + "will be written to stdout.\n" + fmt::format(help(), argv[0]); return; } @@ -312,7 +312,7 @@ CreateCLI::CreateCLI(int argc, char* argv[]) if (!claimed) { if (a.length() > 2 && a.substr(0, 2) == "--") { - error = String::compose("%1: unrecognised option '%2'", argv[0], a) + String::compose(help(), argv[0]); + error = fmt::format("{}: unrecognised option '{}'", argv[0], a) + fmt::format(help(), argv[0]); return; } else { if (next_colour_conversion) { @@ -368,7 +368,7 @@ CreateCLI::CreateCLI(int argc, char* argv[]) if (dcp_content_type_string) { _dcp_content_type = DCPContentType::from_isdcf_name(*dcp_content_type_string); if (!_dcp_content_type) { - error = String::compose("%1: unrecognised DCP content type '%2'", argv[0], *dcp_content_type_string); + error = fmt::format("{}: unrecognised DCP content type '{}'", argv[0], *dcp_content_type_string); return; } } @@ -376,7 +376,7 @@ CreateCLI::CreateCLI(int argc, char* argv[]) if (!container_ratio_string.empty()) { _container_ratio = Ratio::from_id_if_exists(container_ratio_string); if (!_container_ratio) { - error = String::compose("%1: unrecognised container ratio %2", argv[0], container_ratio_string); + error = fmt::format("{}: unrecognised container ratio {}", argv[0], container_ratio_string); return; } } @@ -387,21 +387,21 @@ CreateCLI::CreateCLI(int argc, char* argv[]) } else if (*standard_string == "SMPTE") { _standard = dcp::Standard::SMPTE; } else { - error = String::compose("%1: standard must be SMPTE or interop", argv[0]); + error = fmt::format("{}: standard must be SMPTE or interop", argv[0]); return; } } if (_twod && _threed) { - error = String::compose("%1: specify one of --twod or --threed, not both", argv[0]); + error = fmt::format("{}: specify one of --twod or --threed, not both", argv[0]); } if (_no_encrypt && _encrypt) { - error = String::compose("%1: specify one of --no-encrypt or --encrypt, not both", argv[0]); + error = fmt::format("{}: specify one of --no-encrypt or --encrypt, not both", argv[0]); } if (content.empty()) { - error = String::compose("%1: no content specified", argv[0]); + error = fmt::format("{}: no content specified", argv[0]); return; } @@ -410,7 +410,7 @@ CreateCLI::CreateCLI(int argc, char* argv[]) } if (_video_bit_rate && (*_video_bit_rate < 10000000 || *_video_bit_rate > Config::instance()->maximum_video_bit_rate(VideoEncoding::JPEG2000))) { - error = String::compose("%1: video-bit-rate must be between 10 and %2 Mbit/s", argv[0], (Config::instance()->maximum_video_bit_rate(VideoEncoding::JPEG2000) / 1000000)); + error = fmt::format("{}: video-bit-rate must be between 10 and {} Mbit/s", argv[0], (Config::instance()->maximum_video_bit_rate(VideoEncoding::JPEG2000) / 1000000)); return; } |
