func titleCaseDashes(key string) string {
	nextToUpper := true
	mapFn := func(r rune) rune {
		if r == '-' {
			nextToUpper = true
			return -1
		}
		if nextToUpper {
			nextToUpper = false
			return unicode.ToUpper(r)
		}
		return r
	}
	return strings.Map(mapFn, key)
}
Convert a string like "--my-special-flag" to "MySpecialFlag".
package docopt
import (
	"fmt"
	"reflect"
	"strconv"
	"strings"
	"unicode"
)
func errKey(key string) error {
	return fmt.Errorf("no such key: %q", key)
}
func errType(key string) error {
	return fmt.Errorf("key: %q failed type conversion", key)
}
func errStrconv(key string, convErr error) error {
	return fmt.Errorf("key: %q failed type conversion: %s", key, convErr)
}
type Opts map[string]interface{}
func (o Opts) String(key string) (s string, err error) {
	v, ok := o[key]
	if !ok {
		err = errKey(key)
		return
	}
	s, ok = v.(string)
	if !ok {
		err = errType(key)
	}
	return
}
func (o Opts) Bool(key string) (b bool, err error) {
	v, ok := o[key]
	if !ok {
		err = errKey(key)
		return
	}
	b, ok = v.(bool)
	if !ok {
		err = errType(key)
	}
	return
}
func (o Opts) Int(key string) (i int, err error) {
	s, err := o.String(key)
	if err != nil {
		return
	}
	i, err = strconv.Atoi(s)
	if err != nil {
		err = errStrconv(key, err)
	}
	return
}
func (o Opts) Float64(key string) (f float64, err error) {
	s, err := o.String(key)
	if err != nil {
		return
	}
	f, err = strconv.ParseFloat(s, 64)
	if err != nil {
		err = errStrconv(key, err)
	}
	return
}
func (o Opts) Bind(v interface{}) error {
	structVal := reflect.ValueOf(v)
	if structVal.Kind() != reflect.Ptr {
		return newError("'v' argument is not pointer to struct type")
	}
	for structVal.Kind() == reflect.Ptr {
		structVal = structVal.Elem()
	}
	if structVal.Kind() != reflect.Struct {
		return newError("'v' argument is not pointer to struct type")
	}
	structType := structVal.Type()
	tagged := make(map[string]int)    
	untagged := make(map[string]int)  
	for i := 0; i < structType.NumField(); i++ {
		field := structType.Field(i)
		if isUnexportedField(field) || field.Anonymous {
			continue
		}
		tag := field.Tag.Get("docopt")
		if tag == "" {
			untagged[field.Name] = i
			continue
		}
		for _, t := range strings.Split(tag, ",") {
			tagged[t] = i
		}
	}
	getFieldIndex := func(key string) (int, bool) {
		if i, ok := tagged[key]; ok {
			return i, true
		}
		if i, ok := untagged[guessUntaggedField(key)]; ok {
			return i, true
		}
		return -1, false
	}
	indexMap := make(map[string]int)  
	for k := range o {
		i, ok := getFieldIndex(k)
		if !ok {
			if k == "--help" || k == "--version" {  
				continue
			}
			return newError("mapping of %q is not found in given struct, or is an unexported field", k)
		}
		fieldVal := structVal.Field(i)
		zeroVal := reflect.Zero(fieldVal.Type())
		if !reflect.DeepEqual(fieldVal.Interface(), zeroVal.Interface()) {
			return newError("%q field is non-zero, will be overwritten by value of %q", structType.Field(i).Name, k)
		}
		indexMap[k] = i
	}
	for k, v := range o {
		i, ok := indexMap[k]
		if !ok {
			continue  
		}
		field := structVal.Field(i)
		if !reflect.DeepEqual(field.Interface(), reflect.Zero(field.Type()).Interface()) {
			continue
		}
		optVal := reflect.ValueOf(v)
		if !optVal.IsValid() {
			continue
		}
		if !field.CanSet() {
			return newError("%q field cannot be set", structType.Field(i).Name)
		}
		if optVal.Type().AssignableTo(field.Type()) {
			field.Set(optVal)
			continue
		}
		switch field.Kind() {
		case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
			if x, err := o.Int(k); err == nil {
				field.SetInt(int64(x))
				continue
			}
		case reflect.Float32, reflect.Float64:
			if x, err := o.Float64(k); err == nil {
				field.SetFloat(x)
				continue
			}
		}
		return newError("value of %q is not assignable to %q field", k, structType.Field(i).Name)
	}
	return nil
}
func isUnexportedField(field reflect.StructField) bool {
	return !(field.PkgPath == "" && unicode.IsUpper(rune(field.Name[0])))
}