Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dha-lo-jd/ad5a0f933d72ea404d2b to your computer and use it in GitHub Desktop.
Save dha-lo-jd/ad5a0f933d72ea404d2b to your computer and use it in GitHub Desktop.
public class ArgsPicker {
private int i = 0;
private final String[] args;
public ArgsPicker(String[] args) {
this.args = args;
}
public String nextArg(String defaultValue) {
String result = defaultValue;
if (args != null) {
if (args.length > i) {
result = args[i++];
}
}
return result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment