ngs
ngs copied to clipboard
Add a way to indicate that anything on stderr of external program is an exception
Hello tsort
!
If the graph contains a cycle (and therefore cannot be properly sorted), one of the arcs in the cycle is ignored and the sort continues. Cycles are reported on standard error.
... and exit code is still zero
Initiall thought:
F finished_ok(p:Process) {
ok = p.command.options.get('ok')
guard ok is Fun
ok(p)
}
but then how is it that ok:[1,2]
refers to exit code while ok:mymethod
will get Process
argument?
Maybe something like Pred
is needed for ok:
argument.
If the above is implemented then: $(ok:F(p) p.stderr.not() and p.finished_ok() blah}
- which is not very readable. Maybe putting a lambda inside $(...)
is not that great of an idea.
Thoughts:
stderr_exception:
options sound ok.
-
true
will cause any output to be treated as exception -
RegExp
will do the obvious thing
Using ~
(match) operator is possible (to be applied to stdout
and the value of the stderr_exception:
option). Need to think how to indicate non-empty string then.
Requirements:
- stdout, stderr and other arbitrary file descriptors should be possible to check
- consistent option naming, starting with
ok_
- possible checks should include: empty string, substring search, regexp match
- positive and negative checks