-
Notifications
You must be signed in to change notification settings - Fork 23
/
main.go
38 lines (35 loc) · 1.41 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
package main
import (
"os"
"github.com/konveyor/crane/cmd/apply"
export "github.com/konveyor/crane/cmd/export"
plugin_manager "github.com/konveyor/crane/cmd/plugin-manager"
"github.com/konveyor/crane/cmd/runfn"
transfer_pvc "github.com/konveyor/crane/cmd/transfer-pvc"
skopeo_sync_gen "github.com/konveyor/crane/cmd/skopeo-sync-gen"
"github.com/konveyor/crane/cmd/transform"
tunnel_api "github.com/konveyor/crane/cmd/tunnel-api"
"github.com/konveyor/crane/cmd/version"
"github.com/konveyor/crane/internal/flags"
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
)
func main() {
f := &flags.GlobalFlags{}
root := cobra.Command{
Use: "crane",
}
f.ApplyFlags(&root)
root.AddCommand(export.NewExportCommand(genericclioptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr}, f))
root.AddCommand(transfer_pvc.NewTransferPVCCommand(genericclioptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr}))
root.AddCommand(tunnel_api.NewTunnelAPIOptions(genericclioptions.IOStreams{In: os.Stdin, Out: os.Stdout, ErrOut: os.Stderr}))
root.AddCommand(transform.NewTransformCommand(f))
root.AddCommand(skopeo_sync_gen.NewSkopeoSyncGenCommand(f))
root.AddCommand(apply.NewApplyCommand(f))
root.AddCommand(plugin_manager.NewPluginManagerCommand(f))
root.AddCommand(version.NewVersionCommand(f))
root.AddCommand(runfn.NewFnRunCommand(f))
if err := root.Execute(); err != nil {
os.Exit(1)
}
}