27 lines
504 B
Go
27 lines
504 B
Go
package config
|
|
|
|
import (
|
|
"log"
|
|
|
|
"git.cryptic.systems/fh-trier/go-flucky/pkg/config"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var force bool
|
|
|
|
var createConfigCmd = &cobra.Command{
|
|
Use: "create",
|
|
Short: "create",
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
if err := config.Create(configDir, force); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
configCmd.AddCommand(createConfigCmd)
|
|
createConfigCmd.Flags().BoolVarP(&force, "force", "f", false, "Force the creation of a new configuration")
|
|
}
|