Use raw string literals to format command usage messages

make_linux_ci_do_zoomies
elsid 2 years ago
parent f269406061
commit 4698a4cd2d
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -31,19 +31,24 @@ struct Arguments
bool parseOptions (int argc, char** argv, Arguments &info) bool parseOptions (int argc, char** argv, Arguments &info)
{ {
bpo::options_description desc("Inspect and extract files from Bethesda BSA archives\n\n" bpo::options_description desc(R"(Inspect and extract files from Bethesda BSA archives
"Usages:\n"
" bsatool list [-l] archivefile\n" Usages:
" List the files presents in the input archive.\n\n" bsatool list [-l] archivefile\n
" bsatool extract [-f] archivefile [file_to_extract] [output_directory]\n" List the files presents in the input archive.
" Extract a file from the input archive.\n\n"
" bsatool extractall archivefile [output_directory]\n" bsatool extract [-f] archivefile [file_to_extract] [output_directory]
" Extract all files from the input archive.\n\n" Extract a file from the input archive.
" bsatool add [-a] archivefile file_to_add\n"
" Add a file to the input archive.\n\n" bsatool extractall archivefile [output_directory]
" bsatool create [-c] archivefile\n" Extract all files from the input archive.
" Create an archive.\n\n"
"Allowed options"); bsatool add [-a] archivefile file_to_add
Add a file to the input archive.
bsatool create [-c] archivefile
Create an archive.
Allowed options)");
auto addOption = desc.add_options(); auto addOption = desc.add_options();
addOption("help,h", "print help message."); addOption("help,h", "print help message.");

@ -48,7 +48,14 @@ struct ESMData
bool parseOptions (int argc, char** argv, Arguments &info) bool parseOptions (int argc, char** argv, Arguments &info)
{ {
bpo::options_description desc("Inspect and extract from Morrowind ES files (ESM, ESP, ESS)\nSyntax: esmtool [options] mode infile [outfile]\nAllowed modes:\n dump\t Dumps all readable data from the input file.\n clone\t Clones the input file to the output file.\n comp\t Compares the given files.\n\nAllowed options"); bpo::options_description desc(R"(Inspect and extract from Morrowind ES files (ESM, ESP, ESS)
Syntax: esmtool [options] mode infile [outfile]
Allowed modes:
dump Dumps all readable data from the input file.
clone Clones the input file to the output file.
comp Compares the given files.
Allowed options)");
auto addOption = desc.add_options(); auto addOption = desc.add_options();
addOption("help,h", "print help message."); addOption("help,h", "print help message.");
addOption("version,v", "print version information and quit."); addOption("version,v", "print version information and quit.");

@ -14,7 +14,8 @@ int main(int argc, char** argv)
{ {
try try
{ {
bpo::options_description desc("Syntax: openmw-essimporter <options> infile.ess outfile.omwsave\nAllowed options"); bpo::options_description desc(R"(Syntax: openmw-essimporter <options> infile.ess outfile.omwsave
Allowed options)");
bpo::positional_options_description p_desc; bpo::positional_options_description p_desc;
auto addOption = desc.add_options(); auto addOption = desc.add_options();
addOption("help,h", "produce help message"); addOption("help,h", "produce help message");

@ -70,11 +70,13 @@ void readVFS(std::unique_ptr<VFS::Archive>&& anArchive, const std::filesystem::p
bool parseOptions (int argc, char** argv, std::vector<Files::MaybeQuotedPath> &files) bool parseOptions (int argc, char** argv, std::vector<Files::MaybeQuotedPath> &files)
{ {
bpo::options_description desc("Ensure that OpenMW can use the provided NIF and BSA files\n\n" bpo::options_description desc(R"(Ensure that OpenMW can use the provided NIF and BSA files
"Usages:\n"
" niftool <nif files, BSA files, or directories>\n" Usages:
" Scan the file or directories for nif errors.\n\n" niftool <nif files, BSA files, or directories>
"Allowed options"); Scan the file or directories for nif errors.
Allowed options)");
auto addOption = desc.add_options(); auto addOption = desc.add_options();
addOption("help,h", "print help message."); addOption("help,h", "print help message.");
addOption("input-file", bpo::value< Files::MaybeQuotedPathContainer >(), "input file"); addOption("input-file", bpo::value< Files::MaybeQuotedPathContainer >(), "input file");

Loading…
Cancel
Save