CONTRIB: debug: also support reading values from stdin
authorWilly Tarreau <w@1wt.eu>
Thu, 6 Feb 2020 17:17:50 +0000 (18:17 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 6 Feb 2020 17:30:07 +0000 (18:30 +0100)
commite4f80a076c2d52a8b73f2f7350e047f6e39acd69
tree5372c72863355cde3565a742c27f6044c6a241b3
parent0cf811a5f941261176b67046dbc542d0479ff4a7
CONTRIB: debug: also support reading values from stdin

This is convenient when processing large dumps, it allows to copy-paste
values to inspect from one window to another, or to directly transfer
a "show fd"/"show stream" output through sed. In order to do this, simply
pass "-" alone instead of the value and they will all be read one line at
a time from stdin. For example, in order to quickly print the different
set of connection flags from "show fd", this is sufficient:

     sed -ne 's/^.* cflg=\([^ ]*\).*/\1/p' | contrib/debug/flags conn -
contrib/debug/flags.c