@@ -136,24 +136,24 @@ std::vector<std::string> default_search_paths()
136136
137137void help (int n) {
138138 if ( n >= 0 ) {
139- std::cout << " ChaiScript evaluator. To evaluate an expression, type it and press <enter>." << std::endl ;
140- std::cout << " Additionally, you can inspect the runtime system using:" << std::endl ;
141- std::cout << " dump_system() - outputs all functions registered to the system" << std::endl ;
142- std::cout << " dump_object(x) - dumps information about the given symbol" << std::endl ;
139+ std::cout << " ChaiScript evaluator. To evaluate an expression, type it and press <enter>.\n " ;
140+ std::cout << " Additionally, you can inspect the runtime system using:\n " ;
141+ std::cout << " dump_system() - outputs all functions registered to the system\n " ;
142+ std::cout << " dump_object(x) - dumps information about the given symbol\n " ;
143143 } else {
144- std::cout << " usage : chai [option]+" << std::endl ;
145- std::cout << " option:" << std::endl ;
146- std::cout << " -h | --help" << std::endl ;
147- std::cout << " -i | --interactive" << std::endl ;
148- std::cout << " -c | --command cmd" << std::endl ;
149- std::cout << " -v | --version" << std::endl ;
150- std::cout << " - --stdin" << std::endl ;
151- std::cout << " filepath" << std::endl ;
144+ std::cout << " usage : chai [option]+\n " ;
145+ std::cout << " option:" << ' \n ' ;
146+ std::cout << " -h | --help" << ' \n ' ;
147+ std::cout << " -i | --interactive" << ' \n ' ;
148+ std::cout << " -c | --command cmd" << ' \n ' ;
149+ std::cout << " -v | --version" << ' \n ' ;
150+ std::cout << " - --stdin" << ' \n ' ;
151+ std::cout << " filepath" << ' \n ' ;
152152 }
153153}
154154
155155void version (int ){
156- std::cout << " chai: compiled " << __TIME__ << " " << __DATE__ << std::endl ;
156+ std::cout << " chai: compiled " << __TIME__ << " " << __DATE__ << ' \n ' ;
157157}
158158
159159bool throws_exception (const std::function<void ()> &f)
@@ -231,7 +231,7 @@ void interactive(chaiscript::ChaiScript& chai)
231231 // Then, we try to print the result of the evaluation to the user
232232 if (!val.get_type_info ().bare_equal (chaiscript::user_type<void >())) {
233233 try {
234- std::cout << chai.eval <std::function<std::string (const chaiscript::Boxed_Value &bv)> >(" to_string" )(val) << std::endl ;
234+ std::cout << chai.eval <std::function<std::string (const chaiscript::Boxed_Value &bv)> >(" to_string" )(val) << ' \n ' ;
235235 }
236236 catch (...) {} // If we can't, do nothing
237237 }
@@ -241,11 +241,11 @@ void interactive(chaiscript::ChaiScript& chai)
241241 if (ee.call_stack .size () > 0 ) {
242242 std::cout << " during evaluation at (" << ee.call_stack [0 ]->start .line << " , " << ee.call_stack [0 ]->start .column << " )" ;
243243 }
244- std::cout << std::endl ;
244+ std::cout << ' \n ' ;
245245 }
246246 catch (const std::exception &e) {
247247 std::cout << e.what ();
248- std::cout << std::endl ;
248+ std::cout << ' \n ' ;
249249 }
250250 }
251251}
@@ -305,7 +305,7 @@ int main(int argc, char *argv[])
305305
306306 if ( arg == " -c" || arg == " --command" ) {
307307 if ( (i+1 ) >= argc ) {
308- std::cout << " insufficient input following " << arg << std::endl ;
308+ std::cout << " insufficient input following " << arg << ' \n ' ;
309309 return EXIT_FAILURE;
310310 } else {
311311 arg = argv[++i];
@@ -323,7 +323,7 @@ int main(int argc, char *argv[])
323323 } else if ( arg == " -i" || arg == " --interactive" ) {
324324 mode = eInteractive ;
325325 } else if ( arg.find (' -' ) == 0 ) {
326- std::cout << " unrecognised argument " << arg << std::endl ;
326+ std::cout << " unrecognised argument " << arg << ' \n ' ;
327327 return EXIT_FAILURE;
328328 } else {
329329 mode = eFile;
@@ -335,16 +335,16 @@ int main(int argc, char *argv[])
335335 case eInteractive : interactive (chai); break ;
336336 case eCommand : val = chai.eval (arg); break ;
337337 case eFile : val = chai.eval_file (arg); break ;
338- default : std::cout << " Unrecognized execution mode" << std::endl ; return EXIT_FAILURE;
338+ default : std::cout << " Unrecognized execution mode\n " ; return EXIT_FAILURE;
339339 }
340340 }
341341 catch (const chaiscript::exception::eval_error &ee) {
342342 std::cout << ee.pretty_print ();
343- std::cout << std::endl ;
343+ std::cout << ' \n ' ;
344344 return EXIT_FAILURE;
345345 }
346346 catch (std::exception &e) {
347- std::cout << e.what () << std::endl ;
347+ std::cout << e.what () << ' \n ' ;
348348 return EXIT_FAILURE;
349349 }
350350 }
0 commit comments