From: m@mmmmarascio.xyz Date: Mon, 1 Aug 2016 09:25:57 +0000 (+0200) Subject: Enable inc(1) to read from stdin X-Git-Tag: mmh-0.3~21 X-Git-Url: http://git.marmaro.de/?p=mmh;a=commitdiff_plain;h=a0bb92c9f397eb69914be03d7de16ae8e83e7426 Enable inc(1) to read from stdin The -file switch handles the argument "-" special and reads from stdin in this case. --- diff --git a/man/inc.man1 b/man/inc.man1 index 817c1bd..ed586c1 100644 --- a/man/inc.man1 +++ b/man/inc.man1 @@ -124,6 +124,13 @@ By using the switch, one can direct .B inc to incorporate messages from a file other than the user's maildrop. +In particular, if +.I name +is +.RI ` - ' +then +.B inc +will read messages from standard input. Note that the named file will NOT be zeroed, unless the .B \-truncate switch is given. diff --git a/test/tests/inc/test-read-stdin b/test/tests/inc/test-read-stdin new file mode 100644 index 0000000..d771d32 --- /dev/null +++ b/test/tests/inc/test-read-stdin @@ -0,0 +1,66 @@ +#!/bin/sh +########################################################## +# Test incorporating mail from stdin with `inc -file -`. # +########################################################## +. "$MH_TEST_COMMON" + +# Test empty stdin from a pipe. +runandcheck "printf '' |inc -file -" <$f && inc -file - <$f" <$f && inc -file - <$f" <