Last active
September 15, 2018 09:56
-
-
Save akimasa/156f306dd9076e24fc01 to your computer and use it in GitHub Desktop.
Bash completion for irsend (experimental)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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