func NewConfig() *Config {
	cfg := &Config{}
	cfg.Config = &importer.Config{}
	cfg.FlagSet = flag.NewFlagSet("importer", flag.ContinueOnError)
	fs := cfg.FlagSet
	fs.StringVar(&cfg.configFile, "config", "", "Config file")
	fs.StringVar(&cfg.TableSQL, "t", "", "create table sql")
	fs.StringVar(&cfg.IndexSQL, "i", "", "create index sql")
	fs.IntVar(&cfg.WorkerCount, "c", 2, "parallel worker count")
	fs.IntVar(&cfg.JobCount, "n", 10000, "total job count")
	fs.IntVar(&cfg.Batch, "b", 1000, "insert batch commit count")
	fs.StringVar(&cfg.DBCfg.Host, "h", "127.0.0.1", "set the database host ip")
	fs.StringVar(&cfg.DBCfg.User, "u", "root", "set the database user")
	fs.StringVar(&cfg.DBCfg.Password, "p", "", "set the database password")
	fs.StringVar(&cfg.DBCfg.Schema, "D", "test", "set the database name")
	fs.IntVar(&cfg.DBCfg.Port, "P", 3306, "set the database host port")
	fs.StringVar(&cfg.LogLevel, "L", "info", "log level: debug, info, warn, error, fatal")
	fs.BoolVar(&cfg.printVersion, "V", false, "prints version and exit")
	return cfg
}
NewConfig creates a new config.
package main
import (
	"flag"
	"fmt"
	"github.com/BurntSushi/toml"
	"github.com/pingcap/errors"
	"github.com/pingcap/tidb-tools/pkg/importer"
	"github.com/pingcap/tidb-tools/pkg/utils"
)