Verifying commands

I’m working on something were I want to “verify” a command. The command wouldn’t necessarily be known, or from a CommandSpec. I was wondering if (besides checking the commands existence), there was any other way to verify it. Moreover, I’d especially like to pass in a fully argument-ed command and receive either:

  1. A boolean/object representing the “parse result”
  2. A boolean being true if the command exists, and false otherwise
    or both.

Another thing: how does sponge determine the (base) name of the command? Is the name of the command simply the characters up to the first space, or are other parsing facilities implemented?

I haven’t looked into any of this a huge amount, so any help is appreciated!

The base name of a command is the characters up to the first space. And: There is no way to check the ‘parse result’ of a command. A CommandSpec only performs parsing when it is about to execute the command. A generic CommandCallable performs all its logic in the same method - you can’t check what the first half of the processing does without executing the second half. And you can very very easily do Game.getCommandManager().get(String) in a SendCommandEvent.