]> git.sesse.net Git - casparcg/blobdiff - protocol/amcp/AMCPCommandsImpl.cpp
Added missing documentation to version_describer. Solves #437.
[casparcg] / protocol / amcp / AMCPCommandsImpl.cpp
index 62df79337ce760ba5b228d0d9df5bb3e72ae12a4..d835be7398f081c2cf36f027ae8c066123b3446c 100644 (file)
@@ -38,6 +38,7 @@
 #include <common/os/filesystem.h>
 #include <common/base64.h>
 #include <common/thread_info.h>
+#include <common/filesystem.h>
 
 #include <core/producer/cg_proxy.h>
 #include <core/producer/frame_producer.h>
@@ -48,6 +49,7 @@
 #include <core/producer/transition/transition_producer.h>
 #include <core/frame/audio_channel_layout.h>
 #include <core/frame/frame_transform.h>
+#include <core/producer/text/text_producer.h>
 #include <core/producer/stage.h>
 #include <core/producer/layer.h>
 #include <core/mixer/mixer.h>
@@ -207,8 +209,6 @@ std::wstring MediaInfo(const boost::filesystem::path& path, const spl::shared_pt
 
        auto is_not_digit = [](char c){ return std::isdigit(c) == 0; };
 
-       auto relativePath = boost::filesystem::path(path.wstring().substr(env::media_folder().size() - 1, path.wstring().size()));
-
        auto writeTimeStr = boost::posix_time::to_iso_string(boost::posix_time::from_time_t(boost::filesystem::last_write_time(path)));
        writeTimeStr.erase(std::remove_if(writeTimeStr.begin(), writeTimeStr.end(), is_not_digit), writeTimeStr.end());
        auto writeTimeWStr = std::wstring(writeTimeStr.begin(), writeTimeStr.end());
@@ -217,7 +217,9 @@ std::wstring MediaInfo(const boost::filesystem::path& path, const spl::shared_pt
        sizeStr.erase(std::remove_if(sizeStr.begin(), sizeStr.end(), is_not_digit), sizeStr.end());
        auto sizeWStr = std::wstring(sizeStr.begin(), sizeStr.end());
 
-       auto str = relativePath.replace_extension(L"").generic_wstring();
+       auto relativePath = get_relative_without_extension(path, env::media_folder());
+       auto str = relativePath.generic_wstring();
+
        if (str[0] == '\\' || str[0] == '/')
                str = std::wstring(str.begin() + 1, str.end());
 
@@ -248,7 +250,7 @@ std::wstring ListTemplates(const spl::shared_ptr<core::cg_producer_registry>& cg
        {               
                if(boost::filesystem::is_regular_file(itr->path()) && cg_registry->is_cg_extension(itr->path().extension().wstring()))
                {
-                       auto relativePath = boost::filesystem::path(itr->path().wstring().substr(env::template_folder().size()-1, itr->path().wstring().size()));
+                       auto relativePath = get_relative_without_extension(itr->path(), env::template_folder());
 
                        auto writeTimeStr = boost::posix_time::to_iso_string(boost::posix_time::from_time_t(boost::filesystem::last_write_time(itr->path())));
                        writeTimeStr.erase(std::remove_if(writeTimeStr.begin(), writeTimeStr.end(), [](char c){ return std::isdigit(c) == 0;}), writeTimeStr.end());
@@ -263,12 +265,15 @@ std::wstring ListTemplates(const spl::shared_ptr<core::cg_producer_registry>& cg
                        auto file = boost::to_upper_copy(relativePath.filename().wstring());
                        relativePath = dir / file;
                                                
-                       auto str = relativePath.replace_extension(L"").generic_wstring();
+                       auto str = relativePath.generic_wstring();
                        boost::trim_if(str, boost::is_any_of("\\/"));
 
+                       auto template_type = cg_registry->get_cg_producer_name(str);
+
                        replyString << L"\"" << str
                                                << L"\" " << sizeWStr
                                                << L" " << writeTimeWStr
+                                               << L" " << template_type
                                                << L"\r\n";
                }
        }
@@ -531,7 +536,7 @@ void call_describer(core::help_sink& sink, const core::help_repository& repo)
 
 std::wstring call_command(command_context& ctx)
 {
-       auto result = ctx.channel.channel->stage().call(ctx.layer_index(), ctx.parameters);
+       auto result = ctx.channel.channel->stage().call(ctx.layer_index(), ctx.parameters).get();
 
        // TODO: because of std::async deferred timed waiting does not work
 
@@ -540,10 +545,10 @@ std::wstring call_command(command_context& ctx)
        CASPAR_THROW_EXCEPTION(timed_out());*/
 
        std::wstringstream replyString;
-       if (result.get().empty())
+       if (result.empty())
                replyString << L"202 CALL OK\r\n";
        else
-               replyString << L"201 CALL OK\r\n" << result.get() << L"\r\n";
+               replyString << L"201 CALL OK\r\n" << result << L"\r\n";
 
        return replyString.str();
 }
@@ -593,7 +598,7 @@ std::wstring swap_command(command_context& ctx)
 void add_describer(core::help_sink& sink, const core::help_repository& repo)
 {
        sink.short_description(L"Add a consumer to a video channel.");
-       sink.syntax(L"ADD [video_channel:int] [consumer:string] [parameters:string]");
+       sink.syntax(L"ADD [video_channel:int]{-[consumer_index:int]} [consumer:string] [parameters:string]");
        sink.para()
                ->text(L"Adds a consumer to the specified video channel. The string ")
                ->code(L"consumer")->text(L" will be parsed by the available consumer factories. ")
@@ -601,6 +606,10 @@ void add_describer(core::help_sink& sink, const core::help_repository& repo)
                ->code(L"video_channel")->text(L". Different consumers require different parameters, ")
                ->text(L"some examples are below. Consumers can alternatively be specified by adding them to ")
                ->see(L"the CasparCG config file")->text(L".");
+       sink.para()
+               ->text(L"Specifying ")->code(L"consumer_index")
+               ->text(L" overrides the index that the consumer itself decides and can later be used with the ")
+               ->see(L"REMOVE")->text(L" command to remove the consumer.");
        sink.para()->text(L"Examples:");
        sink.example(L">> ADD 1 DECKLINK 1");
        sink.example(L">> ADD 1 BLUEFISH 2");
@@ -609,6 +618,9 @@ void add_describer(core::help_sink& sink, const core::help_repository& repo)
        sink.example(L">> ADD 1 IMAGE filename");
        sink.example(L">> ADD 1 FILE filename.mov");
        sink.example(L">> ADD 1 FILE filename.mov SEPARATE_KEY");
+       sink.example(
+               L">> ADD 1-700 FILE filename.mov SEPARATE_KEY\n"
+               L">> REMOVE 1-700", L"overriding the consumer index to easier remove later.");
        sink.para()->text(L"The streaming consumer is an implementation of the ffmpeg_consumer and supports many of the same arguments:");
        sink.example(L">> ADD 1 STREAM udp://localhost:5004 -vcodec libx264 -tune zerolatency -preset ultrafast -crf 25 -format mpegts -vf scale=240:180");
 }
@@ -699,6 +711,23 @@ std::wstring log_level_command(command_context& ctx)
        return L"202 LOG OK\r\n";
 }
 
+void log_category_describer(core::help_sink& sink, const core::help_repository& repo)
+{
+       sink.short_description(L"Enable/disable a logging category in the server.");
+       sink.syntax(L"LOG CATEGORY [category:calltrace,communication] [enable:0,1]");
+       sink.para()->text(L"Enables or disables the specified logging category.");
+       sink.para()->text(L"Examples:");
+       sink.example(L">> LOG CATEGORY calltrace 1", L"to enable call trace");
+       sink.example(L">> LOG CATEGORY calltrace 0", L"to disable call trace");
+}
+
+std::wstring log_category_command(command_context& ctx)
+{
+       log::set_log_category(ctx.parameters.at(0), ctx.parameters.at(1) == L"1");
+
+       return L"202 LOG OK\r\n";
+}
+
 void set_describer(core::help_sink& sink, const core::help_repository& repo)
 {
        sink.short_description(L"Change the value of a channel variable.");
@@ -726,7 +755,7 @@ std::wstring set_command(command_context& ctx)
                        return L"202 SET MODE OK\r\n";
                }
 
-               CASPAR_THROW_EXCEPTION(invalid_argument() << msg_info(L"Invalid video mode"));
+               CASPAR_THROW_EXCEPTION(user_error() << msg_info(L"Invalid video mode"));
        }
        else if (name == L"CHANNEL_LAYOUT")
        {
@@ -738,10 +767,10 @@ std::wstring set_command(command_context& ctx)
                        return L"202 SET CHANNEL_LAYOUT OK\r\n";
                }
 
-               CASPAR_THROW_EXCEPTION(invalid_argument() << msg_info(L"Invalid audio channel layout"));
+               CASPAR_THROW_EXCEPTION(user_error() << msg_info(L"Invalid audio channel layout"));
        }
 
-       CASPAR_THROW_EXCEPTION(invalid_argument() << msg_info(L"Invalid channel variable"));
+       CASPAR_THROW_EXCEPTION(user_error() << msg_info(L"Invalid channel variable"));
 }
 
 void data_store_describer(core::help_sink& sink, const core::help_repository& repo)
@@ -852,9 +881,9 @@ std::wstring data_list_command(command_context& ctx)
                        if (!boost::iequals(itr->path().extension().wstring(), L".ftd"))
                                continue;
 
-                       auto relativePath = boost::filesystem::path(itr->path().wstring().substr(env::data_folder().size() - 1, itr->path().wstring().size()));
+                       auto relativePath = get_relative_without_extension(itr->path(), env::data_folder());
+                       auto str = relativePath.generic_wstring();
 
-                       auto str = relativePath.replace_extension(L"").generic_wstring();
                        if (str[0] == L'\\' || str[0] == L'/')
                                str = std::wstring(str.begin() + 1, str.end());
 
@@ -889,22 +918,11 @@ std::wstring data_remove_command(command_context& ctx)
        if (!boost::filesystem::remove(filename))
                CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(filename + L" could not be removed"));
 
-       return L"201 DATA REMOVE OK\r\n";
+       return L"202 DATA REMOVE OK\r\n";
 }
 
 // Template Graphics Commands
 
-int get_and_validate_layer(const std::wstring& layerstring) {
-       int length = layerstring.length();
-       for (int i = 0; i < length; ++i) {
-               if (!std::isdigit(layerstring[i])) {
-                       CASPAR_THROW_EXCEPTION(invalid_argument() << msg_info(layerstring + L" is not a layer"));
-               }
-       }
-
-       return boost::lexical_cast<int>(layerstring);
-}
-
 void cg_add_describer(core::help_sink& sink, const core::help_repository& repo)
 {
        sink.short_description(L"Prepare a template for displaying.");
@@ -920,7 +938,7 @@ std::wstring cg_add_command(command_context& ctx)
 {
        //CG 1 ADD 0 "template_folder/templatename" [STARTLABEL] 0/1 [DATA]
 
-       int layer = get_and_validate_layer(ctx.parameters.at(0));
+       int layer = boost::lexical_cast<int>(ctx.parameters.at(0));
        std::wstring label;             //_parameters[2]
        bool bDoStart = false;          //_parameters[2] alt. _parameters[3]
        unsigned int dataIndex = 3;
@@ -989,7 +1007,7 @@ void cg_play_describer(core::help_sink& sink, const core::help_repository& repo)
 
 std::wstring cg_play_command(command_context& ctx)
 {
-       int layer = get_and_validate_layer(ctx.parameters.at(0));
+       int layer = boost::lexical_cast<int>(ctx.parameters.at(0));
        ctx.cg_registry->get_proxy(spl::make_shared_ptr(ctx.channel.channel), ctx.layer_index(core::cg_proxy::DEFAULT_LAYER))->play(layer);
 
        return L"202 CG OK\r\n";
@@ -1000,7 +1018,7 @@ spl::shared_ptr<core::cg_proxy> get_expected_cg_proxy(command_context& ctx)
        auto proxy = ctx.cg_registry->get_proxy(spl::make_shared_ptr(ctx.channel.channel), ctx.layer_index(core::cg_proxy::DEFAULT_LAYER));
 
        if (proxy == cg_proxy::empty())
-               CASPAR_THROW_EXCEPTION(file_not_found() << msg_info(L"No CG proxy running on layer"));
+               CASPAR_THROW_EXCEPTION(expected_user_error() << msg_info(L"No CG proxy running on layer"));
 
        return proxy;
 }
@@ -1018,7 +1036,7 @@ void cg_stop_describer(core::help_sink& sink, const core::help_repository& repo)
 
 std::wstring cg_stop_command(command_context& ctx)
 {
-       int layer = get_and_validate_layer(ctx.parameters.at(0));
+       int layer = boost::lexical_cast<int>(ctx.parameters.at(0));
        get_expected_cg_proxy(ctx)->stop(layer, 0);
 
        return L"202 CG OK\r\n";
@@ -1037,7 +1055,7 @@ void cg_next_describer(core::help_sink& sink, const core::help_repository& repo)
 
 std::wstring cg_next_command(command_context& ctx)
 {
-       int layer = get_and_validate_layer(ctx.parameters.at(0));
+       int layer = boost::lexical_cast<int>(ctx.parameters.at(0));
        get_expected_cg_proxy(ctx)->next(layer);
 
        return L"202 CG OK\r\n";
@@ -1054,7 +1072,7 @@ void cg_remove_describer(core::help_sink& sink, const core::help_repository& rep
 
 std::wstring cg_remove_command(command_context& ctx)
 {
-       int layer = get_and_validate_layer(ctx.parameters.at(0));
+       int layer = boost::lexical_cast<int>(ctx.parameters.at(0));
        get_expected_cg_proxy(ctx)->remove(layer);
 
        return L"202 CG OK\r\n";
@@ -1085,7 +1103,7 @@ void cg_update_describer(core::help_sink& sink, const core::help_repository& rep
 
 std::wstring cg_update_command(command_context& ctx)
 {
-       int layer = get_and_validate_layer(ctx.parameters.at(0));
+       int layer = boost::lexical_cast<int>(ctx.parameters.at(0));
 
        std::wstring dataString = ctx.parameters.at(1);
        if (dataString.at(0) != L'<' && dataString.at(0) != L'{')
@@ -1115,7 +1133,7 @@ std::wstring cg_invoke_command(command_context& ctx)
 {
        std::wstringstream replyString;
        replyString << L"201 CG OK\r\n";
-       int layer = get_and_validate_layer(ctx.parameters.at(0));
+       int layer = boost::lexical_cast<int>(ctx.parameters.at(0));
        auto result = get_expected_cg_proxy(ctx)->invoke(layer, ctx.parameters.at(1));
        replyString << result << L"\r\n";
 
@@ -1142,7 +1160,7 @@ std::wstring cg_info_command(command_context& ctx)
        }
        else
        {
-               int layer = get_and_validate_layer(ctx.parameters.at(0));
+               int layer = boost::lexical_cast<int>(ctx.parameters.at(0));
                auto desc = get_expected_cg_proxy(ctx)->description(layer);
 
                replyString << desc << L"\r\n";
@@ -1237,7 +1255,7 @@ std::wstring mixer_keyer_command(command_context& ctx)
        {
                transform.image_transform.is_key = value;
                return transform;
-       }, 0, L"linear"));
+       }, 0, tweener(L"linear")));
        transforms.apply();
 
        return L"202 MIXER OK\r\n";
@@ -1328,7 +1346,7 @@ std::wstring mixer_blend_command(command_context& ctx)
        {
                transform.image_transform.blend_mode = value;
                return transform;
-       }, 0, L"linear"));
+       }, 0, tweener(L"linear")));
        transforms.apply();
 
        return L"202 MIXER OK\r\n";
@@ -1837,7 +1855,7 @@ std::wstring mixer_mipmap_command(command_context& ctx)
        {
                transform.image_transform.use_mipmap = value;
                return transform;
-       }, 0, L"linear"));
+       }, 0, tweener(L"linear")));
        transforms.apply();
 
        return L"202 MIXER OK\r\n";
@@ -2036,7 +2054,7 @@ std::wstring channel_grid_command(command_context& ctx)
                if (channel.channel != self.channel)
                {
                        core::diagnostics::call_context::for_thread().layer = index;
-                       auto producer = ctx.producer_registry->create_producer(get_producer_dependencies(channel.channel, ctx), L"route://" + boost::lexical_cast<std::wstring>(channel.channel->index()));
+                       auto producer = ctx.producer_registry->create_producer(get_producer_dependencies(self.channel, ctx), L"route://" + boost::lexical_cast<std::wstring>(channel.channel->index()));
                        self.channel->stage().load(index, producer, false);
                        self.channel->stage().play(index);
                        index++;
@@ -2082,9 +2100,9 @@ std::wstring thumbnail_list_command(command_context& ctx)
                        if (!boost::iequals(itr->path().extension().wstring(), L".png"))
                                continue;
 
-                       auto relativePath = boost::filesystem::path(itr->path().wstring().substr(env::thumbnails_folder().size() - 1, itr->path().wstring().size()));
+                       auto relativePath = get_relative_without_extension(itr->path(), env::thumbnails_folder());
+                       auto str = relativePath.generic_wstring();
 
-                       auto str = relativePath.replace_extension(L"").generic_wstring();
                        if (str[0] == '\\' || str[0] == '/')
                                str = std::wstring(str.begin() + 1, str.end());
 
@@ -2152,7 +2170,7 @@ std::wstring thumbnail_generate_command(command_context& ctx)
                return L"202 THUMBNAIL GENERATE OK\r\n";
        }
        else
-               CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(L"Thumbnail generation turned off"));
+               CASPAR_THROW_EXCEPTION(not_supported() << msg_info(L"Thumbnail generation turned off"));
 }
 
 void thumbnail_generateall_describer(core::help_sink& sink, const core::help_repository& repo)
@@ -2170,7 +2188,7 @@ std::wstring thumbnail_generateall_command(command_context& ctx)
                return L"202 THUMBNAIL GENERATE_ALL OK\r\n";
        }
        else
-               CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info(L"Thumbnail generation turned off"));
+               CASPAR_THROW_EXCEPTION(not_supported() << msg_info(L"Thumbnail generation turned off"));
 }
 
 // Query Commands
@@ -2221,6 +2239,29 @@ std::wstring cls_command(command_context& ctx)
        return boost::to_upper_copy(replyString.str());
 }
 
+void fls_describer(core::help_sink& sink, const core::help_repository& repo)
+{
+       sink.short_description(L"List all fonts.");
+       sink.syntax(L"FLS");
+       sink.para()
+               ->text(L"Lists all font files in the ")->code(L"fonts")->text(L" folder. Use the command ")
+               ->see(L"INFO PATHS")->text(L" to get the path to the ")->code(L"fonts")->text(L" folder.");
+       sink.para()->text(L"Columns in order from left to right are: Font name and font path.");
+}
+
+std::wstring fls_command(command_context& ctx)
+{
+       std::wstringstream replyString;
+       replyString << L"200 FLS OK\r\n";
+
+       for (auto& font : core::text::list_fonts())
+               replyString << L"\"" << font.first << L"\" \"" << get_relative(font.second, env::font_folder()).wstring() << L"\"\r\n";
+
+       replyString << L"\r\n";
+
+       return replyString.str();
+}
+
 void tls_describer(core::help_sink& sink, const core::help_repository& repo)
 {
        sink.short_description(L"List all templates.");
@@ -2259,6 +2300,14 @@ void version_describer(core::help_sink& sink, const core::help_repository& repo)
                L">> VERSION FLASH\n"
                L"<< 201 VERSION OK\n"
                L"<< 11.8.800.94");
+       sink.example(
+               L">> VERSION TEMPLATEHOST\n"
+               L"<< 201 VERSION OK\n"
+               L"<< unknown");
+       sink.example(
+               L">> VERSION CEF\n"
+               L"<< 201 VERSION OK\n"
+               L"<< 3.1750.1805");
 }
 
 std::wstring version_command(command_context& ctx)
@@ -2501,6 +2550,50 @@ std::wstring diag_command(command_context& ctx)
        return L"202 DIAG OK\r\n";
 }
 
+void gl_info_describer(core::help_sink& sink, const core::help_repository& repo)
+{
+       sink.short_description(L"Get information about the allocated and pooled OpenGL resources.");
+       sink.syntax(L"GL INFO");
+       sink.para()->text(L"Retrieves information about the allocated and pooled OpenGL resources.");
+}
+
+std::wstring gl_info_command(command_context& ctx)
+{
+       auto device = ctx.ogl_device;
+
+       if (!device)
+               CASPAR_THROW_EXCEPTION(not_supported() << msg_info("GL command only supported with OpenGL accelerator."));
+
+       std::wstringstream result;
+       result << L"201 GL INFO OK\r\n";
+
+       boost::property_tree::xml_writer_settings<std::wstring> w(' ', 3);
+       auto info = device->info();
+       boost::property_tree::write_xml(result, info, w);
+       result << L"\r\n";
+
+       return result.str();
+}
+
+void gl_gc_describer(core::help_sink& sink, const core::help_repository& repo)
+{
+       sink.short_description(L"Release pooled OpenGL resources.");
+       sink.syntax(L"GL GC");
+       sink.para()->text(L"Releases all the pooled OpenGL resources. ")->strong(L"May cause a pause on all video channels.");
+}
+
+std::wstring gl_gc_command(command_context& ctx)
+{
+       auto device = ctx.ogl_device;
+
+       if (!device)
+               CASPAR_THROW_EXCEPTION(not_supported() << msg_info("GL command only supported with OpenGL accelerator."));
+
+       device->gc().wait();
+
+       return L"202 GL GC OK\r\n";
+}
+
 static const int WIDTH = 80;
 
 struct max_width_sink : public core::help_sink
@@ -2547,6 +2640,7 @@ struct simple_paragraph_builder : core::paragraph_builder
                return shared_from_this();
        }
        spl::shared_ptr<paragraph_builder> code(std::wstring txt) override { return text(std::move(txt)); }
+       spl::shared_ptr<paragraph_builder> strong(std::wstring item) override { return text(L"*" + std::move(item) + L"*"); }
        spl::shared_ptr<paragraph_builder> see(std::wstring item) override { return text(std::move(item)); }
        spl::shared_ptr<paragraph_builder> url(std::wstring url, std::wstring name)  override { return text(std::move(url)); }
 };
@@ -2794,6 +2888,7 @@ void register_commands(amcp_command_repository& repo)
        repo.register_channel_command(  L"Basic Commands",              L"REMOVE",                                              remove_describer,                                       remove_command,                                 0);
        repo.register_channel_command(  L"Basic Commands",              L"PRINT",                                               print_describer,                                        print_command,                                  0);
        repo.register_command(                  L"Basic Commands",              L"LOG LEVEL",                                   log_level_describer,                            log_level_command,                              1);
+       repo.register_command(                  L"Basic Commands",              L"LOG CATEGORY",                                log_category_describer,                         log_category_command,                   2);
        repo.register_channel_command(  L"Basic Commands",              L"SET",                                                 set_describer,                                          set_command,                                    2);
        repo.register_command(                  L"Basic Commands",              L"LOCK",                                                lock_describer,                                         lock_command,                                   2);
 
@@ -2842,6 +2937,7 @@ void register_commands(amcp_command_repository& repo)
 
        repo.register_command(                  L"Query Commands",              L"CINF",                                                cinf_describer,                                         cinf_command,                                   1);
        repo.register_command(                  L"Query Commands",              L"CLS",                                                 cls_describer,                                          cls_command,                                    0);
+       repo.register_command(                  L"Query Commands",              L"FLS",                                                 fls_describer,                                          fls_command,                                    0);
        repo.register_command(                  L"Query Commands",              L"TLS",                                                 tls_describer,                                          tls_command,                                    0);
        repo.register_command(                  L"Query Commands",              L"VERSION",                                             version_describer,                                      version_command,                                0);
        repo.register_command(                  L"Query Commands",              L"INFO",                                                info_describer,                                         info_command,                                   0);
@@ -2855,6 +2951,8 @@ void register_commands(amcp_command_repository& repo)
        repo.register_command(                  L"Query Commands",              L"INFO THREADS",                                info_threads_describer,                         info_threads_command,                   0);
        repo.register_channel_command(  L"Query Commands",              L"INFO DELAY",                                  info_delay_describer,                           info_delay_command,                             0);
        repo.register_command(                  L"Query Commands",              L"DIAG",                                                diag_describer,                                         diag_command,                                   0);
+       repo.register_command(                  L"Query Commands",              L"GL INFO",                                             gl_info_describer,                                      gl_info_command,                                0);
+       repo.register_command(                  L"Query Commands",              L"GL GC",                                               gl_gc_describer,                                        gl_gc_command,                                  0);
        repo.register_command(                  L"Query Commands",              L"BYE",                                                 bye_describer,                                          bye_command,                                    0);
        repo.register_command(                  L"Query Commands",              L"KILL",                                                kill_describer,                                         kill_command,                                   0);
        repo.register_command(                  L"Query Commands",              L"RESTART",                                             restart_describer,                                      restart_command,                                0);