func ToMap(flags []string, trimPrefix string) map[string]string {
	flagMap := make(map[string]string)
	for _, flag := range flags {
		if len(flag) == 0 {
			continue
		}
		part := strings.SplitN(flag, "=", 2)
		k := strings.TrimPrefix(strings.TrimSpace(part[0]), trimPrefix)
		if len(part) == 1 {
			flagMap[k] = "true"
		} else {
			flagMap[k] = strings.TrimSpace(part[1])
		}
	}
	return flagMap
}
// ToMap converts the flags string slice to a map, the map key removes the trimPrefix prefix
ToMap converts the flags string slice to a map, the map key removes the trimPrefix prefix
// ToMap converts the flags string slice to a map the map key removes the trimPrefix prefix
func ToMap(flags []string, trimPrefix string) map[string]string {
	flagMap := make(map[string]string)
	for _, flag := range flags {
		if len(flag) == 0 {
			continue
		}
		part := strings.SplitN(flag, "=", 2)
		k := strings.TrimPrefix(strings.TrimSpace(part[0]), trimPrefix)
		if len(part) == 1 {
			flagMap[k] = "true"
		} else {
			flagMap[k] = strings.TrimSpace(part[1])
		}
	}
	return flagMap
}
func ToMap ( flags [ ] string , trimPrefix string ) map [ string ] string { flagMap := make ( map [ string ] string ) for _ , flag := range flags { if len ( flag ) == 0 { continue } part := strings . SplitN ( flag , " " , 2 ) k := strings . TrimPrefix ( strings . TrimSpace ( part [ 0 ] ) , trimPrefix ) if len ( part ) == 1 { flagMap [ k ] = " " } else { flagMap [ k ] = strings . TrimSpace ( part [ 1 ] ) } } return flagMap }
ToMap converts the flags string slice to a map, the map key removes the trimPrefix prefix
ToMap converts the flags string slice to a map the map key removes the trimPrefix prefix