code: @Override
      public ModelNode buildRequestWithoutHeaders(CommandContext ctx) throws CommandFormatException {
          ParsedCommandLine args = ctx.getParsedCommandLine();
          final String path = this.path.getValue(args, true);
  
          final File archive;
          archive = new File(path);
          if(!archive.exists()) {
              throw new OperationFormatException("Path " + archive.getAbsolutePath() + " doesn't exist.");
          }
          if(archive.isDirectory()) {
              throw new OperationFormatException(archive.getAbsolutePath() + " is a directory.");
          }
          File root;
          try {
              root = extractArchive(archive);
          } catch (IOException e) {
              throw new OperationFormatException("Unable to extract archive '" + archive.getAbsolutePath() + "' to temporary location");
          }
  
          ctx.setCurrentDir(root);
          String holdbackBatch = activateNewBatch(ctx);
  
          try {
              String script = this.script.getValue(args);
              if (script == null) {
                  script = "deploy.scr";
              }
  
              File scriptFile = new File(ctx.getCurrentDir(),script);
              if (!scriptFile.exists()) {
                  throw new CommandFormatException("ERROR: script " + script + "' not found.");
              }
              ctx.printLine("Processing script '" + script + "'.");
  
              try (BufferedReader reader = new BufferedReader(new FileReader(scriptFile))) {
                  String line = reader.readLine();
                  while (!ctx.isTerminated() && line != null) {
                      ctx.handle(line);
                      line = reader.readLine();
                  }
              } catch (FileNotFoundException e) {
                  throw new CommandFormatException("ERROR: script " + script + "' not found.");
              } catch (IOException e) {
                  throw new CommandFormatException(e.getMessage());
              } catch (CommandLineException e) {
                  throw new CommandFormatException(e.getMessage());
              }
  
              ModelNode composite = ctx.getBatchManager().getActiveBatch().toRequest();
  
              return composite;
          } finally {
              // reset current dir in context
              ctx.setCurrentDir(new File(""));
              discardBatch(ctx, holdbackBatch);
              recursiveDelete(root);
          }
      }
docs: /* (non-Javadoc)
  @see org.jboss.as.cli.OperationCommand#buildRequest(org.jboss.as.cli.CommandContext)