code: private String getAndAddUniqueShortName(String name) {
          // Capitalize the first letter of the name.
          String initCappedName = name.substring(0, 1).toUpperCase() + name.substring(1, name.length());
          // Make the short name all the capital letters in the long name.
          Matcher matcher = capitals.matcher(initCappedName);
          StringBuilder sbShortName = new StringBuilder();
          while(matcher.find()) {
              sbShortName.append(matcher.group());
          }
          String shortName = sbShortName.toString().toLowerCase();
  
          if (!shortNames.add(shortName)) {
              int i;
              for (i=0; i<10; i++) {
                  String tmpsn = shortName + i;
                  if (shortNames.add(tmpsn)) {
                      shortName = tmpsn;
                      break;
                  }
              }
              if (i == 10) {
                  throw new RuntimeException("Multiple options have the same short name: -" + shortName  + " (--" + name + ")");
              }
          }
          return shortName;
      }
docs: Creates a unique short name from the name of a field. For example, the field "trainPredOut"
  would have a long name of "--trainPredOut" and a short name of "-tpo".