-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
117 lines (112 loc) · 2.73 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
The Fluent Programming Language
-----------------------------------------------------
This code is released under the GNU GPL v3 license.
For more information, please visit:
https://www.gnu.org/licenses/gpl-3.0.html
-----------------------------------------------------
Copyright (c) 2025 Rodrigo R. & All Fluent Contributors
This program comes with ABSOLUTELY NO WARRANTY.
For details type `fluent l`. This is free software,
and you are welcome to redistribute it under certain
conditions; type `fluent l -f` for details.
*/
package main
import (
"context"
cli2 "fluent/cli"
"github.com/urfave/cli/v3"
"log"
"os"
)
func main() {
app := &cli.Command{
Name: "fluent",
Usage: "A blazingly fast programming language",
Commands: []*cli.Command{
{
Name: "benchmark",
Usage: "Runs the benchmarking tool",
Aliases: []string{"bE"},
Flags: []cli.Flag{
&cli.IntFlag{
Name: "times",
Value: 1000,
Usage: "How many times should the code be tested",
Aliases: []string{"t"},
Required: false,
},
},
Action: func(_ context.Context, cmd *cli.Command) error {
cli2.BenchmarkCommand(cmd)
return nil
},
},
{
Name: "build",
Usage: "Compiles your project into an executable",
Aliases: []string{"b"},
Flags: []cli.Flag{},
Action: func(_ context.Context, cmd *cli.Command) error {
cli2.BuildCommand(cmd)
return nil
},
},
{
Name: "run",
Usage: "Runs a fluent file",
Aliases: []string{"r"},
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "timer",
Value: false,
Usage: "Prints the time taken for each step",
Aliases: []string{"t"},
},
},
Action: func(_ context.Context, cmd *cli.Command) error {
cli2.RunCommand(cmd)
return nil
},
},
{
Name: "check",
Usage: "Checks a fluent file",
Aliases: []string{"c"},
Action: func(_ context.Context, cmd *cli.Command) error {
cli2.CheckCommand(cmd)
return nil
},
},
{
Name: "license",
Usage: "Prints the license",
Aliases: []string{"l"},
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "full",
Value: false,
Usage: "Prints the full license",
Aliases: []string{"f"},
},
},
Action: func(_ context.Context, cmd *cli.Command) error {
cli2.LicenseCommand(cmd)
return nil
},
},
{
Name: "init",
Usage: "Inits a new Fluent project",
Aliases: []string{"i"},
Action: func(_ context.Context, cmd *cli.Command) error {
cli2.InitCommand(cmd)
return nil
},
},
},
}
if err := app.Run(context.Background(), os.Args); err != nil {
log.Fatal(err)
}
}