Last active
August 29, 2015 14:22
-
-
Save brweber2/c8f8b48fd526a01c12a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# (arity 0) | |
root@deleteme:~/foo# bin/foo rpc Foo bar | |
RPC to '[email protected]' failed: {'EXIT', | |
{undef, | |
[{'Foo',bar,[],[]}, | |
{rpc,'-handle_call_call/6-fun-0-',5, | |
[{file,"rpc.erl"},{line,205}]}]}} | |
root@deleteme:~/foo# bin/foo rpc Elixir.Foo bar | |
yeah! | |
:ok | |
# (arity 1) -- note the erlang terms and '.' at the end... we have to pass an array of the args, which in our case is an array | |
What about with arguments to Elixir.Foo main? | |
root@deleteme:~/foo# bin/foo rpc Elixir.Foo main "[1]" | |
escript: exception error: no match of right hand side value | |
{error,{0,erl_parse,["syntax error before: ",[]]}} | |
root@deleteme:~/foo# bin/foo rpc Elixir.Foo main "[[1,2,3]]." | |
Your arg is 1 | |
Your arg is 2 | |
Your arg is 3 | |
[ok,ok,ok] | |
# Finally, the escript way that doesn't require bin/foo start | |
root@deleteme:~/foo# bin/foo escript lib/foo-0.0.1/ebin/Elixir.Foo.beam "fo" "bar" 1 2 3 | |
Your arg is fo | |
Your arg is bar | |
Your arg is 1 | |
Your arg is 2 | |
Your arg is 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment