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:37:35 +0000 (18:37 +0100)
commit5399df74ed4ca5e7d847575beb4ad5817f0da9b3
treed5b6ec68ab74d1ec6973ffdf5482e0daa3f742b0
parent9007a8d65d56e670aad97f60b66c36a52aab22c5
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 -

(cherry picked from commit e4f80a076c2d52a8b73f2f7350e047f6e39acd69)
Signed-off-by: Willy Tarreau <w@1wt.eu>
contrib/debug/flags.c