func smashParamCheck() error {
	ok := false
	for _, availMetric := range availMetrics {
		if *metric == availMetric {
			ok = true
		}
	}
	if ok == false {
		return fmt.Errorf("supplied distance metric is not available: %v\nplease select one of the following: %v", *metric, availMetrics)
	}
	ok = false
	for _, availAlgo := range sketchio.AvailAlgorithms {
		if *algo == availAlgo {
			ok = true
		}
	}
	if ok == false {
		return fmt.Errorf("supplied algorithm not available: %v\nplease select one of the following: %v", *algo, sketchio.AvailAlgorithms)
	}
	filePath := filepath.Dir(*outFile)
	if filePath != "." {
		if _, err := os.Stat(filePath); os.IsNotExist(err) {
			if err := os.MkdirAll(filePath, 0700); err != nil {
				return fmt.Errorf("can't create specified output directory: %v", err)
			}
		}
	}
	if *proc <= 0 || *proc > runtime.NumCPU() {
		*proc = runtime.NumCPU()
	}
	runtime.GOMAXPROCS(*proc)
	helpers.ErrorCheck(helpers.CheckDir(*sketchDir))
	sDir := []byte(*sketchDir)
	if sDir[len(sDir)-1] != 47 {
		sDir = append(sDir, 47)
	}
	jsonFiles, err := helpers.CollectJSONs(string(sDir), *recursive)
	helpers.ErrorCheck(err)
	for _, jsonFile := range jsonFiles {
		loadedSketch, err := sketchio.LoadHULKdata(jsonFile)
		helpers.ErrorCheck(err)
		hSketches[jsonFile] = loadedSketch
	}
	if len(hSketches) < 2 {
		return fmt.Errorf("%d sketches found in the supplied directory, HULK needs at least 2 to smash!\n", len(hSketches))
	}
	return nil
}
smashParamCheck is a function to check user supplied parameters
package cmd
import (
	"encoding/csv"
	"fmt"
	"log"
	"os"
	"path/filepath"
	"runtime"
	"sort"
	"strconv"
	"github.com/pkg/profile"
	"github.com/spf13/cobra"
	"github.com/will-rowe/hulk/src/helpers"
	"github.com/will-rowe/hulk/src/sketchio"
	"github.com/will-rowe/hulk/src/version"
)
var (
	sketchDir    *string  
	recursive    *bool    
	algo         *string  
	metric       *string  
	bannerMatrix *bool    
)
var availMetrics = []string{"jaccard", "weightedjaccard"}
var hSketches map[string]*sketchio.HULKdata
var smashCmd = &cobra.Command{
	Use:   "smash",
	Short: "Smash a bunch of sketches and return a distance matrix",
	Long: `
		Smash a bunch of sketches and return a distance matrix.
		This subcommand performs pairwise comparisons of sketches and then writes a distance matrix.`,
	Run: func(cmd *cobra.Command, args []string) {
		runSmash()
	},
	PreRunE: func(cmd *cobra.Command, args []string) error {
		return helpers.CheckRequiredFlags(cmd.Flags())
	},
}
func init() {
	sketchDir = smashCmd.Flags().StringP("sketchDir", "d", "./", "the directory containing the sketches to smash (compare)...")
	recursive = smashCmd.Flags().Bool("recursive", false, "recursively search the supplied sketch directory (-d)")
	algo = smashCmd.PersistentFlags().StringP("algorithm", "a", "histosketch", fmt.Sprintf("tells HULK which sketching algorithm to use %v", sketchio.AvailAlgorithms))
	metric = smashCmd.Flags().StringP("metric", "m", "jaccard", fmt.Sprintf("tells HULK which distance metric to use %v", availMetrics))
	bannerMatrix = smashCmd.Flags().Bool("bannerMatrix", false, "write a matrix file for banner")
	RootCmd.AddCommand(smashCmd)
}
func runSmash() {
	if *profiling == true {
		defer profile.Start(profile.ProfilePath("./")).Stop()
	}
	if *logFile != "" {
		logFH := helpers.StartLogging(*logFile)
		defer logFH.Close()
		log.SetOutput(logFH)
	} else {
		log.SetOutput(os.Stdout)
	}
	log.Printf("this is hulk (version %s)\n", version.VERSION)
	log.Printf("starting the smash subcommand\n")
	hSketches = make(map[string]*sketchio.HULKdata)
	helpers.ErrorCheck(smashParamCheck())
	log.Printf("checking parameters and collecting sketches...\n")
	log.Printf("\talgorithm: %v\n", *algo)
	log.Printf("\tk-mer size: %d\n", *kmerSize)
	log.Printf("\tcreate matrix for banner: %v\n", *bannerMatrix)
	log.Printf("\tnumber of sketch objects: %d\n", len(hSketches))
	log.Print("HULK SMASH!\n")
	helpers.ErrorCheck(makeMatrix())
	log.Printf("\twritten similarity matrix to disk: %v\n", *outFile+".hulk-matrix.csv")
	if *bannerMatrix {
		helpers.ErrorCheck(makeBannerMatrix())
		log.Printf("\twritten banner matrix to disk: %v\n", *outFile+".banner-matrix.csv")
	}
	log.Printf("finished")
}