package org.ethereum;

import org.ethereum.cli.CLIInterface;
import org.ethereum.config.SystemProperties;
import org.ethereum.facade.Ethereum;
import org.ethereum.facade.EthereumFactory;

import java.io.IOException;
import java.net.URISyntaxException;

/**
 * @author Roman Mandeleil
 * @since 14.11.2014
 */
public class Start {

    public static void main(String args[]) throws IOException, URISyntaxException {
        CLIInterface.call(args);

        if (!SystemProperties.getDefault().blocksLoader().equals("")) {
            SystemProperties.getDefault().setSyncEnabled(false);
            SystemProperties.getDefault().setDiscoveryEnabled(false);
        }

        Ethereum ethereum = EthereumFactory.createEthereum();

        if (!SystemProperties.getDefault().blocksLoader().equals(""))
            ethereum.getBlockLoader().loadBlocks();
    }

}

@@ -179,16 +179,49 @@
 Factory;
+%0Aimport org.ethereum.mine.Ethash;
 %0A%0Aimport
@@ -487,42 +487,121 @@
     
-if (!SystemProperties.getDefault()
+final SystemProperties config = SystemProperties.getDefault();%0A        final boolean actionBlocksLoader = !config
 .blo
@@ -626,11 +626,9 @@
 (%22%22)
-) %7B
+;
 %0A   
@@ -636,41 +636,167 @@
     
-    SystemProperties.getDefault()
+final boolean actionGenerateDag = config.getConfig().hasPath(%22ethash.blockNumber%22);%0A%0A%0A        if (actionBlocksLoader %7C%7C actionGenerateDag) %7B%0A            config
 .set
@@ -831,37 +831,14 @@
     
-SystemProperties.getDefault()
+config
 .set
@@ -952,117 +952,311 @@
 if (
-!SystemProperties.getDefault().blocksLoader().equals(%22%22))%0A            ethereum.getBlockLoader().loadBlocks();
+actionBlocksLoader) %7B%0A            ethereum.getBlockLoader().loadBlocks();%0A        %7D else if (actionGenerateDag) %7B%0A            new Ethash(config, config.getConfig().getLong(%22ethash.blockNumber%22)).getFullDataset();%0A            // DAG file has been created, lets exit%0A            System.exit(0);%0A        %7D%0A
 %0A   

Add ability to generate DAG file via command line