- -p|--pid|-l|--log)
- _filedir
- ;;
- -c|--config)
- _filedir
- if [ -z $XDG_DATA_HOME ]; then
- local confnames=$(for x in $(ls -1 $HOME/.config/mpd_sima/*.cfg 2>/dev/null) ; do echo "${x##*//}"; done)
- else
- local confnames=$(for x in $(ls -1 $HOME/.config/mpd_sima/*.cfg $XDG_DATA_HOME/mpd_sima/*.cfg 2>/dev/null) ; do echo "${x##*//}"; done)
- fi
- COMPREPLY+=( $(compgen -W "${confnames}") )
- return 0
- ;;
- --host|-S)
- COMPREPLY=( $(compgen -A hostname ${cur}) )
- ;;
- *)
- ;;
- esac
-}
-complete -F _sima mpd_sima
-complete -F _sima mpd-sima
-
-_art_names_list() {
- local IFS=$'\n'
- compgen -W "${artists}" -- ${cur}
-}
-
-_simadb_cli() {
- local cur prev opts artists
- local IFS=$'\n'
- COMPREPLY=()
- _get_comp_words_by_ref cur prev
- opts="--add_similarity -a --remove_similarity --remove_artist \
- --purge_hist --view_artist --view_all \
- --bl_curr_trk --bl_curr_art --bl_curr_al --bl_art --remove_bl --view_bl \
- --dbfile -d \
- --host -S --port -P \
- --reciprocal -r --check_names -c \
- --version -h --help"
- opts=$(echo $opts | sed 's/ /\n/g')
-
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- fi
-
- case "${prev}" in
- --bl_curr*|--view_bl|--view_all|--purge_hist|--version|--help|-h)
- return 0
- ;;
- -d|--dbfile)