class HyphenFormatter {

  public String formatCommand(String command) {
    if (!containsOption(command)) {
      return command;
    }
    this.formatted = new StringBuilder();

    List<String> strings = split(command);
    for (String string : strings) {
      if (string.contains(EQUAL_HYPHEN)) {
        int indexOfEquals = string.indexOf(EQUAL);
        formatted.append(string.substring(0, indexOfEquals + 1));
        formatted.append(QUOTE);
        formatted.append(string.substring(indexOfEquals + 1));
        formatted.append(QUOTE);
      } else {
        formatted.append(string);
      }
      formatted.append(SPACE);
    }
    return formatted.toString().trim();
  }

}