autocomplete

This commit is contained in:
Your Name
2025-04-26 08:34:02 +12:00
parent e58c44b172
commit 9e6281c846
8 changed files with 102 additions and 19 deletions

View File

@ -6,6 +6,7 @@
#include "utils/directories.hpp"
#include "templates.hpp"
#include "utils/utils.hpp"
#include "utils/readmes.hpp"
#include <boost/filesystem.hpp>
#include <iostream>
@ -41,7 +42,7 @@ void print_help() {
std::cout << "Creation commands: (apply to the first local config directory)"<<std::endl;
std::cout << " create-template TEMPLATE" << std::endl;
std::cout << " create-server SERVER" << std::endl;
std::cout << " create-service SERVER SERVICE" << std::endl;
std::cout << " create-service SERVER TEMPLATE SERVICE" << std::endl;
}
} // namespace dropshell
@ -92,6 +93,8 @@ int main(int argc, char* argv[]) {
return 1; // error already reported
cfg->save_config();
std::cout << "Config directory added: " << cfg->get_local_config_directories().back() << std::endl;
dropshell::create_readme_local_config_dir(cfg->get_local_config_directories().back());
if (cfg->get_local_config_directories().size() ==1)
std::cout << "DropShell is now initialised and you can add a server with 'dropshell create-server <server-name>'" << std::endl;
else
@ -237,11 +240,12 @@ int main(int argc, char* argv[]) {
}
if (cmd == "create-service") {
if (argc < 4) {
std::cerr << "Error: create-service requires a server name and service name" << std::endl;
if (argc < 5) {
std::cerr << "Error: not enough arguments." << std::endl;
std::cerr << "dropshell create-service server template service" << std::endl;
return 1;
}
dropshell::create_service(argv[2], argv[3]);
dropshell::create_service(argv[2], argv[3], argv[4]);
return 0;
}