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
12
13
# cloudformation — stack status dashboard from list-stacks output
#   aws cloudformation list-stacks --query 'StackSummaries[].[StackStatus,StackName]' --output text | arb -p cloudformation
bars .status
source .status { in; field 1; tally }
gauge .total -max 200
source .total { in; nonempty; count }
list .failed
source .failed { in; match /FAILED|ROLLBACK/; field 2 }
tail .stacks
source .stacks { in; field 2 }

test "status tally" { given "CREATE_COMPLETE stack-one" "CREATE_COMPLETE stack-two" "CREATE_FAILED stack-three"; run { in; field 1; tally }; want "CREATE_COMPLETE\t2" "CREATE_FAILED\t1" }
test "failed field" { given "CREATE_COMPLETE stack-one" "UPDATE_ROLLBACK_COMPLETE stack-two" "CREATE_FAILED stack-three"; run { in; match /FAILED|ROLLBACK/; field 2 }; want "stack-two" "stack-three" }