#include "sandbox.h" #include "utils.h" #include "command.h" #include #include #include #include int main(int argc, char* argv[]) { if (argc < 2) { show_help(); return 0; } Command* command = find_command(argv[1]); if (command == NULL) { log_message(LOG_ERROR, "Unknown command '%s'.", argv[1]); return 1; } int consumed = 2; switch (command->id) { case CMD_HELP: return cmd_help(argc - consumed, argv + consumed); case CMD_VERSION: return cmd_version(argc - consumed, argv + consumed); default: log_message(LOG_ERROR, "Command '%s' is not implemented.", command->name); break; } return 0; }