:-'Generic Commit'
This commit is contained in:
@ -100,7 +100,9 @@ void DropshellScriptManager::addAutocomplete(const std::string& toolName) {
|
||||
std::string funcDef;
|
||||
funcDef += blockStart + "\n";
|
||||
funcDef += funcName + "() {\n";
|
||||
funcDef += " COMPREPLY=($(" + toolName + " autocomplete \"${COMP_WORDS[@]:1}\"))\n";
|
||||
funcDef += " local cur=\"${COMP_WORDS[COMP_CWORD]}\"\n";
|
||||
funcDef += " mapfile -t completions < <(" + toolName + " autocomplete \"${COMP_WORDS[@]:1:${COMP_CWORD}-1}\")\n";
|
||||
funcDef += " mapfile -t COMPREPLY < <(compgen -W \"${completions[*]}\" -- \"$cur\")\n";
|
||||
funcDef += "}\n";
|
||||
funcDef += blockEnd + "\n";
|
||||
std::string completeLine = "complete -F " + funcName + " " + toolName + " # dropshell-autocomplete:" + toolName;
|
||||
|
Reference in New Issue
Block a user