1 2 3 4 5 6 7
function _complete_nix { while IFS= read -r line; do COMPREPLY+=("$line") done < <(NIX_GET_COMPLETIONS=$COMP_CWORD "${COMP_WORDS[@]}") } complete -F _complete_nix nix