Restore autocompletion working!

This commit is contained in:
Your Name
2025-04-26 00:11:23 +12:00
parent fa7236b4f5
commit 8e0683c997
6 changed files with 71 additions and 0 deletions

View File

@ -12,6 +12,7 @@
#include <string>
#include <vector>
#include <iomanip>
namespace dropshell {
void print_help() {
@ -163,6 +164,19 @@ int main(int argc, char* argv[]) {
return 0;
}
if (cmd == "autocomplete_list_backups") {
if (argc < 4) {
std::cerr << "Error: autocomplete_list_backups requires a server name and service name" << std::endl;
return 1;
}
if (cfg->is_config_set()) {
auto backups = dropshell::list_backups(argv[2], argv[3]);
for (const auto& backup : backups)
std::cout << backup << std::endl;
}
return 0;
}
// ------------------------------------------------------------
// from here we require the config file to be loaded.
if (!cfg->is_config_set()) {