func getConfigVars(ctx *cli.Context) error {
	configFile := ctx.GlobalString("config")
	if configFile == "" {
		configFile = filepath.Join(config.StepPath(), "config", "defaults.json")
	}
	b, err := ioutil.ReadFile(configFile)
	if err != nil {
		return nil
	}
	m := make(map[string]interface{})
	if err := json.Unmarshal(b, &m); err != nil {
		return errors.Wrapf(err, "error parsing %s", configFile)
	}
	flags := make(map[string]cli.Flag)
	for _, f := range ctx.Command.Flags {
		name := strings.Split(f.GetName(), ",")[0]
		flags[name] = f
	}
	for _, name := range ctx.FlagNames() {
		if ctx.IsSet(name) {
			continue
		}
		if f, ok := flags[name]; ok {
			if getFlagEnvVar(f) == IgnoreEnvVar {
				continue
			}
		}
		if v, ok := m[name]; ok {
			ctx.Set(name, fmt.Sprintf("%v", v))
		}
	}
	return nil
}
getConfigVars load the defaults.json file and sets the flags if they are not
already set or the EnvVar is set to IgnoreEnvVar.

TODO(mariano): right now it only supports parameters at first level.
package command
import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"os"
	"path/filepath"
	"reflect"
	"strings"
	"github.com/pkg/errors"
	"github.com/smallstep/cli/config"
	"github.com/smallstep/cli/usage"
	"github.com/urfave/cli"
)
const IgnoreEnvVar = "STEP_IGNORE_ENV_VAR"
var cmds []cli.Command
var currentContext *cli.Context
func init() {
	os.Unsetenv(IgnoreEnvVar)
	cmds = []cli.Command{
		usage.HelpCommand(),
	}
}
func Register(c cli.Command) {
	setEnvVar(&c)
	cmds = append(cmds, c)
}
func Retrieve() []cli.Command {
	return cmds
}
func ActionFunc(fn cli.ActionFunc) cli.ActionFunc {
	return func(ctx *cli.Context) error {
		currentContext = ctx
		return fn(ctx)
	}
}
func IsForce() bool {
	return currentContext != nil && currentContext.Bool("force")
}