dropshell/source/src/dropshell-completion.bash
Your Name f7294e01e4
Some checks failed
Dropshell Test / Build_and_Test (push) Failing after 2m40s
:-'Generic Commit'
2025-05-28 20:40:24 +12:00

16 lines
520 B
Bash
Executable File

#!/bin/bash
_dropshell_completions() {
local cur
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
# call dropshell to get the list of possiblities for the current argument. Supply all previous arguments.
mapfile -t completions < <(dropshell autocomplete "${COMP_WORDS[@]:1:${COMP_CWORD}-1}")
mapfile -t COMPREPLY < <(compgen -W "${completions[*]}" -- "$cur")
return 0
}
# Register the completion function
complete -F _dropshell_completions dropshell
complete -F _dropshell_completions ds