2024-09-27 00:38:01 +00:00
|
|
|
// Root of the CLI.
|
|
|
|
package cli
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
var allCommands = []*cobra.Command{
|
|
|
|
// cli/start_service.go
|
|
|
|
start,
|
|
|
|
// cli/stop_service.go
|
|
|
|
stop,
|
2024-09-27 03:29:52 +00:00
|
|
|
// cli/build.go
|
|
|
|
build,
|
2024-09-27 00:38:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Creates the root of the CLI, with all available commands
|
|
|
|
// added to it.
|
|
|
|
func GetCli() *cobra.Command {
|
|
|
|
var cli = &cobra.Command{
|
|
|
|
Use: "spud",
|
|
|
|
Short: "A not-entirely-terrible-way to manage self-hosted services.",
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, command := range allCommands {
|
|
|
|
cli.AddCommand(command)
|
|
|
|
}
|
|
|
|
|
|
|
|
return cli
|
|
|
|
}
|