.dotfiles/.config/completionsrc

50 lines
998 B
Bash

#!/usr/bin/env bash
_dote_completions()
{
if [ "${#COMP_WORDS[@]}" == "1" ]; then
return
fi
COMPREPLY=()
while IFS='' read -r line
do
COMPREPLY+=("$line")
done < <(compgen -W "$(.e -l)" "${COMP_WORDS[1]}")
}
complete -F _dote_completions ".e"
_dott_completions()
{
if [ "${#COMP_WORDS[@]}" == "2" ]; then
COMPREPLY=()
while IFS='' read -r line
do
COMPREPLY+=("$line")
done < <(compgen -W "$(.t -l)" "${COMP_WORDS[1]}")
fi
if [ "${#COMP_WORDS[@]}" == "3" ]; then
compgen -f "${COMP_WORDS[2]}"
fi
}
complete -F _dott_completions ".t"
#_autostart_manage_completions()
#{
# if [ "${#COMP_WORDS[@]}" == "2" ]; then
# return
# fi
#
# COMPREPLY=()
# while IFS='' read -r line
# do
# COMPREPLY+=("$line")
# done < <(compgen -W "$(autostart-manage list)" "${COMP_WORDS[1]}")
#}
#complete -F _autostart_manage_completions "autostart-manage"
for additional_completions in "$XDG_CONFIG_HOME/completionsrc.d/"*; do
# shellcheck disable=1090
. "$additional_completions"
done