code: public static void main(String[] args) throws Exception{
          if (args == null)
              throw new IllegalArgumentException("Null args");
          if (args.length < 4)
              throw new IllegalArgumentException("Invalid args: " + Arrays.asList(args));
  
          // spec := subsystem:supplement
          // definitions := definitions,spec
  
          int index = 0;
          if (args[index] == null || args[index].isEmpty()) {
              throw new IllegalArgumentException("No configured subsystems");
          }
          String definitions = args[index++];
  
          String[] profiles = new String[]{""};
          if (args[index] != null && !args[index].isEmpty()) {
              profiles = args[index].split(",");
          }
          index++;
  
          if (args[index] == null || args[index].isEmpty()) {
              throw new IllegalArgumentException("No file prefix");
          }
          String filePrefix = args[index++];
          if (!filePrefix.endsWith("/"))
              filePrefix += "/";
  
          if (args[index] == null || args[index].isEmpty()) {
              throw new IllegalArgumentException("No output file");
          }
          File outputFile = new File(args[index++]);
  
          List<SubsystemConfig> configs = new ArrayList<SubsystemConfig>();
          for (String spec : definitions.split(",")) {
              String[] split = spec.split(":");
              String subsystem = split[0];
              String supplement = split.length > 1 ? split[1] : null;
              configs.add(new SubsystemConfig(subsystem, supplement));
          }
          new GenerateSubsystemsDefinition(configs, profiles, filePrefix, outputFile).process();
      }
docs: arg[0] - subsystems definition spec (e.g logging:osgi,osgi:eager,deployment-scanner)
  arg[1] - subsytem profiles (e.g. default,ha,full,full-ha)
  arg[2] - subsystem path prefix (e.g. configuration/subsystems)
  arg[4] - the output file (e.g. domain-subsystems.xml)