diff -r 145b45ef7751 -r 870b868b6b57 c++/parameter-lister/CLI.cpp --- a/c++/parameter-lister/CLI.cpp Sun May 03 23:41:43 2015 +0200 +++ b/c++/parameter-lister/CLI.cpp Mon May 04 00:12:33 2015 +0200 @@ -25,10 +25,6 @@ } } -void process(shared_ptr om) { - om->process(cout); -} - } } } @@ -46,16 +42,7 @@ args.push_back(argv[i]); } - for_each(args.begin(), args.end(), [command, fgGreen, fgReset](string s) { - cout << fgGreen << command << fgReset << ": " << s << endl; - }); - - - for (int i = 0; i < args.size(); i++) { - string s = args[i]; - cout << i + 1 << ":" << s.length() << " = \"" << s << "\"" << endl; - } - + /** Load environment variable */ { string envName = args[0]; boost::optional outputModule = getenv(envName); @@ -67,14 +54,15 @@ } } + /** Do formatting */ { shared_ptr om(new OutputModule()); shared_ptr tom(new TerminalOutputModule()); shared_ptr o(new TerminalOutputModule()); - process(om); - process(tom); - process(o); + om->process(cout, command, args); + tom->process(cout, command, args); + o->process(cout, command, args); } return 0;