Reputation: 466
Hello I want to execute an elixir file and passing one string in my terminal and read it in the script. Something like this:
User>elixir script.exs create
I want the word "create" to be readed by elixir. Thank you.
Upvotes: 3
Views: 693
Reputation: 222118
You can access the list of arguments using System.argv/0
:
$ cat a.exs
IO.inspect System.argv
$ elixir a.exs foo bar
["foo", "bar"]
Upvotes: 5