Skip to content

Instantly share code, notes, and snippets.

@akimasa
Last active September 15, 2018 09:56
Show Gist options
  • Save akimasa/156f306dd9076e24fc01 to your computer and use it in GitHub Desktop.
Save akimasa/156f306dd9076e24fc01 to your computer and use it in GitHub Desktop.
Bash completion for irsend (experimental)
ircomp1 (){
local list1
list1=$(irsend list '' '' 2> >(sed 's/irsend: //g'))
case "$COMP_CWORD" in
1 )
COMPREPLY=( $(compgen -W "send_once send_start send_stop list set_transmitters simulate" $2) );;
2 )
COMPREPLY=( $(compgen -W "$list1" $2) );;
3 )
COMPREPLY=( $(compgen -W "$(irsend list "$3" '' 2> >(cut -f1 -d " ") | cut -f2 -d ' ')" $2) );;
esac
}
complete -F ircomp1 irsend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment