File tree 3 files changed +30
-0
lines changed
3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ erl_crash.dump
23
23
fp_lab3- * .tar
24
24
# Temporary files, for example, from tests.
25
25
/tmp /
26
+ # Generated executables
27
+ /out /
28
+ ! /out /.keep
26
29
27
30
# ## IntelliJ IDEA ###
28
31
.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
10
10
def project do
11
11
[
12
12
app: :fp_lab3 ,
13
+ escript: escript ( ) ,
13
14
elixir: "~> 1.17" ,
14
15
elixirc_paths: elixirc_paths ( Mix . env ( ) ) ,
15
16
preferred_cli_env: [
@@ -37,6 +38,14 @@ defmodule FpLab3.MixProject do
37
38
]
38
39
end
39
40
41
+ defp escript do
42
+ [
43
+ main_module: InterpolationApp.Main ,
44
+ path: "./out/interpolation-app" ,
45
+ name: "interpolation-app"
46
+ ]
47
+ end
48
+
40
49
def application do
41
50
[
42
51
extra_applications: [ :logger ]
You can’t perform that action at this time.
0 commit comments