This commit is contained in:
Your Name
2025-04-28 21:12:02 +12:00
parent 1d6986cda0
commit 76efe77e85
10 changed files with 140 additions and 141 deletions

View File

@ -11,12 +11,6 @@
void dropshell::autocomplete(const std::vector<std::string> &args)
{
auto cfg = dropshell::get_global_config();
// std::cerr << "[ "<<args.size()<<" ] : ";
// for (const auto& arg : args)
// std::cerr << arg << " ";
// std::cerr << std::endl;
if (args.size() < 3) // dropshell autocomplete ???
{
autocomplete_list_commands();
@ -32,7 +26,7 @@ void dropshell::autocomplete(const std::vector<std::string> &args)
if (std::find(std::begin(noargcmds), std::end(noargcmds), cmd) != std::end(noargcmds))
return;
if (!cfg->is_config_set())
if (!dropshell::gConfig().is_config_set())
return; // can't help without working config.
if (args.size()==3) // we have the command but nothing else. dropshell autocomplete command <server>
@ -89,7 +83,7 @@ void dropshell::autocomplete_list_commands()
commands.merge(std::set<std::string>{
"help","init" // these are always available.
});
if (dropshell::get_global_config()->is_config_set())
if (dropshell::gConfig().is_config_set())
commands.merge(std::set<std::string>{
"server","templates","create-service","create-template","create-server","edit","ssh",
"list" // only if we have a config.