summaryrefslogtreecommitdiffstats
path: root/src/test/java/com/beust/jcommander/args/VariableArity.java
blob: ec4130efb9081c1e7c392584ad07c4b09a7d465d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.beust.jcommander.args;

import com.beust.jcommander.IVariableArity;
import com.beust.jcommander.Parameter;

import java.util.ArrayList;
import java.util.List;

public class VariableArity implements IVariableArity {

  private int count;

  public VariableArity(int count) {
    this.count = count;
  }

  @Parameter
  public List<String> main = new ArrayList<>();

  @Parameter(names = "-variable", variableArity = true)
  public List<String> var = new ArrayList<>();

  public int processVariableArity(String optionName, String[] options) {
    return count;
  }
}