diff options
author | Hugues Hiegel <hugues.hiegel@anevia.com> | 2017-06-30 14:33:59 +0200 |
---|---|---|
committer | Hugues Hiegel <hugues.hiegel@anevia.com> | 2017-06-30 14:33:59 +0200 |
commit | 2f9cb6f18255cc7243a6ed2a0c452c1aee936fe1 (patch) | |
tree | 34a671bed74a02e5ebf00bd8150a3e1407f6dd7c /01_Internal.zsh | |
parent | 549c79795996df04500fdd203b3722ba488b99fa (diff) |
Modifs en vracanevia
Diffstat (limited to '01_Internal.zsh')
-rw-r--r-- | 01_Internal.zsh | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/01_Internal.zsh b/01_Internal.zsh index 20c02c3..50cc1b2 100644 --- a/01_Internal.zsh +++ b/01_Internal.zsh @@ -372,7 +372,7 @@ __get_git_tracking_status() { svn_rev=$(git svn find-rev $svn_track) # eval $( git svn info | awk '/^URL: / { print "svn_url="$2 } # /^Repository UUID: / { print "svn_repo="$3 } - # /^Last Changed Rev: / { print "svn_rev="$2 } + # /^Last Changed Rev: / { print "svn_rev="$4 } # ') # svn_track=$(git log --grep="git-svn-id: $svn_url@$svn_rev $svn_repo" --pretty=%h -1) @@ -631,7 +631,7 @@ __hbar() __debug -n " Horizontal bar..." _COLUMNS_OLD=$COLUMNS HBAR_COLOR=$C_$_prompt_colors[bar]$_C$T_ - HBAR=$T_${${(l:${COLUMNS}::q:)}//q/$_tq_}$_T + HBAR=$T_${${(l:${COLUMNS}::-:)}//-/$_tq_}$_T __debug fi } @@ -686,15 +686,16 @@ zle -N _rehash _process_tree() { FULLCMD=0 - if [ "$1" = "-f" ] - then - FULLCMD=1 - shift - fi + SHOWPIDS=0 + case $1 in + -f) FULLCMD=1 ; shift ;; + -p) SHOWPIDS=1 ; shift ;; + *) ;; + esac for leaf in ${@:-$$} do - ps -wweo pid,ppid,command | awk -v fullcmd=$FULLCMD -v leaf="$leaf" \ + ps -wweo pid,ppid,command | awk -v fullcmd=$FULLCMD -v showpids=$SHOWPIDS -v leaf="$leaf" \ '{ parent[$1]=$2 ; command[$1]=$3 ; @@ -706,8 +707,9 @@ _process_tree() } function print_ancestry(pid) { - if (pid != 1) { print_ancestry(parent[pid]) ; printf " :: " } - printf command[pid]; + if (pid != 1) { print_ancestry(parent[pid]) ; if (!showpids) { printf " :: " } else { printf " " } } + if (showpids) { printf pid } + else { printf command[pid] } }; END { print_ancestry(leaf) |