Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # adding music
- _mcp_add () {
- #local IFS=$'\n'
- while IFS= read -r -u3 -d $'\0' completion; do
- COMPREPLY+=( "$completion" )
- done 3< <(mcp complete "$(eval echo "$cur")" | __escape_strings_stdin)
- compopt -o nospace
- }
- # Main completion function
- _mcp () {
- local c=1 word command
- local IFS=$' \t\n'
- cur="${COMP_WORDS[COMP_CWORD]}"
- if test $COMP_CWORD = 1 ; then
- COMPREPLY=( $(compgen -W "add play toggle pause stop next prev playlist current status volume clear skip delete seek" -- "$cur") )
- if [[ ${#COMPREPLY[@]} = 0 ]] ; then
- _mcp_add
- fi
- else
- command="${COMP_WORDS[1]}"
- # Complete command arguments
- case "$command" in
- add|a) _mcp_add ;;
- play|p) _mcp_add ;;
- *) ;;
- esac
- fi
- }
- complete -F _mcp mcp
Advertisement
Add Comment
Please, Sign In to add comment