forked from Vanilla-OS/vanilla-system-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
64 lines (54 loc) · 1.62 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
package main
/* License: GPLv3
Authors:
Mirko Brombin <[email protected]>
Pietro di Caprio <[email protected]>
Copyright: 2023
Description: VSO is a utility which allows you to perform maintenance
tasks on your Vanilla OS installation.
*/
import (
"fmt"
"github.com/spf13/cobra"
"github.com/vanilla-os/vso/cmd"
)
var (
Version = "1.3.4-1"
)
func help(cmd *cobra.Command, args []string) {
fmt.Println(`Usage:
vso [flags] [command] [arguments]
Global Flags:
-h, --help Show this help message and exit
Commands:
config Configure VSO
create-task Create a new task
delete-task Delete a task
developer-program Join the developers program
help Show this help message and exit
list-tasks List all tasks
rotate-tasks Rotate tasks
trigger-update Trigger a system update
update-check Check for system updates
version Show version and exit`)
}
func newVsoCommand() *cobra.Command {
return &cobra.Command{
Use: "vso",
Short: "VSO is an utility which allows you to perform maintenance tasks on your Vanilla OS installation.",
Version: Version,
}
}
func main() {
rootCmd := newVsoCommand()
rootCmd.AddCommand(cmd.NewCreateTaskCommand())
rootCmd.AddCommand(cmd.NewDeleteTaskCommand())
rootCmd.AddCommand(cmd.NewConfigCommand())
rootCmd.AddCommand(cmd.NewDevProgramCommand())
rootCmd.AddCommand(cmd.NewListTasksCommand())
rootCmd.AddCommand(cmd.NewRotateTasksCommand())
rootCmd.AddCommand(cmd.NewTriggerUpdateCommand())
rootCmd.AddCommand(cmd.NewCheckUpdateCommand())
rootCmd.SetHelpFunc(help)
rootCmd.Execute()
}