@@ -678,16 +678,18 @@ namespace utils {
678678 try {
679679 confFile << app->config_to_str (true , true );
680680 confFile.close ();
681- out << Color::Code::FG_GREEN << " Error" << Color::Code::FG_DEFAULT
682- << " Writing config file: " + app->get_option_no_throw (" --write-config" )->as <std::string>();
681+ out << " [" << Color::Code::FG_GREEN << " SUCCESS" << Color::Code::FG_DEFAULT
682+ << " ] Writing config file: " + app->get_option_no_throw (" --write-config" )->as <std::string>() << std::endl
683+ << std::endl;
683684 } catch (const CLI::ParseError& e) {
684685 confFile.close ();
685- out << Color::Code::FG_RED << " Error" << Color::Code::FG_DEFAULT << " ] Writing config file: " << e.get_name () << " "
686- << e.what ();
686+ out << " [ " << Color::Code::FG_RED << " Error" << Color::Code::FG_DEFAULT << " ] Writing config file: " << e.get_name () << " "
687+ << e.what () << std::endl ;
687688 }
688689 confFile.close ();
689690 } else {
690- out << " [" << Color::Code::FG_RED << " Error" << Color::Code::FG_DEFAULT << " ] Writing config file: " << std::strerror (errno);
691+ out << " [" << Color::Code::FG_RED << " Error" << Color::Code::FG_DEFAULT << " ] Writing config file: " << std::strerror (errno)
692+ << std::endl;
691693 }
692694
693695 return out.str ();
@@ -709,7 +711,7 @@ namespace utils {
709711 try {
710712 out << app->help (helpApp, " " , mode);
711713 } catch (CLI::ParseError& e) {
712- out << Color::Code::FG_RED << " Error" << Color::Code::FG_DEFAULT << " ] Show help: " << e.get_name () << " " << e.what ();
714+ out << " [ " << Color::Code::FG_RED << " Error" << Color::Code::FG_DEFAULT << " ] Show help: " << e.get_name () << " " << e.what ();
713715 }
714716
715717 return out.str ();
@@ -747,7 +749,7 @@ namespace utils {
747749 }
748750
749751 bool Config::parse2 (bool parse1) {
750- bool success = false ;
752+ bool proceed = false ;
751753
752754 try {
753755 try {
@@ -760,23 +762,23 @@ namespace utils {
760762
761763 if (!parse1) {
762764 if (showConfigTriggerApp != nullptr ) {
763- std::cout << getConfig (showConfigTriggerApp) << std::endl ;
765+ std::cout << getConfig (showConfigTriggerApp);
764766 } else if (commandlineTriggerApp != nullptr ) {
765- std::cout << getCommandLine (commandlineTriggerApp) << std::endl ;
767+ std::cout << getCommandLine (commandlineTriggerApp);
766768 } else if (app->get_option (" --write-config" )->count () > 0 ) {
767- std::cout << doWriteConfig (app.get ()) << std::endl ;
769+ std::cout << doWriteConfig (app.get ());
768770 } else {
769- success = true ;
771+ proceed = true ;
770772 }
771773 } else {
772- success = true ;
774+ proceed = true ;
773775 }
774776 } catch (const CLI::Success&) {
775777 if (!parse1) {
776778 throw ;
777779 }
778780
779- success = true ;
781+ proceed = true ;
780782 } catch (const CLI::ParseError& e) {
781783 if (helpTriggerApp != nullptr || showConfigTriggerApp != nullptr || commandlineTriggerApp != nullptr ||
782784 versionOpt->count () > 0 ) {
@@ -790,9 +792,9 @@ namespace utils {
790792 throw CLI::CallForHelp ();
791793 }
792794 if (showConfigTriggerApp != nullptr ) {
793- std::cout << getConfig (showConfigTriggerApp) << std::endl ;
795+ std::cout << getConfig (showConfigTriggerApp);
794796 } else if (commandlineTriggerApp != nullptr ) {
795- std::cout << getCommandLine (commandlineTriggerApp) << std::endl ;
797+ std::cout << getCommandLine (commandlineTriggerApp);
796798 }
797799 } else {
798800 logger::Logger::setQuiet ();
@@ -808,7 +810,7 @@ namespace utils {
808810 } catch (const DaemonSignaled& e) {
809811 std::cout << " Pid: " << getpid () << " , child pid: " << e.getPid () << " : " << e.what () << std::endl;
810812 } catch (const CLI::CallForHelp&) {
811- std::cout << getHelp (app.get (), helpTriggerApp) << std::endl ;
813+ std::cout << getHelp (app.get (), helpTriggerApp);
812814 } catch (const CLI::CallForVersion&) {
813815 std::cout << app->version () << std::endl << std::endl;
814816 } catch (const CLI::ConversionError& e) {
@@ -840,7 +842,7 @@ namespace utils {
840842 std::cout << std::endl << " Append -h or --help to your command line for more information." << std::endl;
841843 }
842844
843- return success ;
845+ return proceed ;
844846 }
845847
846848 // ////////////////
0 commit comments