<commit_before>package cmd

// extern void systemSighup();
// extern void systemFork();
import "C"

import (
	"github.com/spf13/cobra"
	"github.com/spf13/viper"
	"github.com/yroffin/jarvis-go-ext/server"
)

var startCmd = &cobra.Command{
	Use:   "start",
	Short: "Start the jarvis module",
	Long:  "",
	Run: func(cmd *cobra.Command, args []string) {
		C.systemSighup()
		if viper.GetString("daemon") == "true" {
			C.systemFork()
		}
		server.Start()
	},
}

func init() {
	viper.AutomaticEnv()

	startFlags := startCmd.Flags()

	startFlags.Int("jarvis.module.port", 7000, "set the listening jarvis module port")
	startFlags.String("jarvis.module.interface", "0.0.0.0", "set the listening jarvis module interface")
	startFlags.String("jarvis.module.name", "module", "set the listening jarvis module name")
	startFlags.String("jarvis.server.url", "http://0.0.0.0:8082", "set the listening jarvis server url")
	startFlags.String("daemon", "false", "set daemon mode")
	startFlags.String("jarvis.option.mfrc522", "false", "mfrc522 init on start")
	startFlags.String("jarvis.option.wiringpi", "false", "wiringpi init on start")
	startFlags.String("jarvis.option.wiringpi.alt", "false", "alternate code")
	startFlags.String("jarvis.option.advertise", "true", "advertise jarvis")

	viper.BindPFlag("jarvis.module.port", startFlags.Lookup("jarvis.module.port"))
	viper.BindPFlag("jarvis.module.name", startFlags.Lookup("jarvis.module.name"))
	viper.BindPFlag("jarvis.module.interface", startFlags.Lookup("jarvis.module.interface"))
	viper.BindPFlag("jarvis.server.url", startFlags.Lookup("jarvis.server.url"))
	viper.BindPFlag("jarvis.option.mfrc522", startFlags.Lookup("jarvis.option.mfrc522"))
	viper.BindPFlag("jarvis.option.wiringpi", startFlags.Lookup("jarvis.option.wiringpi"))
	viper.BindPFlag("jarvis.option.wiringpi.alt", startFlags.Lookup("jarvis.option.wiringpi.alt"))
	viper.BindPFlag("jarvis.option.advertise", startFlags.Lookup("jarvis.option.advertise"))
	viper.BindPFlag("daemon", startFlags.Lookup("daemon"))

	RootCmd.AddCommand(startCmd)
}
<commit_msg>Passage en full go<commit_after>package cmd

// extern void systemSighup();
// extern void systemFork();
import "C"

import (
	"github.com/spf13/cobra"
	"github.com/spf13/viper"
	"github.com/yroffin/jarvis-go-ext/server"
)

var startCmd = &cobra.Command{
	Use:   "start",
	Short: "Start the jarvis module",
	Long:  "",
	Run: func(cmd *cobra.Command, args []string) {
		C.systemSighup()
		if viper.GetString("daemon") == "true" {
			C.systemFork()
		}
		server.Start()
	},
}

func init() {
	viper.AutomaticEnv()

	startFlags := startCmd.Flags()

	startFlags.Int("jarvis.module.port", 7000, "set the listening jarvis module port")
	startFlags.String("jarvis.module.interface", "0.0.0.0", "set the listening jarvis module interface")
	startFlags.String("jarvis.module.name", "module", "set the listening jarvis module name")
	startFlags.String("jarvis.server.url", "http://0.0.0.0:8082", "set the listening jarvis server url")
	startFlags.String("daemon", "false", "set daemon mode")
	startFlags.String("jarvis.option.mfrc522", "false", "mfrc522 init on start")
	startFlags.String("jarvis.option.wiringpi", "false", "wiringpi init on start")
	startFlags.String("jarvis.option.wiringpi.alt", "true", "alternate code")
	startFlags.String("jarvis.option.advertise", "true", "advertise jarvis")

	viper.BindPFlag("jarvis.module.port", startFlags.Lookup("jarvis.module.port"))
	viper.BindPFlag("jarvis.module.name", startFlags.Lookup("jarvis.module.name"))
	viper.BindPFlag("jarvis.module.interface", startFlags.Lookup("jarvis.module.interface"))
	viper.BindPFlag("jarvis.server.url", startFlags.Lookup("jarvis.server.url"))
	viper.BindPFlag("jarvis.option.mfrc522", startFlags.Lookup("jarvis.option.mfrc522"))
	viper.BindPFlag("jarvis.option.wiringpi", startFlags.Lookup("jarvis.option.wiringpi"))
	viper.BindPFlag("jarvis.option.wiringpi.alt", startFlags.Lookup("jarvis.option.wiringpi.alt"))
	viper.BindPFlag("jarvis.option.advertise", startFlags.Lookup("jarvis.option.advertise"))
	viper.BindPFlag("daemon", startFlags.Lookup("daemon"))

	RootCmd.AddCommand(startCmd)
}

{'fraction_non_alphanumeric': 0.17199612403100775, 'fraction_numerical': 0.015503875968992248, 'mean_word_length': 5.974662162162162, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '287681', 'n_tokens_mistral': 1547, 'n_tokens_neox': 1500, 'n_words': 237}