public final String generateUsage(CommandInvocation invocation, CommandDescriptor descriptor, String... labels)
    {
        List<String> labelList;
        if (labels != null && labels.length > 0)
        {
            labelList = Arrays.asList(labels);
        }
        else if (invocation == null)
        {
            labelList = getNames(descriptor);
            Collections.reverse(labelList);
        }
        else
        {
            labelList = invocation.getLabels();
        }
        return getPrefix(invocation) + join(" ", labelList) + " " + this.generateParameterUsage(invocation, descriptor).trim();
    }