faasd/cmd/root.go
Alex Ellis (OpenFaaS Ltd) 03fe48db99 Pass version from main
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2019-12-31 12:22:21 +00:00

50 lines
814 B
Go

package cmd
import (
"github.com/spf13/cobra"
)
// WelcomeMessage to introduce ofc-bootstrap
const WelcomeMessage = "Welcome to faasd"
func init() {
rootCommand.AddCommand(versionCmd)
rootCommand.AddCommand(upCmd)
rootCommand.AddCommand(installCmd)
}
var (
// GitCommit Git Commit SHA
GitCommit string
// Version version of the CLI
Version string
)
func Execute(gitCommit, version string) error {
GitCommit = gitCommit
Version = version
if err := rootCommand.Execute(); err != nil {
return err
}
return nil
}
var rootCommand = &cobra.Command{
Use: "faasd",
Short: "Start faasd",
Long: `
faasd - serverless without Kubernetes
`,
RunE: runRootCommand,
SilenceUsage: true,
}
func runRootCommand(cmd *cobra.Command, args []string) error {
printLogo()
cmd.Help()
return nil
}