package main import ( "github.com/spf13/cobra" ) var cli = &cobra.Command{ Use: "spud", Short: "A not-entirely-terrible-way to manage self-hosted services.", } var start = &cobra.Command{ Use: "start", Short: "Creates or updates a service based on the provided definition.", Run: func(cmd *cobra.Command, args []string) { pathProvided := args[0] def := GetServiceDefinitionFromFile(pathProvided) CreateService(def) }, } func main() { cli.AddCommand(start) cli.Execute() }