#40 adb: Complete logcat -b option

This commit is contained in:
Julien Nicoulaud 2011-08-09 16:49:19 +02:00
parent 8953b21538
commit 3053880722
1 changed files with 11 additions and 2 deletions

13
_adb
View File

@ -96,12 +96,11 @@ _adb() {
&& ret=0 && ret=0
;; ;;
(logcat) (logcat)
# TODO Complete -b option
# TODO -n requires the -r option. # TODO -n requires the -r option.
# TODO -r requires the -f option. # TODO -r requires the -f option.
# Doc here: http://developer.android.com/guide/developing/tools/adb.html#logcat # Doc here: http://developer.android.com/guide/developing/tools/adb.html#logcat
_arguments \ _arguments \
'-b[loads an alternate log buffer for viewing, such as event or radio. The main buffer is used by default]:buffer' \ '-b[loads an alternate log buffer for viewing, such as event or radio. The main buffer is used by default]: :_adb_logcat_buffers' \
'-c[clears (flushes) the entire log and exits]' \ '-c[clears (flushes) the entire log and exits]' \
'-d[dumps the log to the screen and exits]' \ '-d[dumps the log to the screen and exits]' \
'-f[writes log message output to file. The default is stdout]: :_files' \ '-f[writes log message output to file. The default is stdout]: :_files' \
@ -297,4 +296,14 @@ _adb_logcat_output_formats() {
_describe -t log-formats 'log format' formats "$@" && ret=0 _describe -t log-formats 'log format' formats "$@" && ret=0
} }
(( $+functions[_adb_logcat_buffers] )) ||
_adb_logcat_buffers() {
local buffers; buffers=(
'main:view the main log buffer (default)'
'radio:view the buffer that contains radio/telephony related messages'
'events:view the buffer containing events-related messages'
)
_describe -t log-buffers 'log buffer' buffers "$@" && ret=0
}
_adb "$@" _adb "$@"