@@ -91,15 +91,15 @@ int main(int argc, const char **argv) {
91
91
}
92
92
93
93
if (input_file == " " ) {
94
- std::cout << " Error: No input file given. Type --help for help." << std::endl;
95
- return 0 ;
94
+ std::cerr << " Error: No input file given. Type --help for help." << std::endl;
95
+ return 1 ;
96
96
}
97
97
98
98
// In order to parse a file, we need to load the whole thing into memory.
99
99
std::ifstream in_file (input_file.c_str (), std::ifstream::in);
100
100
if (!in_file.is_open ()) {
101
- std::cout << " Error: Failed to open file " << input_file << std::endl;
102
- return 0 ;
101
+ std::cerr << " Error: Failed to open file " << input_file << std::endl;
102
+ return 1 ;
103
103
}
104
104
// Seek to the end.
105
105
in_file.seekg (0 , std::ifstream::end);
@@ -125,9 +125,9 @@ int main(int argc, const char **argv) {
125
125
// Only base-level node should be <ucd>
126
126
rapidxml::xml_node<> *ucdNode = unicode_doc.first_node (" ucd" );
127
127
if (ucdNode == nullptr ) {
128
- std::cout << " Error: No <ucd> base-level tag found. Invalid Unicode Block XML file."
128
+ std::cerr << " Error: No <ucd> base-level tag found. Invalid Unicode Block XML file."
129
129
<< std::endl;
130
- return 0 ;
130
+ return 1 ;
131
131
}
132
132
133
133
// / Get the Unicode Version
@@ -144,8 +144,8 @@ int main(int argc, const char **argv) {
144
144
// Search for Blocks
145
145
rapidxml::xml_node<> *blockNode = ucdNode->first_node (" blocks" );
146
146
if (blockNode == nullptr ) {
147
- std::cout << " Error: No Unicode Blocks described in file." << std::endl;
148
- return 0 ;
147
+ std::cerr << " Error: No Unicode Blocks described in file." << std::endl;
148
+ return 1 ;
149
149
}
150
150
151
151
// / Collect Block Data
@@ -179,8 +179,8 @@ int main(int argc, const char **argv) {
179
179
std::ofstream out_file (output_dir + " unicode_blocks_" + unicode_vers + " .hpp" ,
180
180
std::ofstream::out);
181
181
if (!out_file.is_open ()) {
182
- std::cout << " Failed to open header for writing: " << output_dir << " unicode_blocks.h " ;
183
- return 0 ;
182
+ std::cerr << " Error: Failed to open header for writing: " << output_dir << " unicode_blocks_ " << unicode_vers << " .hpp " ;
183
+ return 1 ;
184
184
}
185
185
186
186
// First, write the license disclaimer.
0 commit comments