-#ifndef COMMON_COMMANDS_ALL_H
-#define COMMON_COMMANDS_ALL_H
+#pragma once
+
+#include "command.qh"
+REGISTRY(GENERIC_COMMANDS, BITS(7))
+#define GENERIC_COMMANDS_from(i) _GENERIC_COMMANDS_from(i, NULL)
+REGISTER_REGISTRY(GENERIC_COMMANDS)
+REGISTRY_SORT(GENERIC_COMMANDS)
+
+#define GENERIC_COMMAND(id, description) \
+ CLASS(genericcommand_##id, Command) \
+ ATTRIB(genericcommand_##id, m_name, string, #id); \
+ ATTRIB(genericcommand_##id, m_description, string, description); \
+ ENDCLASS(genericcommand_##id) \
+ REGISTER(GENERIC_COMMANDS, CMD_G, id, m_id, NEW(genericcommand_##id)); \
+ METHOD(genericcommand_##id, m_invokecmd, void(genericcommand_##id this, int request, entity caller, int arguments, string command))
+
+STATIC_INIT(GENERIC_COMMANDS_aliases) {
+ FOREACH(GENERIC_COMMANDS, true, localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, "qc_cmd_svmenu")));
+}
#include "generic.qh"
#include "markup.qh"
#include "rpn.qh"
-
-#endif