gt:                     String flag = args[1];
context: ////////////////////////////////////////////////////////////////////////////////////////////////////
  // PlotSquared - A plot manager and world generator for the Bukkit API                             /
  // Copyright (c) 2014 IntellectualSites/IntellectualCrafters                                       /
  //                                                                                                 /
  // This program is free software; you can redistribute it and/or modify                            /
  // it under the terms of the GNU General Public License as published by                            /
  // the Free Software Foundation; either version 3 of the License, or                               /
  // (at your option) any later version.                                                             /
  //                                                                                                 /
  // This program is distributed in the hope that it will be useful,                                 /
  // but WITHOUT ANY WARRANTY; without even the implied warranty of                                  /
  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                   /
  // GNU General Public License for more details.                                                    /
  //                                                                                                 /
  // You should have received a copy of the GNU General Public License                               /
  // along with this program; if not, write to the Free Software Foundation,                         /
  // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA                               /
  //                                                                                                 /
  // You can contact us via: support@intellectualsites.com                                           /
  ////////////////////////////////////////////////////////////////////////////////////////////////////
  package com.intellectualcrafters.plot.commands;
  
  import java.io.File;
  import java.io.FileNotFoundException;
  import java.io.IOException;
  import java.io.PrintWriter;
  import java.nio.charset.StandardCharsets;
  import java.sql.Timestamp;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.Date;
  import java.util.HashMap;
  import java.util.List;
  import java.util.UUID;
  
  import javax.script.Bindings;
  import javax.script.ScriptContext;
  import javax.script.ScriptEngine;
  import javax.script.ScriptEngineManager;
  import javax.script.ScriptException;
  import javax.script.SimpleScriptContext;
  
  import com.google.common.io.Files;
  import com.intellectualcrafters.plot.PS;
  import com.intellectualcrafters.plot.config.C;
  import com.intellectualcrafters.plot.config.Settings;
  import com.intellectualcrafters.plot.database.DBFunc;
  import com.intellectualcrafters.plot.flag.FlagManager;
  import com.intellectualcrafters.plot.generator.HybridUtils;
  import com.intellectualcrafters.plot.object.ChunkLoc;
  import com.intellectualcrafters.plot.object.ConsolePlayer;
  import com.intellectualcrafters.plot.object.Location;
  import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
  import com.intellectualcrafters.plot.object.Plot;
  import com.intellectualcrafters.plot.object.PlotAnalysis;
  import com.intellectualcrafters.plot.object.PlotBlock;
  import com.intellectualcrafters.plot.object.PlotId;
  import com.intellectualcrafters.plot.object.PlotPlayer;
  import com.intellectualcrafters.plot.object.RunnableVal;
  import com.intellectualcrafters.plot.util.AbstractTitle;
  import com.intellectualcrafters.plot.util.BlockManager;
  import com.intellectualcrafters.plot.util.ChunkManager;
  import com.intellectualcrafters.plot.util.EconHandler;
  import com.intellectualcrafters.plot.util.EventUtil;
  import com.intellectualcrafters.plot.util.ExpireManager;
  import com.intellectualcrafters.plot.util.MainUtil;
  import com.intellectualcrafters.plot.util.MathMan;
  import com.intellectualcrafters.plot.util.Permissions;
  import com.intellectualcrafters.plot.util.SchematicHandler;
  import com.intellectualcrafters.plot.util.SetupUtils;
  import com.intellectualcrafters.plot.util.StringMan;
  import com.intellectualcrafters.plot.util.TaskManager;
  import com.intellectualcrafters.plot.util.UUIDHandler;
  import com.plotsquared.bukkit.util.BukkitHybridUtils;
  import com.plotsquared.general.commands.Command;
  import com.plotsquared.general.commands.CommandCaller;
  import com.plotsquared.general.commands.CommandDeclaration;
  
  @CommandDeclaration(
          command = "debugexec",
          permission = "plots.admin",
          description = "Mutli-purpose debug command",
          aliases = {"exec"},
          category = CommandCategory.DEBUG
  )
  public class DebugExec extends SubCommand {
  
      private ScriptEngine engine;
      private Bindings scope;
      
      public DebugExec() {
          try {
              File file = new File(PS.get().IMP.getDirectory(), "scripts" + File.separator + "start.js");
              if (file.exists()) {
                  init();
                      String script = StringMan.join(Files.readLines(new File(new File(PS.get().IMP.getDirectory() + File.separator + "scripts"), "start.js"), StandardCharsets.UTF_8), System.getProperty("line.separator"));
                      scope.put("THIS", this);
                      scope.put("PlotPlayer", ConsolePlayer.getConsole());
                      engine.eval(script, scope);
              }
          } catch (Exception e) {
          }
      }
      
      public ScriptEngine getEngine() {
          return engine;
      }
      
      public Bindings getScope() {
          return scope;
      }
      
      public void init() {
          if (engine != null) {
              return;
          }
          engine = (new ScriptEngineManager(null)).getEngineByName("nashorn");
          if (engine == null) {
              engine = (new ScriptEngineManager(null)).getEngineByName("JavaScript");
          }
          ScriptContext context = new SimpleScriptContext();
          scope = context.getBindings(ScriptContext.ENGINE_SCOPE);
          
          // stuff
          scope.put("MainUtil", new MainUtil());
          scope.put("Settings", new Settings());
          scope.put("StringMan", new StringMan());
          scope.put("MathMan", new MathMan());
          scope.put("FlagManager", new FlagManager());
          
          // Classes
          scope.put("Location", Location.class);
          scope.put("PlotBlock", PlotBlock.class);
          scope.put("Plot", Plot.class);
          scope.put("PlotId", PlotId.class);
          scope.put("Runnable", Runnable.class);
          scope.put("RunnableVal", RunnableVal.class);
          
          // Instances
          scope.put("PS", PS.get());
          scope.put("TaskManager", PS.get().TASK);
          scope.put("TitleManager", AbstractTitle.TITLE_CLASS);
          scope.put("ConsolePlayer", ConsolePlayer.getConsole());
          scope.put("SchematicHandler", SchematicHandler.manager);
          scope.put("ChunkManager", ChunkManager.manager);
          scope.put("BlockManager", BlockManager.manager);
          scope.put("SetupUtils", SetupUtils.manager);
          scope.put("EventUtil", EventUtil.manager);
          scope.put("EconHandler", EconHandler.manager);
          scope.put("UUIDHandler", UUIDHandler.implementation);
          scope.put("DBFunc", DBFunc.dbManager);
          scope.put("HybridUtils", HybridUtils.manager);
          scope.put("IMP", PS.get().IMP);
          scope.put("MainCommand", MainCommand.getInstance());
          
          // enums
          for (Enum<?> value : C.values()) {
              scope.put("C_" + value.name(), value);
          }
      }
      
      @Override
      public boolean onCommand(final PlotPlayer player, String... args) {
          final List<String> allowed_params = Arrays.asList("calibrate-analysis", "remove-flag", "stop-expire", "start-expire", "show-expired", "update-expired", "seen", "trim-check");
          if (args.length > 0) {
              final String arg = args[0].toLowerCase();
              String script;
              boolean async = false;
              switch (arg) {
                  case "analyze": {
                      Plot plot = MainUtil.getPlot(player.getLocation());
                      if (plot == null) {
                          MainUtil.sendMessage(player, C.NOT_IN_PLOT);
                          return false;
                      }
                      PlotAnalysis analysis = plot.getComplexity();
                      if (analysis != null) {
                          int complexity = analysis.getComplexity();
                          MainUtil.sendMessage(player, "Changes: " + analysis.changes);
                          MainUtil.sendMessage(player, "Complexity: " + complexity);
                          return true;
                      }
                      MainUtil.sendMessage(player, "$1Starting task...");
                      HybridUtils.manager.analyzePlot(plot, new RunnableVal<PlotAnalysis>() {
                          @Override
                          public void run() {
                              MainUtil.sendMessage(player, "$1Done: $2use $3/plot debugexec analyze$2 for more information");
                          }
                      });
                      return true;
                  }
                  case "calibrate-analysis": {
                      if (args.length != 2) {
                          MainUtil.sendMessage(player, C.COMMAND_SYNTAX, "/plot debugexec analyze <threshold>");
                          MainUtil.sendMessage(player, "$1<threshold> $2= $1The percentage of plots you want to clear (100 clears 100% of plots so no point calibrating it)");
                          return false;
                      }
                      double threshold;
                      try {
                          threshold = Integer.parseInt(args[1]) / 100d;
                      }
                      catch (NumberFormatException e) {
                          MainUtil.sendMessage(player, "$2Invalid threshold: " + args[1]);
                          MainUtil.sendMessage(player, "$1<threshold> $2= $1The percentage of plots you want to clear as a number between 0 - 100");
                          return false;
                      }
                      PlotAnalysis.calcOptimalModifiers(new Runnable() {
                          @Override
                          public void run() {
                              MainUtil.sendMessage(player, "$1Thank you for calibrating PlotSquared plot expiry");
                          }
                      }, threshold);
                      return true;
                  }
                  case "stop-expire": {
                      if (ExpireManager.task != -1) {
                          PS.get().TASK.cancelTask(ExpireManager.task);
                      } else {
                          return MainUtil.sendMessage(player, "Task already halted");
                      }
                      ExpireManager.task = -1;
                      return MainUtil.sendMessage(player, "Cancelled task.");
                  }
                  case "remove-flag": {
                      if (args.length != 2) {
                          MainUtil.sendMessage(player, C.COMMAND_SYNTAX, "/plot debugexec remove-flag <flag>");
                          return false;
                      }
  