Package picocli

Annotation Interface CommandLine.Spec

Enclosing class:
CommandLine

@Retention(RUNTIME) @Target({FIELD,METHOD}) public static @interface CommandLine.Spec
Fields annotated with @Spec will be initialized with the CommandSpec for the command the field is part of. Example usage:
 class InjectSpecExample implements Runnable {
     @Spec CommandSpec commandSpec;
     //...
     public void run() {
         // do something with the injected objects
     }
 }
 
Since:
3.2
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Identifies what kind of CommandSpec should be injected.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Whether to inject the CommandSpec of this command (the default) or the CommandSpec of the "mixee" command that receives the options and other command elements defined here.
  • Element Details

    • value

      Whether to inject the CommandSpec of this command (the default) or the CommandSpec of the "mixee" command that receives the options and other command elements defined here.
      Since:
      4.3.0
      See Also:
      Default:
      SELF