This repository was archived by the owner on Mar 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
107 lines (104 loc) · 2.66 KB
/
Copy pathmain.go
File metadata and controls
107 lines (104 loc) · 2.66 KB
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
package main
import (
apps "github.com/innatical/octii-cli/apps"
"github.com/urfave/cli/v2"
"os"
)
func main() {
app := &cli.App{
Name: "octii",
Usage: "Octii DevTools",
UsageText: "octii [global options] command [command options] [arguments...]",
Commands: []*cli.Command{
{
Name: "account",
Usage: "Manage your Octii account",
Subcommands: []*cli.Command{
{
Name: "login",
Usage: "Login into Octii",
UsageText: "octii account login <token>",
Action: apps.Login,
},
{
Name: "info",
Usage: "Show account info for the logged in user",
UsageText: "octii account info",
Action: apps.Account,
},
},
},
{
Name: "organizations",
Usage: "Manage your developer organizations",
Subcommands: []*cli.Command{
{
Name: "list",
Usage: "List your Octii organizations",
UsageText: "octii organizations list",
Action: apps.Organizations,
},
{
Name: "products",
Usage: "Get the products belonging to an organization",
UsageText: "octii organizations products <id>",
Subcommands: []*cli.Command{
{
Name: "list",
Usage: "List all products",
UsageText: "octii organizations products list <organization_id>",
Action: apps.Products,
},
},
},
},
},
{
Name: "products",
Usage: "Manage your Octii products",
Subcommands: []*cli.Command{
{
Name: "resources",
Usage: "Manage your Octii resources",
Subcommands: []*cli.Command{
{
Name: "get",
Usage: "Get the payload of a resource",
UsageText: "octii products resources get <product_id> <resource_id> <output_file>",
Action: apps.GetResource,
},
{
Name: "put",
Usage: "Put the payload of a resource",
UsageText: "octii products resources put <product_id> <resource_id> <input_file>",
Action: apps.PutResource,
},
{
Name: "list",
Usage: "Get all resources for a product",
UsageText: "octii products resources list <product_id>",
Action: apps.Resources,
},
},
},
},
},
{
Name: "templates",
Usage: "Scaffold your product from a template",
Subcommands: []*cli.Command{
{
Name: "theme",
Usage: "Write a theme template",
UsageText: "octii templates theme <output_file>",
Action: apps.Theme,
},
},
},
},
}
if err := app.Run(os.Args); err != nil {
println(err.Error())
os.Exit(1)
}
}