code: public static void main(String[] args) throws Exception {
          if (args == null)
              throw new IllegalArgumentException("Null args");
          if (args.length < 6)
              throw new IllegalArgumentException("Invalid args: " + Arrays.asList(args));
  
          int index = 0;
          if (args[index] == null || args[index].isEmpty()) {
              throw new IllegalArgumentException("No input file");
          }
          File inputFile = new File(args[index++]);
  
          if (args[index] == null) {
              throw new IllegalArgumentException("No profile");
          }
          String profile = args[index++];
  
          if (args[index] == null || args[index].isEmpty()) {
              throw new IllegalArgumentException("No resources dir");
          }
          File resourcesDir = new File(args[index++]);
  
          if (args[index] == null || args[index].isEmpty()) {
              throw new IllegalArgumentException("No modules dir");
          }
          File modulesDir = new File(args[index++]);
  
          String[] staticModules = new String[] {};
          if (args[index] != null && !args[index].isEmpty()) {
              staticModules = args[index].trim().split(SPLIT_PATTERN);
          }
          index++;
  
          if (args[index] == null || args[index].isEmpty()) {
              throw new IllegalArgumentException("No output file");
          }
          File outputFile = new File(args[index]);
  
          new GenerateModulesDefinition(inputFile, profile, resourcesDir, modulesDir, staticModules, outputFile).process();
      }
docs: arg[0] - subsystems definition file as generated by {@link GenerateSubsystemsDefinition}
  arg[1] - subsystem profile (e.g. default)
  arg[2] - resources directory for server definitions (e.g. wildfly/build/src/main/resources)
  arg[3] - modules directory for server definitions (e.g. wildfly/build/target/wildfly-8.0.0/modules)
  arg[4] - a comma separated list of modules to include (e.g. org.jboss.as.standalone,org.jboss.as.console)
  arg[5] - the output file (e.g. target/module-dependencies.txt)