72 lines
1.6 KiB
Bash
72 lines
1.6 KiB
Bash
#!/bin/sh
|
|
|
|
#
|
|
# It is assumed that the following variables are set.
|
|
#
|
|
#_ROKU_SHELL_DIR=$(dirname $(realpath $(readlink $0)))
|
|
#_ROKU_SHELL=$_ROKU_SHELL_DIR/_roku.sh
|
|
|
|
###############################################################################
|
|
#
|
|
# Build Completion
|
|
#
|
|
__roku_completion_contains()
|
|
{
|
|
# Platforms
|
|
for WORD in "$@"; do
|
|
if [[ "${COMP_WORDS[*]}" =~ "$WORD" ]]; then
|
|
return 1
|
|
fi
|
|
done
|
|
return 0
|
|
}
|
|
|
|
__roku_completion_add_if()
|
|
{
|
|
__roku_completion_contains "$@"
|
|
if [[ $? == 0 ]]; then
|
|
CANDIDATES+=" $@"
|
|
fi
|
|
}
|
|
|
|
# complete -F __build_completion roku
|
|
# __build_completion()
|
|
# {
|
|
# local CANDIDATES="help clobber tests addon-checksums"
|
|
|
|
# # Docker
|
|
# __build_completion_add_if docker make
|
|
|
|
# # Build hosts
|
|
# __build_completion_add_if icecc local
|
|
|
|
# # Port dir
|
|
# __build_completion_add_if port-only
|
|
|
|
# # Platforms
|
|
# __build_completion_add_if native marlin bailey loggan lockhart porting-kit streambar stb
|
|
|
|
# COMPREPLY=($(compgen -W "$CANDIDATES" "${COMP_WORDS[${COMP_CWORD}]}"))
|
|
# }
|
|
|
|
complete -F __roku_completion roku
|
|
__roku_completion()
|
|
{
|
|
local CANDIDATES="device get log flash gdb gdb_attach telnet reboot audcap san_update sideload token_install"
|
|
|
|
# # Docker
|
|
# __build_completion_add_if docker make
|
|
|
|
# # Build hosts
|
|
# __build_completion_add_if icecc local
|
|
|
|
# # Port dir
|
|
# __build_completion_add_if port-only
|
|
|
|
# # Platforms
|
|
# __build_completion_add_if native marlin bailey loggan lockhart porting-kit streambar stb
|
|
|
|
COMPREPLY=($(compgen -W "$CANDIDATES" "${COMP_WORDS[${COMP_CWORD}]}"))
|
|
}
|
|
|