Closed gootik closed 4 years ago
looks good but lets support default configs too:
{commands, [
{a, "make test", [configs...]},
{b, "make run"}
]}.
You mean not using an option list? Sure, I was not mentioning otherwise (I was giving examples for the "extra" interface - since I don't want to break existing implementations/usage.
sorry I meant we should support both of the cases in my example. where [configs..] is your suggestion. So my revised example of things that should be supported:
{commands, [
{a, "make test", [
{timeout, 5000},
{ignore_output, true} % just an example, not suggesting we should do this
]},
{b, "make run"}
]}.
Communication 😄
When I wrote You mean not using an option list?
I should've written Do you mean "not using an option list at every declaration" (and using a default list of options, otherwise) when you state "lets support default configs too"
?
I got it, though. I wouldn't force a list if I didn't have too, anyway.
Hahaha. Sounds good
I've started fiddling with the implementation, for this issue, but have some questions.
What does the notion of "timeout" mean here, exactly? I don't think we can easily "stop command execution" on the OS once it's been started by os:cmd
. I maybe missing something, though.
It would be OK, for example, if you "chain" commands.
e.g.
{slow_cmd, [
{"find / -name .gitignore ", [{timeout, 2000}]},
"ls"
]}.
Here, timeout
could prevent the execution of ls
.
And another thing, would you still consider the command result for output even if it arrived late? Or just ignore it?
What about syntax?
How does this look?
or simpler still