mirror of
https://github.com/openharmony/developtools_global_resource_tool.git
synced 2026-07-19 19:33:46 -04:00
@@ -75,6 +75,7 @@ private:
|
||||
uint32_t AddAppend(const std::string& argValue);
|
||||
uint32_t SetCombine();
|
||||
uint32_t AddDependEntry(const std::string& argValue);
|
||||
uint32_t ShowHelp() const;
|
||||
bool IsAscii(const std::string& argValue) const;
|
||||
|
||||
static const struct option CMD_OPTS[];
|
||||
@@ -128,6 +129,7 @@ void CmdParser<T>::ShowUseage()
|
||||
std::cout << " -e start id mask, e.g 0x01000000, in [0x01000000, 0x06FFFFFF),[0x08000000, 0x41FFFFFF)\n";
|
||||
std::cout << " -x resources folder path\n";
|
||||
std::cout << " -z flag for incremental compilation\n";
|
||||
std::cout << " -h Displays this help menu\n";
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
||||
+11
-1
@@ -39,9 +39,10 @@ const struct option PackageParser::CMD_OPTS[] = {
|
||||
{ "append", required_argument, nullptr, 'x' },
|
||||
{ "combine", required_argument, nullptr, 'z' },
|
||||
{ "dependEntry", required_argument, nullptr, 'd' },
|
||||
{ "help", no_argument, nullptr, 'h'},
|
||||
};
|
||||
|
||||
const string PackageParser::CMD_PARAMS = "i:p:o:r:m:j:e:c:l:g:x:d:afvz";
|
||||
const string PackageParser::CMD_PARAMS = "i:p:o:r:m:j:e:c:l:g:x:d:afhvz";
|
||||
|
||||
uint32_t PackageParser::Parse(int argc, char *argv[])
|
||||
{
|
||||
@@ -314,6 +315,14 @@ uint32_t PackageParser::AddDependEntry(const string& argValue)
|
||||
return RESTOOL_SUCCESS;
|
||||
}
|
||||
|
||||
uint32_t PackageParser::ShowHelp() const
|
||||
{
|
||||
auto &parser = CmdParser<PackageParser>::GetInstance();
|
||||
parser.ShowUseage();
|
||||
exit(RESTOOL_SUCCESS);
|
||||
return RESTOOL_SUCCESS;
|
||||
}
|
||||
|
||||
bool PackageParser::IsAscii(const string& argValue) const
|
||||
{
|
||||
#ifdef __WIN32
|
||||
@@ -349,6 +358,7 @@ void PackageParser::InitCommand()
|
||||
handles_.emplace('x', bind(&PackageParser::AddAppend, this, _1));
|
||||
handles_.emplace('z', [this](const string &) -> uint32_t { return SetCombine(); });
|
||||
handles_.emplace('d', bind(&PackageParser::AddDependEntry, this, _1));
|
||||
handles_.emplace('h', [this](const string &) -> uint32_t { return ShowHelp(); });
|
||||
}
|
||||
|
||||
uint32_t PackageParser::HandleProcess(int c, const string& argValue)
|
||||
|
||||
@@ -302,7 +302,7 @@ bool JsonCompiler::CheckJsonStringValue(const Json::Value &valueNode, const Reso
|
||||
ResType type = resourceItem.GetResType();
|
||||
if (type == ResType::COLOR && !CheckColorValue(value.c_str())) {
|
||||
string error = "invaild color value '" + value + \
|
||||
"', only support refer '$color:xxx' or '#rgb','#argb','#rrggbb','aarrggbb'.";
|
||||
"', only support refer '$color:xxx' or '#rgb','#argb','#rrggbb','#aarrggbb'.";
|
||||
cerr << "Error: " << error << NEW_LINE_PATH << resourceItem.GetFilePath() << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user