Allow hash of current directory
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user