ficsit-cli-flake/cmd/cli.go

29 lines
583 B
Go
Raw Normal View History

2021-12-02 04:00:33 +00:00
package cmd
import (
2022-06-08 20:56:32 +00:00
"github.com/rs/zerolog/log"
2021-12-02 04:00:33 +00:00
"github.com/spf13/cobra"
2022-06-08 20:56:32 +00:00
"github.com/spf13/viper"
2022-10-14 16:11:16 +00:00
"github.com/satisfactorymodding/ficsit-cli/cli"
"github.com/satisfactorymodding/ficsit-cli/tea"
2021-12-02 04:00:33 +00:00
)
var cliCmd = &cobra.Command{
Use: "cli",
2022-06-08 20:56:32 +00:00
Short: "Start interactive CLI (default)",
2021-12-02 04:00:33 +00:00
RunE: func(cmd *cobra.Command, args []string) error {
2022-06-08 20:56:32 +00:00
log.Info().
Str("version", viper.GetString("version")).
Str("commit", viper.GetString("commit")).
Msg("initialized")
2022-10-14 16:11:16 +00:00
global, err := cli.InitCLI(false)
2021-12-02 04:00:33 +00:00
if err != nil {
2022-06-08 20:56:32 +00:00
return err
2021-12-02 04:00:33 +00:00
}
return tea.RunTea(global)
},
}