dot

packages and services management
Log | Files | Refs | README

commit 4a526ddad7cc663849030388635e3f5cde429258
parent d4906a42dc0f173532a5cc522f80f6c4ea54d21c
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sat, 15 Dec 2018 17:27:22 +0100

bin/*tree: more modular commands

Diffstat:
Mbin/ltree | 8++------
Mbin/pt | 3++-
Mbin/ptree | 1+
Mbin/service-status | 1+
4 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/bin/ltree b/bin/ltree @@ -1,6 +1,6 @@ #!/usr/bin/awk -f -# Usage: ltree [-h html-prefix] path... +# Usage: ltree [html-prefix] path... # Use find(1) walk the entire tree and then call ls -ld with all the # result (ls sort the list itself) with the paths displayed as a tree: @@ -20,11 +20,7 @@ BEGIN { VOID = " "; FS = "\t"; - if (ARGV[1] == "-h") { - HTML = ARGV[2]; - for (i = 1; i < ARGC - 2; ++i) ARGV[i] = ARGV[i + 2]; - ARGC -= 2; - } + HTML = ARGV[1]; ARGC = 0; } # Get a recursive list of all list into list[] with list[i:j] diff --git a/bin/pt b/bin/pt @@ -1,5 +1,6 @@ #!/usr/bin/env execlineb +elgetpositionals pipeline { ps ax -o ppid,user,pid,stat,comm,args } -pipeline { ptree } +pipeline { ptree -- $@ } less -S diff --git a/bin/ptree b/bin/ptree @@ -24,6 +24,7 @@ BEGIN { VOID = " "; if (ARGC == 1) PID = 1; else PID = ARGV[1]; + ARGC = 0; } # pstree implementation in awk diff --git a/bin/service-status b/bin/service-status @@ -17,6 +17,7 @@ if { printf "\n" } if { backtick -n x { s6-svstat -o pid /run/s6/${sv},x } importas x x + pipeline { ps -ax -o ppid,user,pid,stat,comm,args } ptree -- ${x} } if { printf "\n" }