-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
_kdv
44 lines (37 loc) · 1.39 KB
/
_kdv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#compdef kdv
# -----------------------------------------------------------------------------
# Copyright (c) 2017, Jonathan Levin (@Morpheus______ / http://newosxbook.com)
# All rights reserved.
# -----------------------------------------------------------------------------
#
# kdv - KDebug Unleashed for OS X/iOS
# http://newosxbook.com/tools/kdv.html
#
# version: 0.2
#
# -----------------------------------------------------------------------------
#
# Usage: ./kdv [_pid_|all]
# Where: _pid_ : optional PID to trace (all threads will be traced). Set to 0 for kernel_task :-)
# all : Trace ALL pids (TONS of output!)
#
# This is J's kdebugview version 0.2. Based on Apple's system_cmd's fs_usage(1), sc_usage(1), and trace(1).
# Get the latest version (+ source) at http://NewOSXBook.com/tools/kdv.html
# Comments/Feature Requests always welcome at http://NewOSXBook.com/forum/#
#
# -----------------------------------------------------------------------------
function _kdv() {
local curcontext=$curcontext context state line ret=1
typeset -A opt_args
local -a commands
commands=(
'all:Trace ALL pids (TONS of output!)'
)
_describe -t commands 'command' commands
_message 'optional PID to trace (all threads will be traced). Set to 0 for kernel_task :-)'
_arguments -C \
"*: :{_alternative 'processes:: _pids' 'jobs:: _jobs -t'}" \
&& ret=0
return ret
}
_kdv "$@"