Allow hash of current directory

This commit is contained in:
Your Name
2025-05-01 19:41:29 +12:00
parent 189a7c3ef1
commit 198ddd7782
3 changed files with 30 additions and 3 deletions

View File

@ -22,6 +22,15 @@ void dropshell::autocomplete(const std::vector<std::string> &args)
// std::cout<<" cmd = ["<<cmd<<"]"<<std::endl;
if (cmd=="hash")
{ // output files and folders in the current directory, one per line.
std::filesystem::directory_iterator dir_iter(std::filesystem::current_path());
for (const auto& entry : dir_iter)
std::cout << entry.path().filename().string() << std::endl;
return;
}
std::string noargcmds[] = {"templates","autocomplete_list_servers","autocomplete_list_services","autocomplete_list_commands"};
if (std::find(std::begin(noargcmds), std::end(noargcmds), cmd) != std::end(noargcmds))
return;