1 # -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
2 # ex: ts=8 sw=8 noet filetype=sh
4 # bjavaloader(1) completion by Ryan Li <ryan@ryanium.com>
15 prev=${COMP_WORDS[COMP_CWORD-1]}
19 for (( i = 0; i < COMP_CWORD; ++i )); do
20 case ${COMP_WORDS[$i]} in
21 @(dir|deviceinfo|load|wipe|save|erase| \
22 eventlog|cleareventlog|logstacktraces|screenshot|settime))
28 if [[ "$cur" == -* ]]; then
29 if [[ $cmd -eq 0 ]]; then
30 COMPREPLY=( $( compgen -W '-h -p -P -v' -- "$cur" ) )
34 COMPREPLY=( $( compgen -W '-s' -- "$cur" ) )
38 COMPREPLY=( $( compgen -W '-a -i' -- "$cur" ) )
42 COMPREPLY=( $( compgen -W '-f' -- "$cur" ) )
49 elif [[ $cmd -eq 0 ]]; then
50 COMPREPLY=( $( compgen -W 'dir deviceinfo \
51 load wipe save erase eventlog cleareventlog \
52 logstacktraces screenshot settime' -- "$cur" ) )
56 COMPREPLY=( $( compgen -W \
57 '$( bidentify 2>&- | sed -e "s/,.*$//" )' \
73 complete -F _bjavaloader bjavaloader