Esempio n. 1
0
File: main.go Progetto: calmh/mole
func main() {
	loadConfig()

	// Early disable ansi, if the defaults say to do so.
	if !useAnsi {
		ansi.Disable()
	}

	// Using the logging functions before this point will panic. Used to weed
	// out logging before having set up the debug & ansi flags.
	enableLogging()

	// Ensure that we have a home directory and that it has the right permissions.
	ensureHome()

	// Set the default remapIntfs before parsing flags
	if runtime.GOOS == "windows" {
		remapIntfs = true
	}

	args := parseFlags()

	// Late disable ansi, if the command line flags said so.
	if !useAnsi {
		ansi.Disable()
	}

	if debugEnabled {
		printVersion()
	}

	// Early beta versions of mole4 wrote the fingerprint in lower case which
	// is incompatible with both mole 3 and current 4+. Rewrite the fingerprint
	// to upper case if necessary.
	if fp := moleIni.Get("server", "fingerprint"); fp != strings.ToUpper(fp) {
		moleIni.Set("server", "fingerprint", strings.ToUpper(fp))
		saveMoleIni()
	}

	dispatchCommand(args)

	exit(0)
}
Esempio n. 2
0
func init() {
	ansi.Disable()
}