code: private static <T extends Enum<T>> String getEnumOptions(final Class<T> clazz) {
          // We assume that clazz is guaranteed to be a Class<? extends Enum>, thus
          // getEnumConstants() won't ever return a null.
          final T[] enumConstants = clazz.getEnumConstants();
          if (enumConstants.length == 0) {
              throw new CommandLineException(String.format("Bad argument enum type '%s' with no options", clazz.getName()));
          }
  
          if (CommandLineParser.ClpEnum.class.isAssignableFrom(clazz)) {
              return Stream.of(enumConstants)
                      .map(c -> String.format("%s (%s)", c.name(), ((CommandLineParser.ClpEnum) c).getHelpDoc()))
                      .collect(Collectors.joining("\n"));
          } else {
              return Stream.of(enumConstants)
                      .map(T::name)
                      .collect(Collectors.joining(", ", OPTION_DOC_PREFIX, OPTION_DOC_SUFFIX));
          }
      }
docs: Composes the help string on the possible options an {@link Enum} typed argument can take.
  
  @param clazz target enum class. Assumed no to be {@code null}.
  @param <T> enum class type.
  @throws CommandLineException if {@code &lt;T&gt;} has no constants.
  @return never {@code null}.