imag/lib/core/libimagrt
Matthias Beyer ce0bd9298a Implement pipe magic in libimagrt
When we merged the changes in libimagrt so that it automatically detects
whether stdin/stdout is a TTY and provides the user with stderr in case
stdout is not a TTY, we forgot that things like

    imag foo | grep bar

becomes impossible with that, because imag detects that stdout is not a
tty and automatically uses stderr for output.

But in this case, we don't want that. The output has to be stdout in
this case.

With this change, we have a flag in the runtime ("--pipe-magic" or "-P",
globally available) which turns on "pipe magic".

The expected behaviour is the following, if "-P" is passed:

* If stdout is a TTY, we print to stdout
* If stdout is not a TTY, we print to stderr
* If stdin is not a TTY, we do not provide it

If "-P" is not passed, we allow the user of libimagrt to use stdin for
interactive stuff (the interactive stuff is not yet implemented).

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2018-03-10 15:43:44 +01:00
..
src Implement pipe magic in libimagrt 2018-03-10 15:43:44 +01:00
.gitignore Reorganize code in subdirs 2017-08-27 15:12:09 +02:00
Cargo.toml Provide stdin/out/err resources via Runtime object 2018-03-04 13:57:02 +01:00
README.md Fix broken README symlinks 2017-08-27 15:13:25 +02:00

libimagrt

This library provides utility functionality for the modules and the binary frontends, such as reading and parsing the configuration file, a builder helper for the commandline interface and such.

It also contains the store object and creates it from configuration.

the libimagrt::runtime::Runtime object is the first complex object that comes to live in a imag binary.

Long-term TODO

  • Merge with libimagstore