From a2b542f68714b870c262d14fd2455a1d10d557e3 Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Mon, 11 May 2020 23:17:10 +0900 Subject: [PATCH] Update 'perf test' completion --- src/_perf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/_perf b/src/_perf index 37c9eb2..434f406 100644 --- a/src/_perf +++ b/src/_perf @@ -38,6 +38,12 @@ _perf_c2c_coalesce() { _values -s ',' 'columns' $columns } +_perf_test_list() { + # TODO show test detail + local -a test_list=(${(@f)$(perf test list 2>&1 | sed -n -e 's/^ *\([^ ]*\): \(.*\)$/\1/p')}) + _values -s ',' 'test' $test_list +} + _perf() { local context curcontext="$curcontext" state line typeset -A opt_args @@ -302,6 +308,9 @@ _perf() { (test) _arguments \ '(-v --verbose)'{-v,--verbose}'[be more verbose]' \ + '(-s --skip)'{-s,--skip=}'[Tests to skip]:tests:_perf_test_list' \ + '(-F --dont-fork)'{-F,--dont-fork}'[do not fork child for each test]' \ + '1:command:((list))' \ && ret=0 ;; (timechart)