-
Notifications
You must be signed in to change notification settings - Fork 40
/
root.go
48 lines (43 loc) · 1.23 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/raystack/salt/cmdx"
"github.com/spf13/cobra"
)
// New adds all child commands to the root command and sets flags appropriately.
func New() *cobra.Command {
var cmd = &cobra.Command{
Use: "meteor <command> <subcommand> [flags]",
Short: "Metadata CLI",
Long: "Metadata collection tool.",
SilenceErrors: true,
SilenceUsage: false,
Example: heredoc.Doc(`
$ meteor list extractors
$ meteor run recipe.yaml
$ meteor gen recipe --extractor=date --sink console
`),
Annotations: map[string]string{
"group": "core",
"help:learn": heredoc.Doc(`
Use 'meteor <command> <subcommand> --help' for more information about a command.
Read the manual at https://raystack.github.io/meteor/
`),
"help:feedback": heredoc.Doc(`
Open an issue here https://github.com/raystack/meteor/issues
`),
},
}
// Help topics
cmdx.SetHelp(cmd)
cmd.AddCommand(cmdx.SetCompletionCmd("meteor"))
cmd.AddCommand(cmdx.SetRefCmd(cmd))
cmd.AddCommand(VersionCmd())
cmd.AddCommand(GenCmd())
cmd.AddCommand(ListCmd())
cmd.AddCommand(InfoCmd())
cmd.AddCommand(RunCmd())
cmd.AddCommand(LintCmd())
cmd.AddCommand(NewCmd())
return cmd
}