private List<String> split(String cmd) {
    List<String> strings = new ArrayList<>();
    Matcher matcher = Pattern.compile(OPTION_PATTERN).matcher(cmd);

    int index = 0; // first index of --option=

    while (matcher.find()) {
      if (matcher.start() > index) {
        String option = cmd.substring(index, matcher.start()).trim();
        strings.add(option);
      }
      index = matcher.start();
    }

    String lastOne = cmd.substring(index);
    if (lastOne != null) {
      strings.add(lastOne);
    }

    return strings;
  }
Returns true if command contains any options.
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/util/HyphenFormatter.java