From fce0d1c1c30fd538cd120979bb7eb6ba5de4b91a Mon Sep 17 00:00:00 2001 From: openharmony_ci <120357966@qq.com> Date: Sun, 22 Oct 2023 08:30:45 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!119=20:?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E5=8F=B3=E9=94=AE=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E9=80=82=E9=85=8D'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/resource_data.h | 2 +- src/cmd_parser.cpp | 12 ++++++------ src/config_parser.cpp | 3 +-- src/i_resource_compiler.cpp | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/include/resource_data.h b/include/resource_data.h index b22511d..c57d56c 100644 --- a/include/resource_data.h +++ b/include/resource_data.h @@ -39,7 +39,7 @@ const static std::string LONG_PATH_HEAD = "\\\\?\\"; const static std::string ID_DEFINED_INDENTATION = " "; const static int32_t VERSION_MAX_LEN = 128; const static int32_t INT_TO_BYTES = sizeof(uint32_t); -static const int8_t RESTOOL_VERSION[VERSION_MAX_LEN] = { "Restool 4.102" }; +static const int8_t RESTOOL_VERSION[VERSION_MAX_LEN] = { "Restool 4.101" }; const static int32_t TAG_LEN = 4; enum class KeyType { diff --git a/src/cmd_parser.cpp b/src/cmd_parser.cpp index 6d2e4f7..1f6d242 100644 --- a/src/cmd_parser.cpp +++ b/src/cmd_parser.cpp @@ -392,7 +392,7 @@ uint32_t PackageParser::HandleProcess(int c, const string& argValue) { auto handler = handles_.find(c); if (handler == handles_.end()) { - cerr << "Error: unsupport " << c << endl; + cout << "Error: unsupport " << c << endl; return RESTOOL_ERROR; } return handler->second(argValue); @@ -420,7 +420,7 @@ uint32_t PackageParser::ParseCommand(int argc, char *argv[]) if (optIndex != -1) { string curOpt = (optarg == nullptr) ? argv[optind - 1] : argv[optind - 2]; if (curOpt != ("--" + string(CMD_OPTS[optIndex].name))) { - cerr << "Error: unknown option " << curOpt << endl; + cout << "Error: unknown option " << curOpt << endl; return RESTOOL_ERROR; } } @@ -432,19 +432,19 @@ uint32_t PackageParser::ParseCommand(int argc, char *argv[]) for (int i = optind; i < argc; i++) { errmsg.append(argv[i]).append(" "); } - cerr << errmsg << endl; + cout << errmsg << endl; return RESTOOL_ERROR; } if (c == Option::UNKNOWN) { string optUnknown = (optopt == 0) ? argv[optind - 1] : ("-" + string(1, optopt)); - cerr << "Error: unknown option " << optUnknown << endl; + cout << "Error: unknown option " << optUnknown << endl; return RESTOOL_ERROR; } if (c == Option::NO_ARGUMENT) { if (IsLongOpt(argv)) { - cerr << "Error: option " << argv[optind - 1] << " must have argument" << endl; + cout << "Error: option " << argv[optind - 1] << " must have argument" << endl; } else { - cerr << "Error: unknown option " << argv[optind - 1] << endl; + cout << "Error: unknown option " << argv[optind - 1] << endl; } return RESTOOL_ERROR; } diff --git a/src/config_parser.cpp b/src/config_parser.cpp index c670637..984bb76 100644 --- a/src/config_parser.cpp +++ b/src/config_parser.cpp @@ -39,8 +39,7 @@ const map ConfigParser::JSON_STRING_IDS = { { "startWindowIcon", "^\\$media:" }, { "startWindowBackground", "^\\$color:"}, { "resource", "^\\$[a-z]+:" }, - { "extra", "^\\$[a-z]+:" }, - { "fileContextMenu", "^\\profile:" } + { "extra", "^\\$[a-z]+:" } }; const map ConfigParser::JSON_ARRAY_IDS = { diff --git a/src/i_resource_compiler.cpp b/src/i_resource_compiler.cpp index cab2f7c..a3e2c03 100644 --- a/src/i_resource_compiler.cpp +++ b/src/i_resource_compiler.cpp @@ -52,7 +52,7 @@ uint32_t IResourceCompiler::Compile(const vector &directoryInfos) } if (!it->IsFile()) { - cerr << "Error: '" << it->GetFilePath().GetPath() << "' must be a file." << endl; + cout << "Error: '" << it->GetFilePath().GetPath() << "' must be a file." << endl; return RESTOOL_ERROR; }