-
Notifications
You must be signed in to change notification settings - Fork 31
/
list.go
45 lines (40 loc) · 1.46 KB
/
list.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
package list
import (
"github.com/MakeNowJust/heredoc"
msg "github.com/aziontech/azion-cli/messages/list"
cache "github.com/aziontech/azion-cli/pkg/cmd/list/cache_setting"
domain "github.com/aziontech/azion-cli/pkg/cmd/list/domain"
edgeApplications "github.com/aziontech/azion-cli/pkg/cmd/list/edge_applications"
function "github.com/aziontech/azion-cli/pkg/cmd/list/edge_function"
edgeStorage "github.com/aziontech/azion-cli/pkg/cmd/list/edge_storage"
origin "github.com/aziontech/azion-cli/pkg/cmd/list/origin"
token "github.com/aziontech/azion-cli/pkg/cmd/list/personal_token"
rule "github.com/aziontech/azion-cli/pkg/cmd/list/rule_engine"
"github.com/aziontech/azion-cli/pkg/cmd/list/variables"
"github.com/aziontech/azion-cli/pkg/cmdutil"
"github.com/spf13/cobra"
)
func NewCmd(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: msg.Usage,
Short: msg.ShortDescription,
Long: msg.LongDescription, Example: heredoc.Doc(`
$ azion list --help
$ azion list edge-application
`),
RunE: func(cmd *cobra.Command, args []string) error {
return cmd.Help()
},
}
cmd.AddCommand(edgeApplications.NewCmd(f))
cmd.AddCommand(rule.NewCmd(f))
cmd.AddCommand(domain.NewCmd(f))
cmd.AddCommand(token.NewCmd(f))
cmd.AddCommand(origin.NewCmd(f))
cmd.AddCommand(cache.NewCmd(f))
cmd.AddCommand(function.NewCmd(f))
cmd.AddCommand(variables.NewCmd(f))
cmd.AddCommand(edgeStorage.NewCmd(f))
cmd.Flags().BoolP("help", "h", false, msg.FlagHelp)
return cmd
}