arblang 0.1.24

Visualize and modify Unix pipelines: pipe a stream in, arb spawns a dynamic TUI
Documentation
1
2
3
4
5
6
7
8
9
10
11
# gh — pull-request states, open count, and recent titles
#   gh pr list --state all --json state,title,additions | arb -p gh
bars .state
source .state { in.json; field state; tally }
gauge .open -max 50
source .open { in.json; field state; match /OPEN/; count }
tail .titles
source .titles { in.json; field title }

test "state tally groups pr states" { given "{\"state\":\"OPEN\",\"title\":\"a\"}" "{\"state\":\"CLOSED\",\"title\":\"b\"}" "{\"state\":\"OPEN\",\"title\":\"c\"}"; run { in.json; field state; tally }; want "OPEN\t2" "CLOSED\t1" }
test "open counts open prs" { given "{\"state\":\"OPEN\",\"title\":\"a\"}" "{\"state\":\"CLOSED\",\"title\":\"b\"}" "{\"state\":\"OPEN\",\"title\":\"c\"}"; run { in.json; field state; match /OPEN/; count }; want "2" }