mitchellh / go-ps

Find, list, and inspect processes from Go (golang).
MIT License
1.46k stars 250 forks source link

Add Children(recursive) method #18

Open codeskyblue opened 7 years ago

codeskyblue commented 7 years ago

method refs: http://pythonhosted.org/psutil/#psutil.Process.children

A ─┐
   │
   ├─ B (child) ─┐
   │             └─ X (grandchild) ─┐
   │                                └─ Y (great grandchild)
   ├─ C (child)
   └─ D (child)

code

p.Children(false)
# return B, C, D
p.children(true)
# return B, X, Y, C, D

Can I make a pr?

fr3fou commented 3 years ago

How can I achieve this? I basically want to have a "hierarchy" of all processes