neithere / argh

An argparse wrapper that doesn't make you say "argh" each time you deal with it.
http://argh.rtfd.org
GNU Lesser General Public License v3.0
369 stars 55 forks source link

Support realtime output through a pipe (fixes #145) #202

Closed neithere closed 10 months ago

neithere commented 11 months ago

If the output stream is not a terminal (i.e. redirected to a file or another process), it's probably buffered. In most cases it doesn't matter. However, if the output of your program is generated with delays between the lines and you may want to redirect them to another process and immediately see the results (e.g. my_app.py | grep something), it's a good idea to force flushing of the buffer. To do so, set dispatch(..., always_flush=True).