-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.go
52 lines (45 loc) · 1.22 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
package main
import (
"embed"
"log"
"os"
"github.com/lector-org/lector/cmd"
"github.com/lector-org/lector/services"
"github.com/urfave/cli/v2"
"github.com/wailsapp/wails/v3/pkg/application"
)
//go:embed gui/dist
var assets embed.FS
func main() {
readerService := services.NewReaderService()
app := application.New(application.Options{
Name: "Lector",
Description: "A highly modular and accessible reading tool",
Assets: application.AssetOptions{
Handler: application.BundledAssetFileServer(assets),
},
Mac: application.MacOptions{
ApplicationShouldTerminateAfterLastWindowClosed: true,
},
Services: []application.Service{
application.NewService(readerService),
},
})
cliApp := &cli.App{
Name: "lector",
Usage: "A highly modular and accessible reading tool",
Version: "0.0.0",
Args: true,
EnableBashCompletion: true,
UseShortOptionHandling: true,
Commands: []*cli.Command{
cmd.NewOpenCommand(cmd.OpenCommandOptions{App: app}),
cmd.NewAnalyzeCommand(),
cmd.NewSummaryCommand(),
},
}
if err := cliApp.Run(os.Args); err != nil {
log.Fatalf("Failed to start application: %v\n", err)
os.Exit(1)
}
}