zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: zsh-workers@zsh.org
Subject: PATCH 7/8:  _adb: Handle dumpsys SurfaceFlinger arguments
Date: Sun,  3 Apr 2022 17:50:18 +0200	[thread overview]
Message-ID: <20220403155019.24197-7-mikachu@gmail.com> (raw)
In-Reply-To: <20220403155019.24197-1-mikachu@gmail.com>

From: Mikael Magnusson <mikael.magnusson@sony.com>

---
 Completion/Unix/Command/_adb | 54 +++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 51 insertions(+), 3 deletions(-)

diff --git a/Completion/Unix/Command/_adb b/Completion/Unix/Command/_adb
index b31b84c892..5e7fbf8d0f 100644
--- a/Completion/Unix/Command/_adb
+++ b/Completion/Unix/Command/_adb
@@ -336,9 +336,57 @@ _adb_cmd_handler () {
 
 (( $+functions[_adb_dumpsys_handler] )) ||
 _adb_dumpsys_handler () {
-  local -a services
-  services=(${${${(f)"$(adb ${ADB_DEVICE_SPECIFICATION} exec-out dumpsys -l)"}[2,-1]}##[[:space:]]##})
-  _wanted dumpsys expl 'dumpsys service' compadd ${services%$'\r'}
+  if [[ $CURRENT -eq 3 ]]; then
+    local -a services
+    services=(${${${(f)"$(adb ${ADB_DEVICE_SPECIFICATION} exec-out dumpsys -l)"}[2,-1]}##[[:space:]]##})
+    _wanted dumpsys expl 'dumpsys service' compadd - ${services%$'\r'}
+  elif [[ $CURRENT -ge 4 && $words[3] == SurfaceFlinger ]]; then
+    (( CURRENT -= 2 ))
+    shift 2 words
+    typeset -A opt_args
+    local context state state_descr line
+    _arguments -R \
+      '--file[start/stop continuous dumpsys to file]' \
+      '--no-limit[disable wrapping around continuous dumpsys at ~20MB]' \
+      '--full-dump[set fullDump = true]' \
+      '--allocated_buffers[show allocated buffers dump]' \
+      '--display-id[show display id dump]' \
+      '--dispsync[show dispsync dump]' \
+      '--edid[raw edid dump for specified hwc display (binary output)]:*:hwc display:->hwcdisplay' \
+      '--latency[show latency stats]:*:layer:->layer' \
+      '--latency-clear[clear latency stats]:*:layer:->layer' \
+      '--list[list all layers]' \
+      '--planner[pass planner dump arguments]:*:planner arguments:->planner' \
+      '--static-screen[show static screen stats]' \
+      '--timestats[pass time stats arguments]:*:timestats arguments:->timestats' \
+      '--vsync[show vsync dump]' \
+      '--wide-color[show wide color info]' \
+      '--frametimeline[pass frametimeline arguments]:*:frametimeline arguments:->frametimeline' \
+      '--mini[show mini dump]'
+    if [[ $? == 300 ]]; then
+      case $state in
+        layer)
+          typeset -a layers
+          layers=(${${(f)"$(adb ${ADB_DEVICE_SPECIFICATION} exec-out dumpsys SurfaceFlinger --list)"}[2,-1]})
+          _wanted dumpsys expl 'layers' compadd - ${layers%$'\r'}
+          ;;
+        planner)
+          _arguments \
+            {--compare,-c}'[compare predictions of two hashes]:left: :right: :' \
+            {--describe,-d}'[describe hash]:hash: :' \
+            {--help,-h}'[help]' \
+            {--similar,-s}'[show similar stacks matching given plan]:plan: :' \
+            {--layers,-l}'[show current layers]'
+          ;;
+        timestats)
+          _arguments -disable -enable -clear -dump -maxlayers'[only with -dump]:int:'
+          ;;
+        frametimeline)
+          _arguments -jank -all
+          ;;
+      esac
+    fi
+  fi
 }
 
 (( $+functions[_adb_startstop] )) ||
-- 
2.15.1



  parent reply	other threads:[~2022-04-03 16:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-03 15:50 PATCH 1/8: _adb: handle exec-out like shell Mikael Magnusson
2022-04-03 15:50 ` PATCH 2/8: _adb: Add dumpsys and cmd completion Mikael Magnusson
2022-04-03 15:50 ` PATCH 3/8: _adb: Fix device serial completion for hostname:port syntax Mikael Magnusson
2022-04-03 15:50 ` PATCH 4/8: _adb: Complete services for start/stop Mikael Magnusson
2022-04-03 15:50 ` PATCH 5/8: _adb: use $CURRENT instead of $#words Mikael Magnusson
2022-04-03 15:50 ` PATCH 6/8: _adb: Parse device spec correctly Mikael Magnusson
2022-04-03 15:50 ` Mikael Magnusson [this message]
2022-04-03 15:50 ` PATCH 8/8: _adb: also replace model names, since device names aren't sent on wifi listing Mikael Magnusson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220403155019.24197-7-mikachu@gmail.com \
    --to=mikachu@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).