@@ -82,7 +82,7 @@ int main(int argc, const char **argv)
8282
8383 if (ap.parse (argc, argv) < 0 )
8484 {
85- std::cerr << ap.geterror () << std::endl ;
85+ std::cerr << ap.geterror () << " \n " ;
8686 exit (1 );
8787 }
8888
@@ -98,7 +98,7 @@ int main(int argc, const char **argv)
9898 {
9999 if (args.size () != 1 )
100100 {
101- std::cerr << " ERROR: Missing the name of the archive to create." << std::endl ;
101+ std::cerr << " ERROR: Missing the name of the archive to create.\n " ;
102102 exit (1 );
103103 }
104104
@@ -117,15 +117,15 @@ int main(int argc, const char **argv)
117117 catch (...)
118118 {
119119 // Capture any errors and display a custom message.
120- std::cerr << " ERROR: Could not load config: " << configFilename << std::endl ;
120+ std::cerr << " ERROR: Could not load config: " << configFilename << " \n " ;
121121 exit (1 );
122122 }
123123
124124 }
125125 else if (ocioEnv && *ocioEnv)
126126 {
127127 // Archive a config from the environment variable.
128- std::cout << " Archiving $OCIO=" << ocioEnv << std::endl ;
128+ std::cout << " Archiving $OCIO=" << ocioEnv << " \n " ;
129129 try
130130 {
131131 config = OCIO::Config::CreateFromEnv ();
@@ -134,13 +134,13 @@ int main(int argc, const char **argv)
134134 {
135135 // Capture any errors and display a custom message.
136136 std::cerr << " ERROR: Could not load config from $OCIO variable: "
137- << ocioEnv << std::endl ;
137+ << ocioEnv << " \n " ;
138138 exit (1 );
139139 }
140140 }
141141 else
142142 {
143- std::cerr << " ERROR: You must specify an input OCIO configuration." << std::endl ;
143+ std::cerr << " ERROR: You must specify an input OCIO configuration.\n " ;
144144 exit (1 );
145145 }
146146
@@ -165,29 +165,29 @@ int main(int argc, const char **argv)
165165 {
166166 std::cerr << " Could not open output stream for: "
167167 << archiveName + std::string (OCIO::OCIO_CONFIG_ARCHIVE_FILE_EXT)
168- << std::endl ;
168+ << " \n " ;
169169 exit (1 );
170170 }
171171 }
172172 catch (OCIO::Exception & e)
173173 {
174- std::cerr << e.what () << std::endl ;
174+ std::cerr << e.what () << " \n " ;
175175 exit (1 );
176176 }
177177 }
178178 catch (OCIO::Exception & exception)
179179 {
180- std::cerr << " ERROR: " << exception.what () << std::endl ;
180+ std::cerr << " ERROR: " << exception.what () << " \n " ;
181181 exit (1 );
182182 }
183183 catch (std::exception& exception)
184184 {
185- std::cerr << " ERROR: " << exception.what () << std::endl ;
185+ std::cerr << " ERROR: " << exception.what () << " \n " ;
186186 exit (1 );
187187 }
188188 catch (...)
189189 {
190- std::cerr << " ERROR: Unknown problem encountered." << std::endl ;
190+ std::cerr << " ERROR: Unknown problem encountered.\n " ;
191191 exit (1 );
192192 }
193193 }
@@ -198,7 +198,7 @@ int main(int argc, const char **argv)
198198 {
199199 if (args.size () != 1 )
200200 {
201- std::cerr << " ERROR: Missing the name of the archive to extract." << std::endl ;
201+ std::cerr << " ERROR: Missing the name of the archive to extract.\n " ;
202202 exit (1 );
203203 }
204204
@@ -217,11 +217,11 @@ int main(int argc, const char **argv)
217217 }
218218
219219 OCIO::ExtractOCIOZArchive (archiveName.c_str (), extractDestination.c_str ());
220- std::cout << archiveName << " has been extracted." << std::endl ;
220+ std::cout << archiveName << " has been extracted.\n " ;
221221 }
222222 catch (OCIO::Exception & e)
223223 {
224- std::cerr << e.what () << std::endl ;
224+ std::cerr << e.what () << " \n " ;
225225 exit (1 );
226226 }
227227 }
@@ -232,7 +232,7 @@ int main(int argc, const char **argv)
232232 {
233233 if (args.size () < 1 )
234234 {
235- std::cerr << " ERROR: Missing the name of the archive to list." << std::endl ;
235+ std::cerr << " ERROR: Missing the name of the archive to list.\n " ;
236236 exit (1 );
237237 }
238238
@@ -247,34 +247,34 @@ int main(int argc, const char **argv)
247247 err = mz_zip_reader_open_file (reader, path.c_str ());
248248 if (err != MZ_OK)
249249 {
250- std::cerr << " ERROR: File not found: " << path << std::endl ;
250+ std::cerr << " ERROR: File not found: " << path << " \n " ;
251251 exit (1 );
252252 }
253253
254254 err = mz_zip_reader_goto_first_entry (reader);
255255 if (err != MZ_OK)
256256 {
257- std::cerr << " ERROR: Could not find the first entry in the archive." << std::endl ;
257+ std::cerr << " ERROR: Could not find the first entry in the archive.\n " ;
258258 exit (1 );
259259 }
260260
261- std::cout << " \n The archive contains the following files:\n " << std::endl ;
262- std::cout << " Date Time CRC-32 Name" << std::endl ;
263- std::cout << " ---- ---- ------ ----" << std::endl ;
261+ std::cout << " \n The archive contains the following files:\n\n " ;
262+ std::cout << " Date Time CRC-32 Name\n " ;
263+ std::cout << " ---- ---- ------ ----\n " << std::flush ;
264264 do
265265 {
266266 err = mz_zip_reader_entry_get_info (reader, &file_info);
267267 if (err != MZ_OK)
268268 {
269269 std::cerr << " ERROR: Could not get information from entry: " << file_info->filename
270- << std::endl ;
270+ << " \n " ;
271271 exit (1 );
272272 }
273273
274274 mz_zip_time_t_to_tm (file_info->modified_date , &tmu_date);
275275
276276 // Print entry information.
277- printf (" %2.2" PRIu32 " -%2.2" PRIu32 " -%2.2" PRIu32 " %2.2" PRIu32 \
277+ printf (" %2.2" PRIu32 " -%2.2" PRIu32 " -%2.2" PRIu32 " %2.2" PRIu32
278278 " :%2.2" PRIu32 " %8.8" PRIx32 " %s\n " ,
279279 (uint32_t )tmu_date.tm_mon + 1 , (uint32_t )tmu_date.tm_mday ,
280280 (uint32_t )tmu_date.tm_year % 100 ,
@@ -290,7 +290,7 @@ int main(int argc, const char **argv)
290290 else
291291 {
292292 std::cerr << " Archive, extract, and/or list functions "
293- " may not be used at the same time." << std::endl ;
293+ " may not be used at the same time.\n " ;
294294 exit (1 );
295295 }
296296}
0 commit comments