func ChangeDefaultCfgfileFlag(beatName string) error {
	configfiles.SetDefault(beatName + ".yml")
	return nil
}
ChangeDefaultCfgfileFlag replaces the value and default value for the `-c`
flag so that it reflects the beat name.
package cfgfile
import (
	"flag"
	"fmt"
	"os"
	"path/filepath"
	"github.com/elastic/beats/libbeat/common"
)
var (
	configfiles = flagArgList("c", "beat.yml", "Configuration file, relative to path.config")
	overwrites  = common.NewFlagConfig(nil, nil, "E", "Configuration overwrite")
	testConfig  = flag.Bool("configtest", false, "Test configuration and exit.")
	defaults = mustNewConfigFrom(map[string]interface{}{
		"path": map[string]interface{}{
			"home":   ".",  
			"config": "${path.home}",
			"data":   fmt.Sprint("${path.home}", string(os.PathSeparator), "data"),
			"logs":   fmt.Sprint("${path.home}", string(os.PathSeparator), "logs"),
		},
	})
	homePath   *string
	configPath *string
)
func init() {
	makePathFlag := func(name, usage string) *string {
		return common.NewFlagOverwrite(nil, overwrites, name, name, "", usage)
	}
	homePath = makePathFlag("path.home", "Home path")
	configPath = makePathFlag("path.config", "Configuration path")
	makePathFlag("path.data", "Data path")
	makePathFlag("path.logs", "Logs path")
}
func mustNewConfigFrom(from interface{}) *common.Config {
	cfg, err := common.NewConfigFrom(from)
	if err != nil {
		panic(err)
	}
	return cfg
}