Skip to content

Commit

Permalink
change executable_name to wstring
Browse files Browse the repository at this point in the history
  • Loading branch information
hknielsen committed Sep 25, 2023
1 parent e57166b commit 63a8a70
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/google/protobuf/compiler/command_line_interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,7 @@ bool CommandLineInterface::ExpandArgumentFile(

CommandLineInterface::ParseArgumentStatus CommandLineInterface::ParseArguments(
int argc, const char* const argv[]) {
executable_name_ = argv[0];
// executable_name_ = argv[0];

std::vector<std::string> arguments;
for (int i = 1; i < argc; ++i) {
Expand Down Expand Up @@ -2011,7 +2011,7 @@ CommandLineInterface::InterpretArgument(const std::string& name,
if (name.empty()) {
// Not a flag. Just a filename.
if (value.empty()) {
std::cerr
std::wcerr
<< "You seem to have passed an empty string as one of the "
"arguments to "
<< executable_name_
Expand Down Expand Up @@ -2423,7 +2423,7 @@ CommandLineInterface::InterpretArgument(const std::string& name,

void CommandLineInterface::PrintHelpText() {
// Sorry for indentation here; line wrapping would be uglier.
std::cout << "Usage: " << executable_name_ << " [OPTION] PROTO_FILES";
std::wcout << "Usage: " << executable_name_ << " [OPTION] PROTO_FILES";
std::cout << R"(
Parse PROTO_FILES and generate output based on the options given:
-IPATH, --proto_path=PATH Specify the directory in which to search for
Expand Down
2 changes: 1 addition & 1 deletion src/google/protobuf/compiler/command_line_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ class PROTOC_EXPORT CommandLineInterface {
// -----------------------------------------------------------------

// The name of the executable as invoked (i.e. argv[0]).
std::string executable_name_;
std::wstring executable_name_;

// Version info set with SetVersionInfo().
std::string version_info_;
Expand Down

0 comments on commit 63a8a70

Please sign in to comment.