Annotation Type Cli


  • @Target(TYPE)
    @Retention(RUNTIME)
    @Documented
    public @interface Cli
    Class annotation used to declaratively specify a CLI
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.String name
      Sets the name of the CLI i.e.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.Class<?>[] commands
      Defines the classes that provide top-level commands for the CLI
      java.lang.Class<?> defaultCommand
      Defines the class that provides the default command for the CLI
      java.lang.String description
      Sets the description of the CLI
      Group[] groups
      Defines command groups for the CLI
      boolean includeDefaultRestrictions
      Sets whether the default global restrictions are applied
      Parser parserConfiguration
      Sets the parser configuration for the CLI
      java.lang.Class<? extends GlobalRestriction>[] restrictions
      Defines the classes that provide global restrictions for the CLI
    • Element Detail

      • name

        java.lang.String name
        Sets the name of the CLI i.e. the command name users enter to invoke your CLI
        Returns:
        Name
      • description

        java.lang.String description
        Sets the description of the CLI
        Returns:
        Description
        Default:
        ""
      • parserConfiguration

        Parser parserConfiguration
        Sets the parser configuration for the CLI
        Returns:
        Parser Configuration
        Default:
        @com.github.rvesse.airline.annotations.Parser
      • groups

        Group[] groups
        Defines command groups for the CLI
        Returns:
        Command groups
        Default:
        {}
      • defaultCommand

        java.lang.Class<?> defaultCommand
        Defines the class that provides the default command for the CLI
        Returns:
        Default command class
        Default:
        com.github.rvesse.airline.annotations.Cli.NO_DEFAULT.class
      • commands

        java.lang.Class<?>[] commands
        Defines the classes that provide top-level commands for the CLI
        Returns:
        Top-level command classes
        Default:
        {}
      • restrictions

        java.lang.Class<? extends GlobalRestriction>[] restrictions
        Defines the classes that provide global restrictions for the CLI
        Returns:
        Global restriction classes
        Default:
        {}
      • includeDefaultRestrictions

        boolean includeDefaultRestrictions
        Sets whether the default global restrictions are applied
        Returns:
        True if default restrictions are applied, false otherwise
        Default:
        true