-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathroot.go
48 lines (43 loc) · 1.29 KB
/
root.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
package cmd
import (
"github.com/MakeNowJust/heredoc"
"github.com/odpf/salt/cmdx"
"github.com/spf13/cobra"
)
//New root command
func New() *cobra.Command {
var cmd = &cobra.Command{
Use: "stencil <command> <subcommand> [flags]",
Short: "Schema registry to manage schemas efficiently",
Long: heredoc.Doc(`
Schema registry to manage schemas efficiently.
Stencil is a schema registry that provides schema mangement and validation to ensure data
compatibility across applications. It enables developers to create, manage and consume
schemas dynamically, efficiently, and reliably, and provides a simple way to validate data
against those schemas. Stencil support protobuf and support for other formats coming soon.
`),
SilenceUsage: true,
SilenceErrors: true,
Example: heredoc.Doc(`
$ stencil upload
$ stencil download
$ stencil snapshot list
$ stencil serve
$ stencil protoc
`),
Annotations: map[string]string{
"group:core": "true",
"help:feedback": heredoc.Doc(`
Open an issue here https://github.com/odpf/stencil/issues
`),
},
}
cmdx.SetHelp(cmd)
cmd.AddCommand(ServeCmd())
cmd.AddCommand(UploadCmd())
cmd.AddCommand(MigrateCmd())
cmd.AddCommand(DownloadCmd())
cmd.AddCommand(Snapshot())
cmd.AddCommand(ProtocCmd())
return cmd
}