airshipctl/cmd/root.go
2019-05-24 15:38:59 -05:00

26 lines
626 B
Go

package cmd
import (
"io"
"github.com/spf13/cobra"
"github.com/ian-howell/airshipctl/pkg/environment"
)
// NewRootCmd creates the root `airshipctl` command. All other commands are
// subcommands branching from this one
func NewRootCmd(out io.Writer) (*cobra.Command, *environment.AirshipCTLSettings, error) {
rootCmd := &cobra.Command{
Use: "airshipctl",
Short: "airshipctl is a unified entrypoint to various airship components",
}
rootCmd.SetOutput(out)
rootCmd.AddCommand(NewVersionCommand(out))
settings := &environment.AirshipCTLSettings{}
settings.InitFlags(rootCmd)
return rootCmd, settings, nil
}