Using Position and Named Arguments while Defining TeaParam

The definition of TeaParam provides four options when it comes to supporting positions and named arguments: position only, position and named arguments without an alias, position and named arguments with an alias, and named argument only.

The following is the usage of the four ways of defining the positions and named arguments:
  • Position only:
    TeaParam definition
    
    public String testA(@TeaParam(name = "aa", description = "Greetings parameter", alias = "") final long[] greetings)
    Usage
    
    shell> testA [12,15]
  • Position and named arguments without an alias:
    TeaParam definition
    public String testA(@TeaParam(name = "aa", description = "Greetings parameter") final long[] greetings)
    
    Usage
    shell> testA [12,15] 
    shell> testA -aa [12,15] 
    shell> testA --aa [12,15] 
  • Position and named arguments with an alias:
    TeaParam definition
    public String testA(@TeaParam(name = "aa", description = "Greetings parameter", alias="bb") final long[] greetings)
    
    Usage
    shell> testA [12,15] 
    shell> testA -aa [12,15] 
    shell> testA --aa [12,15] 
    shell> testA -bb [12,15] 
    shell> testA --bb [12,15] 
  • Named argument only:
    TeaParam definition
    public String testA(@TeaParam(name = "aa", description = "Greetings parameter", alias="aa") final long[] greetings)
    
    Usage
    shell> testA -aa [12,15] 
    shell> testA --aa [12,15]