mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 13:04:56 +00:00
Update fmtlib
This commit is contained in:
@@ -55,9 +55,9 @@ protected:
|
||||
bool continuePrompt() {
|
||||
if (!m_info.yes) {
|
||||
if (XTERM_COLOR)
|
||||
fmt::print(fmt(_SYS_STR("\n" BLUE BOLD "Continue?" NORMAL " (Y/n) ")));
|
||||
fmt::print(FMT_STRING(_SYS_STR("\n" BLUE BOLD "Continue?" NORMAL " (Y/n) ")));
|
||||
else
|
||||
fmt::print(fmt(_SYS_STR("\nContinue? (Y/n) ")));
|
||||
fmt::print(FMT_STRING(_SYS_STR("\nContinue? (Y/n) ")));
|
||||
fflush(stdout);
|
||||
|
||||
int ch;
|
||||
@@ -73,7 +73,7 @@ protected:
|
||||
#endif
|
||||
{
|
||||
if (ch == 'n' || ch == 'N') {
|
||||
fmt::print(fmt(_SYS_STR("\n")));
|
||||
fmt::print(FMT_STRING(_SYS_STR("\n")));
|
||||
return false;
|
||||
}
|
||||
if (ch == 'y' || ch == 'Y' || ch == '\r' || ch == '\n')
|
||||
@@ -83,7 +83,7 @@ protected:
|
||||
tcsetattr(0, TCSANOW, &tioOld);
|
||||
#endif
|
||||
}
|
||||
fmt::print(fmt(_SYS_STR("\n")));
|
||||
fmt::print(FMT_STRING(_SYS_STR("\n")));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -175,27 +175,27 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
void print(const hecl::SystemChar* str) { fmt::print(m_sout, fmt(_SYS_STR("{}")), str); }
|
||||
void print(const hecl::SystemChar* str) { fmt::print(m_sout, FMT_STRING(_SYS_STR("{}")), str); }
|
||||
|
||||
void printBold(const hecl::SystemChar* str) {
|
||||
if (XTERM_COLOR)
|
||||
fmt::print(m_sout, fmt(_SYS_STR("" BOLD "{}" NORMAL "")), str);
|
||||
fmt::print(m_sout, FMT_STRING(_SYS_STR("" BOLD "{}" NORMAL "")), str);
|
||||
else
|
||||
fmt::print(m_sout, fmt(_SYS_STR("{}")), str);
|
||||
fmt::print(m_sout, FMT_STRING(_SYS_STR("{}")), str);
|
||||
}
|
||||
|
||||
void secHead(const hecl::SystemChar* headName) {
|
||||
if (XTERM_COLOR)
|
||||
fmt::print(m_sout, fmt(_SYS_STR("" BOLD "{}" NORMAL "\n")), headName);
|
||||
fmt::print(m_sout, FMT_STRING(_SYS_STR("" BOLD "{}" NORMAL "\n")), headName);
|
||||
else
|
||||
fmt::print(m_sout, fmt(_SYS_STR("{}\n")), headName);
|
||||
fmt::print(m_sout, FMT_STRING(_SYS_STR("{}\n")), headName);
|
||||
}
|
||||
|
||||
void optionHead(const hecl::SystemChar* flag, const hecl::SystemChar* synopsis) {
|
||||
if (XTERM_COLOR)
|
||||
fmt::print(m_sout, fmt(_SYS_STR("" BOLD "{}" NORMAL " ({})\n")), flag, synopsis);
|
||||
fmt::print(m_sout, FMT_STRING(_SYS_STR("" BOLD "{}" NORMAL " ({})\n")), flag, synopsis);
|
||||
else
|
||||
fmt::print(m_sout, fmt(_SYS_STR("{} ({})\n")), flag, synopsis);
|
||||
fmt::print(m_sout, FMT_STRING(_SYS_STR("{} ({})\n")), flag, synopsis);
|
||||
}
|
||||
|
||||
void beginWrap() { m_wrapBuffer.clear(); }
|
||||
@@ -213,7 +213,7 @@ public:
|
||||
void endWrap() {
|
||||
_wrapBuf(m_wrapBuffer);
|
||||
m_wrapBuffer += _SYS_STR('\n');
|
||||
fmt::print(m_sout, fmt(_SYS_STR("{}")), m_wrapBuffer);
|
||||
fmt::print(m_sout, FMT_STRING(_SYS_STR("{}")), m_wrapBuffer);
|
||||
m_wrapBuffer.clear();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
}
|
||||
}
|
||||
if (!m_spec)
|
||||
LogModule.report(logvisor::Fatal, fmt(_SYS_STR("unable to find data spec '{}'")), specName);
|
||||
LogModule.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to find data spec '{}'")), specName);
|
||||
continue;
|
||||
} else if (arg.size() >= 2 && arg[0] == _SYS_STR('-') && arg[1] == _SYS_STR('-'))
|
||||
continue;
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
m_useProj = m_fallbackProj.get();
|
||||
} else if (m_fallbackProj->getProjectRootPath() != root)
|
||||
LogModule.report(logvisor::Fatal,
|
||||
fmt(_SYS_STR("hecl cook can only process multiple items in the same project; ")
|
||||
FMT_STRING(_SYS_STR("hecl cook can only process multiple items in the same project; ")
|
||||
_SYS_STR("'{}' and '{}' are different projects")),
|
||||
m_fallbackProj->getProjectRootPath().getAbsolutePath(),
|
||||
root.getAbsolutePath());
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
}
|
||||
if (!m_useProj)
|
||||
LogModule.report(logvisor::Fatal,
|
||||
fmt("hecl cook must be ran within a project directory or "
|
||||
FMT_STRING("hecl cook must be ran within a project directory or "
|
||||
"provided a path within a project"));
|
||||
|
||||
/* Default case: recursive at root */
|
||||
|
||||
@@ -29,7 +29,7 @@ class ToolExtract final : public ToolBase {
|
||||
public:
|
||||
explicit ToolExtract(const ToolPassInfo& info) : ToolBase(info) {
|
||||
if (!m_info.args.size())
|
||||
LogModule.report(logvisor::Fatal, fmt("hecl extract needs a source path as its first argument"));
|
||||
LogModule.report(logvisor::Fatal, FMT_STRING("hecl extract needs a source path as its first argument"));
|
||||
|
||||
if (!info.project) {
|
||||
hecl::SystemString rootDir;
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
baseFile.assign(baseFile.begin(), baseFile.begin() + dotPos);
|
||||
|
||||
if (baseFile.empty())
|
||||
LogModule.report(logvisor::Fatal, fmt("hecl extract must be ran within a project directory"));
|
||||
LogModule.report(logvisor::Fatal, FMT_STRING("hecl extract must be ran within a project directory"));
|
||||
|
||||
rootDir = info.cwd + baseFile;
|
||||
} else {
|
||||
@@ -62,8 +62,8 @@ public:
|
||||
newProjRoot.makeDir();
|
||||
m_fallbackProj.reset(new hecl::Database::Project(newProjRoot));
|
||||
if (logvisor::ErrorCount > ErrorRef)
|
||||
LogModule.report(logvisor::Fatal, fmt(_SYS_STR("unable to init project at '{}'")), rootDir);
|
||||
LogModule.report(logvisor::Info, fmt(_SYS_STR("initialized project at '{}/.hecl'")), rootDir);
|
||||
LogModule.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to init project at '{}'")), rootDir);
|
||||
LogModule.report(logvisor::Info, FMT_STRING(_SYS_STR("initialized project at '{}/.hecl'")), rootDir);
|
||||
m_useProj = m_fallbackProj.get();
|
||||
} else
|
||||
m_useProj = info.project;
|
||||
@@ -116,15 +116,15 @@ public:
|
||||
|
||||
static void _recursivePrint(int level, hecl::Database::IDataSpec::ExtractReport& rep) {
|
||||
for (int l = 0; l < level; ++l)
|
||||
fmt::print(fmt(_SYS_STR(" ")));
|
||||
fmt::print(FMT_STRING(_SYS_STR(" ")));
|
||||
if (XTERM_COLOR)
|
||||
fmt::print(fmt(_SYS_STR("" BOLD "{}" NORMAL "")), rep.name);
|
||||
fmt::print(FMT_STRING(_SYS_STR("" BOLD "{}" NORMAL "")), rep.name);
|
||||
else
|
||||
fmt::print(fmt(_SYS_STR("{}")), rep.name);
|
||||
fmt::print(FMT_STRING(_SYS_STR("{}")), rep.name);
|
||||
|
||||
if (rep.desc.size())
|
||||
fmt::print(fmt(_SYS_STR(" [{}]")), rep.desc);
|
||||
fmt::print(fmt(_SYS_STR("\n")));
|
||||
fmt::print(FMT_STRING(_SYS_STR(" [{}]")), rep.desc);
|
||||
fmt::print(FMT_STRING(_SYS_STR("\n")));
|
||||
for (hecl::Database::IDataSpec::ExtractReport& child : rep.childOpts)
|
||||
_recursivePrint(level + 1, child);
|
||||
}
|
||||
@@ -132,32 +132,32 @@ public:
|
||||
int run() override {
|
||||
if (m_specPasses.empty()) {
|
||||
if (XTERM_COLOR)
|
||||
fmt::print(fmt(_SYS_STR("" RED BOLD "NOTHING TO EXTRACT" NORMAL "\n")));
|
||||
fmt::print(FMT_STRING(_SYS_STR("" RED BOLD "NOTHING TO EXTRACT" NORMAL "\n")));
|
||||
else
|
||||
fmt::print(fmt(_SYS_STR("NOTHING TO EXTRACT\n")));
|
||||
fmt::print(FMT_STRING(_SYS_STR("NOTHING TO EXTRACT\n")));
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (XTERM_COLOR)
|
||||
fmt::print(fmt(_SYS_STR("" GREEN BOLD "ABOUT TO EXTRACT:" NORMAL "\n")));
|
||||
fmt::print(FMT_STRING(_SYS_STR("" GREEN BOLD "ABOUT TO EXTRACT:" NORMAL "\n")));
|
||||
else
|
||||
fmt::print(fmt(_SYS_STR("ABOUT TO EXTRACT:\n")));
|
||||
fmt::print(FMT_STRING(_SYS_STR("ABOUT TO EXTRACT:\n")));
|
||||
|
||||
for (hecl::Database::IDataSpec::ExtractReport& rep : m_reps) {
|
||||
_recursivePrint(0, rep);
|
||||
fmt::print(fmt(_SYS_STR("\n")));
|
||||
fmt::print(FMT_STRING(_SYS_STR("\n")));
|
||||
}
|
||||
fflush(stdout);
|
||||
|
||||
if (continuePrompt()) {
|
||||
for (SpecExtractPass& ds : m_specPasses) {
|
||||
if (XTERM_COLOR)
|
||||
fmt::print(fmt(_SYS_STR("" MAGENTA BOLD "Using DataSpec {}:" NORMAL "\n")), ds.m_entry->m_name);
|
||||
fmt::print(FMT_STRING(_SYS_STR("" MAGENTA BOLD "Using DataSpec {}:" NORMAL "\n")), ds.m_entry->m_name);
|
||||
else
|
||||
fmt::print(fmt(_SYS_STR("Using DataSpec {}:\n")), ds.m_entry->m_name);
|
||||
fmt::print(FMT_STRING(_SYS_STR("Using DataSpec {}:\n")), ds.m_entry->m_name);
|
||||
|
||||
ds.m_instance->doExtract(m_einfo, {true});
|
||||
fmt::print(fmt(_SYS_STR("\n\n")));
|
||||
fmt::print(FMT_STRING(_SYS_STR("\n\n")));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ class ToolHelp final : public ToolBase {
|
||||
public:
|
||||
explicit ToolHelp(const ToolPassInfo& info) : ToolBase(info) {
|
||||
if (m_info.args.empty()) {
|
||||
LogModule.report(logvisor::Error, fmt("help requires a tool name argument"));
|
||||
LogModule.report(logvisor::Error, FMT_STRING("help requires a tool name argument"));
|
||||
return;
|
||||
}
|
||||
m_good = true;
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
else if (toolName == _SYS_STR("help"))
|
||||
helpFunc = ToolHelp::Help;
|
||||
else {
|
||||
LogModule.report(logvisor::Error, fmt(_SYS_STR("unrecognized tool '{}' - can't help")), toolName);
|
||||
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("unrecognized tool '{}' - can't help")), toolName);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class ToolImage final : public ToolBase {
|
||||
public:
|
||||
explicit ToolImage(const ToolPassInfo& info) : ToolBase(info), m_useProj(info.project) {
|
||||
if (!info.project)
|
||||
LogModule.report(logvisor::Fatal, fmt("hecl image must be ran within a project directory"));
|
||||
LogModule.report(logvisor::Fatal, FMT_STRING("hecl image must be ran within a project directory"));
|
||||
|
||||
/* Scan args */
|
||||
if (info.args.size()) {
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
}
|
||||
if (!m_useProj)
|
||||
LogModule.report(logvisor::Fatal,
|
||||
fmt("hecl image must be ran within a project directory or "
|
||||
FMT_STRING("hecl image must be ran within a project directory or "
|
||||
"provided a path within a project"));
|
||||
}
|
||||
|
||||
@@ -75,29 +75,29 @@ public:
|
||||
|
||||
int run() override {
|
||||
if (XTERM_COLOR)
|
||||
fmt::print(fmt(_SYS_STR("" GREEN BOLD "ABOUT TO IMAGE:" NORMAL "\n")));
|
||||
fmt::print(FMT_STRING(_SYS_STR("" GREEN BOLD "ABOUT TO IMAGE:" NORMAL "\n")));
|
||||
else
|
||||
fmt::print(fmt(_SYS_STR("ABOUT TO IMAGE:\n")));
|
||||
fmt::print(FMT_STRING(_SYS_STR("ABOUT TO IMAGE:\n")));
|
||||
|
||||
fmt::print(fmt(_SYS_STR(" {}\n")), m_useProj->getProjectRootPath().getAbsolutePath());
|
||||
fmt::print(FMT_STRING(_SYS_STR(" {}\n")), m_useProj->getProjectRootPath().getAbsolutePath());
|
||||
fflush(stdout);
|
||||
|
||||
if (continuePrompt()) {
|
||||
hecl::ProjectPath outPath(m_useProj->getProjectWorkingPath(), _SYS_STR("out"));
|
||||
if (!outPath.isDirectory()) {
|
||||
LogModule.report(logvisor::Error, fmt(_SYS_STR("{} is not a directory")), outPath.getAbsolutePath());
|
||||
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("{} is not a directory")), outPath.getAbsolutePath());
|
||||
return 1;
|
||||
}
|
||||
|
||||
hecl::ProjectPath bootBinPath(outPath, _SYS_STR("sys/boot.bin"));
|
||||
if (!bootBinPath.isFile()) {
|
||||
LogModule.report(logvisor::Error, fmt(_SYS_STR("{} is not a file")), bootBinPath.getAbsolutePath());
|
||||
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("{} is not a file")), bootBinPath.getAbsolutePath());
|
||||
return 1;
|
||||
}
|
||||
|
||||
athena::io::FileReader r(bootBinPath.getAbsolutePath());
|
||||
if (r.hasError()) {
|
||||
LogModule.report(logvisor::Error, fmt(_SYS_STR("unable to open {}")), bootBinPath.getAbsolutePath());
|
||||
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("unable to open {}")), bootBinPath.getAbsolutePath());
|
||||
return 1;
|
||||
}
|
||||
std::string id = r.readString(6);
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
fileOut += _SYS_STR(".gcm");
|
||||
if (nod::DiscBuilderGCN::CalculateTotalSizeRequired(outPath.getAbsolutePath()) == UINT64_MAX)
|
||||
return 1;
|
||||
LogModule.report(logvisor::Info, fmt(_SYS_STR("Generating {} as GameCube image")), fileOut);
|
||||
LogModule.report(logvisor::Info, FMT_STRING(_SYS_STR("Generating {} as GameCube image")), fileOut);
|
||||
nod::DiscBuilderGCN db(fileOut, progFunc);
|
||||
if (db.buildFromDirectory(outPath.getAbsolutePath()) != nod::EBuildResult::Success)
|
||||
return 1;
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
bool dualLayer;
|
||||
if (nod::DiscBuilderWii::CalculateTotalSizeRequired(outPath.getAbsolutePath(), dualLayer) == UINT64_MAX)
|
||||
return 1;
|
||||
LogModule.report(logvisor::Info, fmt(_SYS_STR("Generating {} as {}-layer Wii image")), fileOut,
|
||||
LogModule.report(logvisor::Info, FMT_STRING(_SYS_STR("Generating {} as {}-layer Wii image")), fileOut,
|
||||
dualLayer ? _SYS_STR("dual") : _SYS_STR("single"));
|
||||
nod::DiscBuilderWii db(fileOut, dualLayer, progFunc);
|
||||
if (db.buildFromDirectory(outPath.getAbsolutePath()) != nod::EBuildResult::Success)
|
||||
|
||||
@@ -18,18 +18,18 @@ public:
|
||||
if (hecl::Stat(dir->c_str(), &theStat)) {
|
||||
hecl::MakeDir(dir->c_str());
|
||||
if (hecl::Stat(dir->c_str(), &theStat)) {
|
||||
LogModule.report(logvisor::Fatal, fmt(_SYS_STR("unable to stat '{}'")), *dir);
|
||||
LogModule.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to stat '{}'")), *dir);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!S_ISDIR(theStat.st_mode)) {
|
||||
LogModule.report(logvisor::Fatal, fmt(_SYS_STR("'{}' is not a directory")), *dir);
|
||||
LogModule.report(logvisor::Fatal, FMT_STRING(_SYS_STR("'{}' is not a directory")), *dir);
|
||||
return;
|
||||
}
|
||||
|
||||
hecl::SystemString testPath = *dir + _SYS_STR("/.hecl/beacon");
|
||||
if (!hecl::Stat(testPath.c_str(), &theStat)) {
|
||||
LogModule.report(logvisor::Fatal, fmt(_SYS_STR("project already exists at '{}'")), *dir);
|
||||
LogModule.report(logvisor::Fatal, FMT_STRING(_SYS_STR("project already exists at '{}'")), *dir);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
hecl::Database::Project proj((hecl::ProjectRootPath(*m_dir)));
|
||||
if (logvisor::ErrorCount > ErrorRef)
|
||||
return 1;
|
||||
LogModule.report(logvisor::Info, fmt(_SYS_STR("initialized project at '{}/.hecl'")), *m_dir);
|
||||
LogModule.report(logvisor::Info, FMT_STRING(_SYS_STR("initialized project at '{}/.hecl'")), *m_dir);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ class ToolPackage final : public ToolBase {
|
||||
public:
|
||||
explicit ToolPackage(const ToolPassInfo& info) : ToolBase(info), m_useProj(info.project) {
|
||||
if (!info.project)
|
||||
LogModule.report(logvisor::Fatal, fmt("hecl package must be ran within a project directory"));
|
||||
LogModule.report(logvisor::Fatal, FMT_STRING("hecl package must be ran within a project directory"));
|
||||
|
||||
/* Scan args */
|
||||
if (info.args.size()) {
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
}
|
||||
}
|
||||
if (!m_spec)
|
||||
LogModule.report(logvisor::Fatal, fmt(_SYS_STR("unable to find data spec '{}'")), specName);
|
||||
LogModule.report(logvisor::Fatal, FMT_STRING(_SYS_STR("unable to find data spec '{}'")), specName);
|
||||
continue;
|
||||
} else if (arg.size() >= 2 && arg[0] == _SYS_STR('-') && arg[1] == _SYS_STR('-'))
|
||||
continue;
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
m_useProj = m_fallbackProj.get();
|
||||
} else if (m_fallbackProj->getProjectRootPath() != root)
|
||||
LogModule.report(logvisor::Fatal,
|
||||
fmt(_SYS_STR("hecl package can only process multiple items in the same project; ")
|
||||
FMT_STRING(_SYS_STR("hecl package can only process multiple items in the same project; ")
|
||||
_SYS_STR("'{}' and '{}' are different projects")),
|
||||
m_fallbackProj->getProjectRootPath().getAbsolutePath(),
|
||||
root.getAbsolutePath());
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
}
|
||||
if (!m_useProj)
|
||||
LogModule.report(logvisor::Fatal,
|
||||
fmt("hecl package must be ran within a project directory or "
|
||||
FMT_STRING("hecl package must be ran within a project directory or "
|
||||
"provided a path within a project"));
|
||||
|
||||
/* Default case: recursive at root */
|
||||
@@ -155,12 +155,12 @@ public:
|
||||
|
||||
int run() override {
|
||||
if (XTERM_COLOR)
|
||||
fmt::print(fmt(_SYS_STR("" GREEN BOLD "ABOUT TO PACKAGE:" NORMAL "\n")));
|
||||
fmt::print(FMT_STRING(_SYS_STR("" GREEN BOLD "ABOUT TO PACKAGE:" NORMAL "\n")));
|
||||
else
|
||||
fmt::print(fmt(_SYS_STR("ABOUT TO PACKAGE:\n")));
|
||||
fmt::print(FMT_STRING(_SYS_STR("ABOUT TO PACKAGE:\n")));
|
||||
|
||||
for (auto& item : m_selectedItems)
|
||||
fmt::print(fmt(_SYS_STR(" {}\n")), item.getRelativePath());
|
||||
fmt::print(FMT_STRING(_SYS_STR(" {}\n")), item.getRelativePath());
|
||||
fflush(stdout);
|
||||
|
||||
if (continuePrompt()) {
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
hecl::ClientProcess cp(&printer);
|
||||
for (const hecl::ProjectPath& path : m_selectedItems) {
|
||||
if (!m_useProj->packagePath(path, printer, m_fast, m_spec, &cp))
|
||||
LogModule.report(logvisor::Error, fmt(_SYS_STR("Unable to package {}")), path.getAbsolutePath());
|
||||
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("Unable to package {}")), path.getAbsolutePath());
|
||||
}
|
||||
cp.waitUntilComplete();
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ public:
|
||||
return;
|
||||
|
||||
if (!info.project)
|
||||
LogModule.report(logvisor::Fatal, fmt("hecl spec must be ran within a project directory"));
|
||||
LogModule.report(logvisor::Fatal, FMT_STRING("hecl spec must be ran within a project directory"));
|
||||
|
||||
const auto& specs = info.project->getDataSpecs();
|
||||
hecl::SystemString firstArg = info.args.front();
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
return;
|
||||
|
||||
if (info.args.size() < 2)
|
||||
LogModule.report(logvisor::Fatal, fmt("Speclist argument required"));
|
||||
LogModule.report(logvisor::Fatal, FMT_STRING("Speclist argument required"));
|
||||
|
||||
auto it = info.args.begin();
|
||||
++it;
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
LogModule.report(logvisor::Fatal, fmt(_SYS_STR("'{}' is not found in the dataspec registry")), *it);
|
||||
LogModule.report(logvisor::Fatal, FMT_STRING(_SYS_STR("'{}' is not found in the dataspec registry")), *it);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,10 +77,10 @@ public:
|
||||
if (!m_info.project) {
|
||||
for (const hecl::Database::DataSpecEntry* spec : hecl::Database::DATA_SPEC_REGISTRY) {
|
||||
if (XTERM_COLOR)
|
||||
fmt::print(fmt(_SYS_STR("" BOLD CYAN "{}" NORMAL "\n")), spec->m_name);
|
||||
fmt::print(FMT_STRING(_SYS_STR("" BOLD CYAN "{}" NORMAL "\n")), spec->m_name);
|
||||
else
|
||||
fmt::print(fmt(_SYS_STR("{}\n")), spec->m_name);
|
||||
fmt::print(fmt(_SYS_STR(" {}\n")), spec->m_desc);
|
||||
fmt::print(FMT_STRING(_SYS_STR("{}\n")), spec->m_name);
|
||||
fmt::print(FMT_STRING(_SYS_STR(" {}\n")), spec->m_desc);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -89,16 +89,16 @@ public:
|
||||
if (mode == MLIST) {
|
||||
for (auto& spec : specs) {
|
||||
if (XTERM_COLOR)
|
||||
fmt::print(fmt(_SYS_STR("" BOLD CYAN "{}" NORMAL "")), spec.spec.m_name);
|
||||
fmt::print(FMT_STRING(_SYS_STR("" BOLD CYAN "{}" NORMAL "")), spec.spec.m_name);
|
||||
else
|
||||
fmt::print(fmt(_SYS_STR("{}")), spec.spec.m_name);
|
||||
fmt::print(FMT_STRING(_SYS_STR("{}")), spec.spec.m_name);
|
||||
if (spec.active) {
|
||||
if (XTERM_COLOR)
|
||||
fmt::print(fmt(_SYS_STR(" " BOLD GREEN "[ENABLED]" NORMAL "")));
|
||||
fmt::print(FMT_STRING(_SYS_STR(" " BOLD GREEN "[ENABLED]" NORMAL "")));
|
||||
else
|
||||
fmt::print(fmt(_SYS_STR(" [ENABLED]")));
|
||||
fmt::print(FMT_STRING(_SYS_STR(" [ENABLED]")));
|
||||
}
|
||||
fmt::print(fmt(_SYS_STR("\n {}\n")), spec.spec.m_desc);
|
||||
fmt::print(FMT_STRING(_SYS_STR("\n {}\n")), spec.spec.m_desc);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -46,20 +46,20 @@ bool XTERM_COLOR = false;
|
||||
/* Main usage message */
|
||||
static void printHelp(const hecl::SystemChar* pname) {
|
||||
if (XTERM_COLOR)
|
||||
fmt::print(fmt(_SYS_STR("" BOLD "HECL" NORMAL "")));
|
||||
fmt::print(FMT_STRING(_SYS_STR("" BOLD "HECL" NORMAL "")));
|
||||
else
|
||||
fmt::print(fmt(_SYS_STR("HECL")));
|
||||
fmt::print(FMT_STRING(_SYS_STR("HECL")));
|
||||
#if HECL_HAS_NOD
|
||||
#define TOOL_LIST "extract|init|cook|package|image|installaddon|help"
|
||||
#else
|
||||
#define TOOL_LIST "extract|init|cook|package|installaddon|help"
|
||||
#endif
|
||||
#if HECL_GIT
|
||||
fmt::print(fmt(_SYS_STR(" Commit " HECL_GIT_S " " HECL_BRANCH_S "\nUsage: {} " TOOL_LIST "\n")), pname);
|
||||
fmt::print(FMT_STRING(_SYS_STR(" Commit " HECL_GIT_S " " HECL_BRANCH_S "\nUsage: {} " TOOL_LIST "\n")), pname);
|
||||
#elif HECL_VER
|
||||
fmt::print(fmt(_SYS_STR(" Version " HECL_VER_S "\nUsage: {} " TOOL_LIST "\n")), pname);
|
||||
fmt::print(FMT_STRING(_SYS_STR(" Version " HECL_VER_S "\nUsage: {} " TOOL_LIST "\n")), pname);
|
||||
#else
|
||||
fmt::print(fmt(_SYS_STR("\nUsage: {} " TOOL_LIST "\n")), pname);
|
||||
fmt::print(FMT_STRING(_SYS_STR("\nUsage: {} " TOOL_LIST "\n")), pname);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ static std::unique_ptr<ToolBase> MakeSelectedTool(hecl::SystemString toolName, T
|
||||
|
||||
auto fp = hecl::FopenUnique(toolName.c_str(), _SYS_STR("rb"));
|
||||
if (fp == nullptr) {
|
||||
LogModule.report(logvisor::Error, fmt(_SYS_STR("unrecognized tool '{}'")), toolNameLower);
|
||||
LogModule.report(logvisor::Error, FMT_STRING(_SYS_STR("unrecognized tool '{}'")), toolNameLower);
|
||||
return nullptr;
|
||||
}
|
||||
fp.reset();
|
||||
@@ -281,7 +281,7 @@ int main(int argc, const char** argv)
|
||||
#endif
|
||||
{
|
||||
if (argc > 1 && !hecl::StrCmp(argv[1], _SYS_STR("--dlpackage"))) {
|
||||
fmt::print(fmt("{}\n"), HECL_DLPACKAGE);
|
||||
fmt::print(FMT_STRING("{}\n"), HECL_DLPACKAGE);
|
||||
return 100;
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ int main(int argc, const char** argv)
|
||||
return 1;
|
||||
}
|
||||
if (info.verbosityLevel) {
|
||||
LogModule.report(logvisor::Info, fmt(_SYS_STR("Constructed tool '{}' {}\n")), tool->toolName(),
|
||||
LogModule.report(logvisor::Info, FMT_STRING(_SYS_STR("Constructed tool '{}' {}\n")), tool->toolName(),
|
||||
info.verbosityLevel);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user