def get_help_usage(command):
    # type: (str) -> None
    """Print out a help message and exit the program.

    Args:
        command: If a command value is supplied then print the help message for
            the command module if available. If the command is '-a' or '--all',
            then print the standard help message but with a full list of
            available commands.

    Raises:
        ValueError: Raised if the help message is requested for an invalid
            command or an unrecognized option is passed to help.
    """
    if not command:
        doc = get_primary_command_usage()
    elif command in ('-a', '--all'):
        subcommands = [k for k in settings.subcommands if k is not None]
        available_commands = subcommands + ['help']
        command_doc = '\nAvailable commands:\n{}\n'.format(
            '\n'.join('  {}'.format(c) for c in sorted(available_commands)))
        doc = get_primary_command_usage(command_doc)
    elif command.startswith('-'):
        raise ValueError("Unrecognized option '{}'.".format(command))
    elif command in settings.subcommands:
        subcommand = settings.subcommands[command]
        doc = format_usage(subcommand.__doc__)
    docopt.docopt(doc, argv=('--help',))
Print out a help message and exit the program.

    Args:
        command: If a command value is supplied then print the help message for
            the command module if available. If the command is '-a' or '--all',
            then print the standard help message but with a full list of
            available commands.

    Raises:
        ValueError: Raised if the help message is requested for an invalid
            command or an unrecognized option is passed to help.