diff options
author | Hugues Hiegel <hugues.hiegel@anevia.com> | 2015-06-18 17:17:37 +0200 |
---|---|---|
committer | Hugues Hiegel <hugues.hiegel@anevia.com> | 2015-06-18 17:17:37 +0200 |
commit | 9d68fe5513508cde8f6277a23d72e3234cabe913 (patch) | |
tree | ee24a5f8c7c9a6481d5e2db9004f897cd68974f5 | |
parent | c6468b24491e4f1281221255e8bd669cb9c17014 (diff) |
[Funcs] _process_tree: Adds « -f » option for full command-line
-rw-r--r-- | 01_Internal.zsh | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/01_Internal.zsh b/01_Internal.zsh index 881ec07..9c8ebfd 100644 --- a/01_Internal.zsh +++ b/01_Internal.zsh @@ -683,12 +683,24 @@ zle -N _rehash # Process helper _process_tree() { + FULLCMD=0 + if [ "$1" = "-f" ] + then + FULLCMD=1 + shift + fi + for leaf in ${@:-$$} do - ps -eo pid,ppid,command | awk -v leaf="$leaf" \ + ps -wweo pid,ppid,command | awk -v fullcmd=$FULLCMD -v leaf="$leaf" \ '{ parent[$1]=$2 ; command[$1]=$3 ; + if (fullcmd && NF>=4) { + for (i=4; i<=NF; i++) { + command[$1]=command[$1]" "$i ; + } + } } function print_ancestry(pid) { |