-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
embedded mode #13
Comments
You can use mad a a regular OTP application, from shell and from other apps. |
Ok, but if I want to get the warnings/errors back in order to process them, I need to install my own group leader and listen what is written to the output. Is this something you might want to handle, or is it up to each user? Regarding the shutting down, I see it's only after calling help() that it happens, so it should not be called in embedded mode. |
You mean only extending the error reporting ? |
Yes. A way to do that would be to let the user supply an (optional) callback that will receive the results for each compiled file and do something with them. The default would be to io:format them. Then the compilers should return any errors/warnings/info as a list and feed them to the callback. I'm not sure if all the supported compilers have a 'return' option that would do that; in the worst case the alternative would be to still install an own group leader, but it would be hidden from the users. If this is interesting, I will be glad to contribute implementation. |
It should be easy. |
just put some Pid ! ErrorOrStatusMessage near MAD's printfs. |
I'm not sure if that is enough, each compiler does io:format on its own. I will look at all supported compilers to see if they can return errors/warnings. I understand that you want a simple callback via a Pid, not some fun that the user can provide, right? |
Better just register Pid and use message protocol than use JavaScript-like callbacks spaghetti. |
Hi! I like mad as a replacement for rebar.
I see however that it's still meant to be used as a script, while I would like to be able to use it from the Erlang shell -- it would not shut down after running and the errors/warnings/progress messages would be returned or sent to a listener process as Erlang messages.
Do you have any plans for supporting something like that?
The text was updated successfully, but these errors were encountered: