CLI: --help is default option v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Fri, 20 Dec 2013 16:34:07 +0100
branchv_0
changeset 21d42ed0d10a10
parent 20 e225bdcd260e
child 22 37fe883f8410
CLI: --help is default option
java/sql-dk/src/info/globalcode/sql/dk/CLIStarter.java
     1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/CLIStarter.java	Mon Dec 16 23:17:34 2013 +0100
     1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/CLIStarter.java	Fri Dec 20 16:34:07 2013 +0100
     1.3 @@ -32,11 +32,17 @@
     1.4  	private Configuration configuration;
     1.5  
     1.6  	public static void main(String[] args) {
     1.7 +
     1.8 +		if (args.length == 0) {
     1.9 +			args = new String[]{CLIParser.Tokens.INFO_HELP};
    1.10 +		}
    1.11 +
    1.12  		try {
    1.13  			CLIParser parser = new CLIParser();
    1.14  			CLIOptions options = parser.parseOptions(args);
    1.15  			options.validate();
    1.16  			CLIStarter starter = new CLIStarter(options);
    1.17 +			starter.installDefaultConfiguration();
    1.18  			starter.process();
    1.19  		} catch (CLIParserException e) {
    1.20  			log.log(Level.SEVERE, "Unable to parse CLI options", e);
    1.21 @@ -76,7 +82,6 @@
    1.22  	@Override
    1.23  	public Configuration getConfiguration() {
    1.24  		if (configuration == null) {
    1.25 -			installDefaultConfiguration();
    1.26  			configuration = loadConfiguration();
    1.27  		}
    1.28  		return configuration;