Skip to content

Commit

Permalink
Document /denizen submit command
Browse files Browse the repository at this point in the history
  • Loading branch information
aufdemrand committed Oct 30, 2013
1 parent 99fd465 commit 5a2a626
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions src/main/java/net/aufdemrand/denizen/CommandHandler.java
Expand Up @@ -699,9 +699,20 @@ public void chatbot(CommandContext args, CommandSender sender, NPC npc) throws C
}


/*
* DENIZEN SUBMIT
*/
// <--[language]
// @name /denizen submit command
// @description
// Using the /denizen submit command interfaces with Denizen's dBugger to allow control
// over debug messages.
//
// To enable debugging mode, simply type '/denizen debug'. While debug is enabled, all debuggable
// scripts, and any invoked actions, will output information to the console as they are executed.
// By default, all scripts are debuggable while the dBugger is enabled. To disable a script
// specifically from debugging, simply add the 'debug:' node with a value of 'false' to your script
// container. This is typically used to silence particularly spammy scripts. Any kind of script
// container can be silenced using this method.
//
// -->
@Command(
aliases = { "denizen" }, usage = "submit",
desc = "Submits recorded logs triggered by /denizen debug -r", modifiers = { "submit" },
Expand Down Expand Up @@ -759,6 +770,8 @@ public void run() {
// '-e' enables/disables world event timings. While enabled, the dBugger will show all triggered events.
// '-s' enables/disables stacktraces generated by Denizen. We might ask you to enable this when problems arise.
// '-b' enables/disables the ScriptBuilder debug. When enabled, Denizen will show info on script and argument creation.
// Warning: Can be spammy.
// '-n' enables/disables debug trimming. When enabled, messages longer than 512 characters will be 'snipped'.
//
// The dBugger also allows the targeting of specific scripts by using the '--filter script_name' argument. For
// example: /denizen debug --filter 'my script|my other script' will instruct the dBugger to only debug the
Expand Down Expand Up @@ -811,6 +824,12 @@ public void debug(CommandContext args, CommandSender sender, NPC npc) throws Com
dB.filter = new ArrayList<String>();
Messaging.send(sender, ChatColor.YELLOW + "Denizen dBugger filter removed.");

} if (args.hasFlag('n')) {
if (!dB.showDebug) dB.toggle();
dB.shouldTrim = !dB.shouldTrim;
Messaging.send(sender, ChatColor.YELLOW + (dB.shouldTrim ? "Denizen dBugger is now trimming long messages."
: "Denizen dBugger is no longer trimming long messages."));

} if (args.hasValueFlag("filter")) {
if (!dB.showDebug) dB.toggle();
for (String filter : args.getFlag("filter").split("\\|"))
Expand Down

0 comments on commit 5a2a626

Please sign in to comment.