Esempio n. 1
0
func init() {
	flag.StringVar(&configFile, "config", "httpdb.conf.json", "specify a config file")

	showconf = flag.Bool("showconf", false, "prints the configuration and exists.")

	flag.Parse()

	logger = lumberjack.NewLoggerWithDefaults()

	done = make(chan struct{})
	data = DataStore{Entries: make(map[string]*Entry)}
	locks = LockStore{Locks: make(map[string]struct{})}
}
Esempio n. 2
0
func init() {
	usr := flag.String("user", "", "Github username.")
	rep := flag.String("repo", "", "Name of the repo to generate.")
	txt := flag.String("text", "", "Text to set for the histogram.")
	dbg := flag.Bool("debug", false, "Turns on debug loggerging.")
	dry := flag.Bool("dryrun", false, "Disables output of generated bash script, only histogram preview.")
	ssh := flag.Bool("ssh", false, "Enables output of script using git with SSH instead of the default HTTPS.")
	flag.Parse()

	user = *usr
	repo = *rep
	text = *txt
	dryrun = *dry
	usessh = *ssh

	logger = lumberjack.NewLoggerWithDefaults()

	if *dbg {
		logger.AddLevel(lumberjack.DEBUG)
	}
}