def format_command_help(default, commands):
    """Format the docstrings of the commands.
    """
    string = ("available commands:\n\n" +
              "".join(["  "
                       + "%-22s" % (command.__name__
                                    + (' (default)'
                                       if command == default else '')
                                    + ':')
                       + "".join(command.__doc__.replace(
                           "\n    ", " ").split(".")[0])
                       + "\n"
                       for command in commands
                       if command.__doc__ is not None]))
    return string