Interface CliCommand

All Superinterfaces:
io.github.mmm.property.AttributeReadOnly, io.github.mmm.marshall.MarshallableObject, io.github.mmm.marshall.Marshaller<Object>, io.github.mmm.marshall.Marshalling<Object>, io.github.mmm.marshall.MarshallingObject, io.github.mmm.bean.ReadableBean, io.github.mmm.value.ReadablePath, io.github.mmm.marshall.id.StructuredIdMappingObject, io.github.mmm.marshall.UnmarshallableObject, io.github.mmm.marshall.Unmarshaller<Object>, io.github.mmm.validation.Validatable, io.github.mmm.bean.WritableBean, io.github.mmm.value.WritablePath
All Known Subinterfaces:
CliCommandAutoComplete, CliCommandHelp, CliCommandVersion

public interface CliCommand extends io.github.mmm.bean.WritableBean
Interface for a single command of a command-line-interface (CLI). E.g. a help command triggered via "--help" or "-h" prints out the usage, while a version command triggered via "--version" or "-v" prints the program version.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.github.mmm.value.ReadablePath

    io.github.mmm.value.ReadablePath.PathBuilder
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    PropertyAlias to signal that any value including an unmatched option (value starting with a hyphen like "-value") is allowed here.

    Fields inherited from interface io.github.mmm.bean.ReadableBean

    SUFFIX_PROPERTY
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
     
    int
    run(CliMain main)
    Executes this CliCommand.

    Methods inherited from interface io.github.mmm.property.AttributeReadOnly

    isReadOnly

    Methods inherited from interface io.github.mmm.marshall.MarshallableObject

    writeObject

    Methods inherited from interface io.github.mmm.bean.ReadableBean

    copy, doEquals, doToString, get, getAliases, getPropertyCount, isDynamic, isEqualTo, isPolymorphic, isPrototype, mapPropertyIds, newInstance, toString, validate

    Methods inherited from interface io.github.mmm.value.ReadablePath

    parentPath, path, path, path

    Methods inherited from interface io.github.mmm.marshall.UnmarshallableObject

    readObject

    Methods inherited from interface io.github.mmm.validation.Validatable

    validateOrThrow

    Methods inherited from interface io.github.mmm.bean.WritableBean

    addProperty, asTypeKey, createProperty, createProperty, defineIdMapping, getOrCreateProperty, getOrCreateProperty, getProperties, getProperty, getRequiredProperty, getType, pathSegment, pathSegment, read, set, set, set, setDynamic, write

    Methods inherited from interface io.github.mmm.value.WritablePath

    parentPath
  • Field Details

    • ALIAS_WILDCARD

      static final String ALIAS_WILDCARD
      PropertyAlias to signal that any value including an unmatched option (value starting with a hyphen like "-value") is allowed here. Shall never be used together with option alias.
      See Also:
  • Method Details

    • hideFromHelp

      default boolean hideFromHelp()
      Returns:
      true in case this command shall not be included in the help output.
    • run

      int run(CliMain main)
      Executes this CliCommand. Has to be implemented as default method.
      Parameters:
      main - the CliMain program.
      Returns:
      the exit code.