From 4698a4cd2d69899fd54a5263a5d37355496f990f Mon Sep 17 00:00:00 2001 From: elsid Date: Mon, 12 Sep 2022 16:55:17 +0200 Subject: [PATCH] Use raw string literals to format command usage messages --- apps/bsatool/bsatool.cpp | 31 ++++++++++++++++++------------- apps/esmtool/esmtool.cpp | 9 ++++++++- apps/essimporter/main.cpp | 3 ++- apps/niftest/niftest.cpp | 12 +++++++----- 4 files changed, 35 insertions(+), 20 deletions(-) diff --git a/apps/bsatool/bsatool.cpp b/apps/bsatool/bsatool.cpp index c45e4ff0dc..d17a81c4f2 100644 --- a/apps/bsatool/bsatool.cpp +++ b/apps/bsatool/bsatool.cpp @@ -31,19 +31,24 @@ struct Arguments bool parseOptions (int argc, char** argv, Arguments &info) { - bpo::options_description desc("Inspect and extract files from Bethesda BSA archives\n\n" - "Usages:\n" - " bsatool list [-l] archivefile\n" - " List the files presents in the input archive.\n\n" - " bsatool extract [-f] archivefile [file_to_extract] [output_directory]\n" - " Extract a file from the input archive.\n\n" - " bsatool extractall archivefile [output_directory]\n" - " Extract all files from the input archive.\n\n" - " bsatool add [-a] archivefile file_to_add\n" - " Add a file to the input archive.\n\n" - " bsatool create [-c] archivefile\n" - " Create an archive.\n\n" - "Allowed options"); + bpo::options_description desc(R"(Inspect and extract files from Bethesda BSA archives + +Usages: + bsatool list [-l] archivefile\n + List the files presents in the input archive. + + bsatool extract [-f] archivefile [file_to_extract] [output_directory] + Extract a file from the input archive. + + bsatool extractall archivefile [output_directory] + Extract all files from the input archive. + + 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(); addOption("help,h", "print help message."); diff --git a/apps/esmtool/esmtool.cpp b/apps/esmtool/esmtool.cpp index 76f11bf692..f2c12869f4 100644 --- a/apps/esmtool/esmtool.cpp +++ b/apps/esmtool/esmtool.cpp @@ -48,7 +48,14 @@ struct ESMData 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(); addOption("help,h", "print help message."); addOption("version,v", "print version information and quit."); diff --git a/apps/essimporter/main.cpp b/apps/essimporter/main.cpp index e9c58b1c39..6da7e189e7 100644 --- a/apps/essimporter/main.cpp +++ b/apps/essimporter/main.cpp @@ -14,7 +14,8 @@ int main(int argc, char** argv) { try { - bpo::options_description desc("Syntax: openmw-essimporter infile.ess outfile.omwsave\nAllowed options"); + bpo::options_description desc(R"(Syntax: openmw-essimporter infile.ess outfile.omwsave +Allowed options)"); bpo::positional_options_description p_desc; auto addOption = desc.add_options(); addOption("help,h", "produce help message"); diff --git a/apps/niftest/niftest.cpp b/apps/niftest/niftest.cpp index 0b29f364c4..8fbd5d6719 100644 --- a/apps/niftest/niftest.cpp +++ b/apps/niftest/niftest.cpp @@ -70,11 +70,13 @@ void readVFS(std::unique_ptr&& anArchive, const std::filesystem::p bool parseOptions (int argc, char** argv, std::vector &files) { - bpo::options_description desc("Ensure that OpenMW can use the provided NIF and BSA files\n\n" - "Usages:\n" - " niftool \n" - " Scan the file or directories for nif errors.\n\n" - "Allowed options"); + bpo::options_description desc(R"(Ensure that OpenMW can use the provided NIF and BSA files + +Usages: + niftool + Scan the file or directories for nif errors. + +Allowed options)"); auto addOption = desc.add_options(); addOption("help,h", "print help message."); addOption("input-file", bpo::value< Files::MaybeQuotedPathContainer >(), "input file");