#pragma once #include typedef struct { const char* name; const char* args; const char* description; } Command; Command COMMANDS[] = { {"help", "[command]", "Shows help for all or a specific command."}, {"version", NULL, "Shows the version of the program."}, {NULL, NULL, NULL}, {"add-entry", " [--root|-r ] [--backing|-b ]", "Adds a new entry to the pool"}, {"remove-entry", "", "Removes an entry from the pool"}, {"list-entries", NULL, "Lists all entries in the pool"}, {"clear-entries", NULL, "Clears all entries from the pool"}, {NULL, NULL, NULL}, {"add-backing", "", "Adds a backing disk to the pool from the given entry"}, {"remove-backing", "", "Removes a backing disk from the pool"}, {"list-backings", "[--tree|-t]", "Lists all backing disks in the pool"}, {"clear-backings", NULL, "Clears all backing disks from the pool"}, {NULL, NULL, NULL}, {"start", " [--no-pci] [--vnc ] [--iso ]", "Starts the sandbox with the given entry"}, {"power", NULL, "Sends a power signal to the sandbox"}, {"stop", "[--force|-f] [--timeout|-t ]", "Stops the sandbox"}, {"status", NULL, "Shows the status of the sandbox"}, }; int main(int argc, char* argv[]); /// @brief Finds the best matching command for the given command name. /// @param name The name of the command to find. /// @return The best matching command or NULL if no or multiple matches were found. No need to free the result. Command* find_command(const char* name);