blob: c062fff87e1e8c599ed98202ecdc8984ccf93f7a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
package joptsimple.examples;
import joptsimple.OptionParser;
public class RequiredIfExample {
public static void main( String[] args ) {
OptionParser parser = new OptionParser();
parser.accepts( "ftp" );
parser.accepts( "username" ).requiredIf( "ftp" ).withRequiredArg();
parser.accepts( "password" ).requiredIf( "ftp" ).withRequiredArg();
parser.parse( "--ftp" );
}
}
|