spud/cli/cli.go

33 lines
591 B
Go
Raw Permalink Normal View History

// Root of the CLI.
package cli
import (
"github.com/spf13/cobra"
)
// 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.",
}
allCommands := []*cobra.Command{
// cli/start_service.go
getStartCommand(),
// cli/stop_service.go
getStopCommand(),
// cli/build.go
getBuildCommand(),
2024-10-02 02:56:25 +00:00
// cli/daemon.go
getDaemonCommand(),
}
for _, command := range allCommands {
cli.AddCommand(command)
}
return cli
}