class FileCompleterGenerator {

    String generateCompleterFile(CommandLineParser<CommandInvocation> command) {
         StringBuilder out = new StringBuilder();

        out.append(generateHeader(command.getProcessedCommand().name()));

        if(command.isGroupCommand())
            out.append(generateArrContains());

        out.append(generateMainCompletion(command));

        out.append(generateCommand(command)) ;
        if(command.isGroupCommand())
            for(CommandLineParser<CommandInvocation> child : command.getAllChildParsers())
                out.append(generateCommand(child));

        out.append(generateFooter(command.getProcessedCommand().name()));

        return out.toString();
    }

}