<commit_before>package main

import (
	"log"
	"os"

	"github.com/codegangsta/cli"
	"github.com/minio-io/minio/pkg/server"
)

func main() {
	app := cli.NewApp()
	app.Name = "minio"
	app.Usage = ""
	app.Flags = []cli.Flag{
		cli.StringFlag{
			Name:  "http-address,a",
			Value: ":8080",
			Usage: "http address to listen on",
		},
		cli.StringFlag{
			Name:  "cert,c",
			Value: "",
			Usage: "cert.pem",
		},
		cli.StringFlag{
			Name:  "key,k",
			Value: "",
			Usage: "key.pem",
		},
		cli.StringFlag{
			Name:  "storage-type,s",
			Value: "file",
			Usage: "valid entries: file,inmemory",
		},
	}
	app.Action = func(c *cli.Context) {
		storageTypeStr := c.String("storage-type")
		address := c.String("http-address")
		log.Println(address)
		certFile := c.String("cert")
		keyFile := c.String("key")
		tls := (certFile != "" && keyFile != "")
		storageType := getStorageType(storageTypeStr)
		serverConfig := server.ServerConfig{
			Address:     address,
			Tls:         tls,
			CertFile:    certFile,
			KeyFile:     keyFile,
			StorageType: storageType,
		}
		server.Start(serverConfig)
	}
	app.Run(os.Args)
}

func getStorageType(input string) server.StorageType {
	switch {
	case input == "file":
		return server.FileStorage
	case input == "inmemory":
		return server.InMemoryStorage
	default:
		{
			log.Println("Unknown storage type:", input)
			log.Println("Choosing default storage type as 'file'..")
			return server.FileStorage
		}
	}
}
<commit_msg>Certificate and key must both be specified or empty together<commit_after>package main

import (
	"log"
	"os"

	"github.com/codegangsta/cli"
	"github.com/minio-io/minio/pkg/server"
)

func main() {
	app := cli.NewApp()
	app.Name = "minio"
	app.Usage = ""
	app.Flags = []cli.Flag{
		cli.StringFlag{
			Name:  "http-address,a",
			Value: ":8080",
			Usage: "http address to listen on",
		},
		cli.StringFlag{
			Name:  "cert,c",
			Value: "",
			Usage: "cert.pem",
		},
		cli.StringFlag{
			Name:  "key,k",
			Value: "",
			Usage: "key.pem",
		},
		cli.StringFlag{
			Name:  "storage-type,s",
			Value: "file",
			Usage: "valid entries: file,inmemory",
		},
	}
	app.Action = func(c *cli.Context) {
		storageTypeStr := c.String("storage-type")
		address := c.String("http-address")
		log.Println(address)
		certFile := c.String("cert")
		keyFile := c.String("key")
		if (certFile != "" && keyFile == "") || (certFile == "" && keyFile != "") {
			log.Fatal("Both certificate and key must be provided to enable https")
		}
		tls := (certFile != "" && keyFile != "")
		storageType := getStorageType(storageTypeStr)
		serverConfig := server.ServerConfig{
			Address:     address,
			Tls:         tls,
			CertFile:    certFile,
			KeyFile:     keyFile,
			StorageType: storageType,
		}
		server.Start(serverConfig)
	}
	app.Run(os.Args)
}

func getStorageType(input string) server.StorageType {
	switch {
	case input == "file":
		return server.FileStorage
	case input == "inmemory":
		return server.InMemoryStorage
	default:
		{
			log.Println("Unknown storage type:", input)
			log.Println("Choosing default storage type as 'file'..")
			return server.FileStorage
		}
	}
}

{'fraction_non_alphanumeric': 0.1646945954589063, 'fraction_numerical': 0.0025583626479053407, 'mean_word_length': 3.332409972299169, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '5666544', 'n_tokens_mistral': 1275, 'n_tokens_neox': 1130, 'n_words': 238}