From 30538807220ac18ecc63be401dec3116abbbe98f Mon Sep 17 00:00:00 2001 From: Julien Nicoulaud Date: Tue, 9 Aug 2011 16:49:19 +0200 Subject: [PATCH] #40 adb: Complete logcat -b option --- _adb | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/_adb b/_adb index b6d3930..f7eda7f 100644 --- a/_adb +++ b/_adb @@ -96,12 +96,11 @@ _adb() { && ret=0 ;; (logcat) - # TODO Complete -b option # TODO -n requires the -r option. # TODO -r requires the -f option. # Doc here: http://developer.android.com/guide/developing/tools/adb.html#logcat _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]' \ '-d[dumps the log to the screen and exits]' \ '-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 } +(( $+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 "$@"