code: func reorderArgs(args []string) []string {
  	var nonflags, flags []string
  
  	readFlagValue := false
  	for i, arg := range args {
  		if arg == "--" {
  			nonflags = append(nonflags, args[i:]...)
  			break
  		}
  
  		if readFlagValue && !strings.HasPrefix(arg, "-") && !strings.HasPrefix(arg, "--") {
  			readFlagValue = false
  			flags = append(flags, arg)
  			continue
  		}
  		readFlagValue = false
  
  		if arg != "-" && strings.HasPrefix(arg, "-") {
  			flags = append(flags, arg)
  
  			readFlagValue = !strings.Contains(arg, "=")
  		} else {
  			nonflags = append(nonflags, arg)
  		}
  	}
  
  	return append(flags, nonflags...)
  }
docs: // reorderArgs moves all flags before arguments as this is what flag expects