File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ erl_crash.dump
2323fp_lab3- * .tar
2424# Temporary files, for example, from tests.
2525/tmp /
26+ # Generated executables
27+ /out /
28+ ! /out /.keep
2629
2730# ## IntelliJ IDEA ###
2831.idea /
Original file line number Diff line number Diff line change 1+ defmodule InterpolationApp.Main do
2+ @ moduledoc """
3+ Application entry point
4+ """
5+
6+ @ spec main ( [ String . t ( ) ] ) :: any ( )
7+ def main ( args \\ [ ] ) do
8+ args
9+ |> parse_args ( )
10+ |> IO . puts ( )
11+ end
12+
13+ defp parse_args ( args ) do
14+ { opts , word , _ } = args |> OptionParser . parse ( switches: [ upcase: :boolean ] )
15+
16+ { opts , List . to_string ( word ) }
17+ end
18+ end
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ defmodule FpLab3.MixProject do
1010 def project do
1111 [
1212 app: :fp_lab3 ,
13+ escript: escript ( ) ,
1314 elixir: "~> 1.17" ,
1415 elixirc_paths: elixirc_paths ( Mix . env ( ) ) ,
1516 preferred_cli_env: [
@@ -37,6 +38,14 @@ defmodule FpLab3.MixProject do
3738 ]
3839 end
3940
41+ defp escript do
42+ [
43+ main_module: InterpolationApp.Main ,
44+ path: "./out/interpolation-app" ,
45+ name: "interpolation-app"
46+ ]
47+ end
48+
4049 def application do
4150 [
4251 extra_applications: [ :logger ]
You can’t perform that action at this time.
0 commit comments