misc/io: only warn for "incorrect" usage
With options, opening an output for reading or an input for writing is
clearly wrong. But with positional arguments, this can be legitimate,
e.g. when overwriting a file: "bart slice 0 0 a.ra a.ra" is a legitimate
use case. So for now, we just warn about it.
@@ -107,7 +107,7 @@ static void io_register(const char* name, bool out, bool open)
} else {
if (out != iop->out)
- error("%s: Input opened for writing or output opened for reading!\n", name);
+ debug_printf(DP_WARN, "%s: Input opened for writing or output opened for reading (or overwriting file)!\n", name);
iop->open = open;
new = false;
