diff --git a/source/src/commands/help.cpp b/source/src/commands/help.cpp index f3bf1cd..724a7a4 100644 --- a/source/src/commands/help.cpp +++ b/source/src/commands/help.cpp @@ -129,6 +129,9 @@ int help_handler(const CommandContext& ctx) { std::cout << std::endl; show_command("start"); show_command("stop"); + std::cout << std::endl; + show_command("ssh"); + std::cout << std::endl; } return 0; } diff --git a/source/src/utils/output.hpp b/source/src/utils/output.hpp new file mode 100644 index 0000000..19e23b1 --- /dev/null +++ b/source/src/utils/output.hpp @@ -0,0 +1,51 @@ +#ifndef OUTPUT_HPP +#define OUTPUT_HPP + +#include +#include +#include + +/* + +output.hpp and output.cpp - simple output helpers. + +Defines ostreams: + +debug, info, warning, error. + +These ostreams can be used with C++23 print and println, e.g. +std::println(debug, "funny variable: {}={}","my_var",my_var); + +Also defines a few helper functions: + +PrintDebug(const std::string& msg); // equivalent to std::println(debug, msg); +PrintInfo(const std::string& msg); // equivalent to std::println(info, msg); +PrintWarning(const std::string& msg); // equivalent to std::println(warning, msg); +PrintError(const std::string& msg); // equivalent to std::println(error, msg); + +Output for these streams for each line is formatted as: +[DBG] +[INF] +[WRN] +[ERR] + +The output is coloured, and the tag is printed in grey. + +In addition, when not using any of the above, helper routines for coloring the output of cout and cerr are provided. + +SetColour(std::ostream& os, sColour colour); + +Where sColour is an enum: +enum class sColour { + RESET, + DEBUG, + INFO, + WARNING, + ERROR +}; + + +*/ + + +#endif // OUTPUT_HPP \ No newline at end of file