-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
main.go
80 lines (65 loc) · 1.83 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
package main
/* License: GPLv3
Authors:
Mirko Brombin <[email protected]>
Pietro di Caprio <[email protected]>
Copyright: 2024
Description: VSO is a utility which allows you to perform maintenance
tasks on your Vanilla OS installation.
*/
import (
"embed"
"os"
"github.com/vanilla-os/apx/v2/core"
"github.com/vanilla-os/apx/v2/settings"
"github.com/vanilla-os/orchid/cmdr"
"github.com/vanilla-os/vanilla-system-operator/cmd"
)
var Version = "development"
//go:embed locales/*.yml
var fs embed.FS
var vso *cmdr.App
func main() {
cnf := settings.NewApxConfig(
"/usr/share/vso/apx",
"/usr/share/apx/distrobox/distrobox",
"btrfs",
)
core.NewApx(cnf)
vso = cmd.New(Version, fs)
// root command
root := cmd.NewRootCommand(Version)
vso.CreateRootCommand(root)
vso.CreateRootCommand(root, vso.Trans("vso.msg.help"), vso.Trans("vso.msg.version"))
msgs := cmdr.UsageStrings{
Usage: vso.Trans("vso.msg.usage"),
Aliases: vso.Trans("vso.msg.aliases"),
Examples: vso.Trans("vso.msg.examples"),
AvailableCommands: vso.Trans("vso.msg.availableCommands"),
AdditionalCommands: vso.Trans("vso.msg.additionalCommands"),
Flags: vso.Trans("vso.msg.flags"),
GlobalFlags: vso.Trans("vso.msg.globalFlags"),
AdditionalHelpTopics: vso.Trans("vso.msg.additionalHelpTopics"),
MoreInfo: vso.Trans("vso.msg.moreInfo"),
}
vso.SetUsageStrings(msgs)
// commands
tasks := cmd.NewTasksCommand()
root.AddCommand(tasks)
upgrade := cmd.NewUpgradeCommand()
root.AddCommand(upgrade)
config := cmd.NewConfigCommand()
root.AddCommand(config)
// pico
pico := cmd.NewPicoCommand()
root.AddCommand(pico...)
// waydroid
way := cmd.NewWayCommand()
root.AddCommand(way...)
// run the app
err := vso.Run()
if err != nil {
cmdr.Error.Println(err)
os.Exit(1)
}
}