/** * Check to see if all arguments, including flag arguments, were consumed. * * @param scoped the argument scope * @throws UnconsumedParameterException thrown if parameters were not consumed */ private void checkUnconsumed(ContextArgumentStack scoped) throws UnconsumedParameterException { CommandContext context = scoped.getContext(); String unconsumed; String unconsumedFlags = getUnusedFlags(context); if ((unconsumed = scoped.getUnconsumed()) != null) { throw new UnconsumedParameterException(unconsumed + " " + unconsumedFlags); } if (unconsumedFlags != null) { throw new UnconsumedParameterException(unconsumedFlags); } }