Exemplo n.º 1
0
def test_extend_usage_docopt():
    command_summaries = [('first', 'first summary'),
                         ('second', ' second summary '),
                         ('third', 'third summary\n')]

    expected = """
\tfirst          \tfirst summary
\tsecond         \tsecond summary
\tthird          \tthird summary"""

    assert options.make_command_summary_string(command_summaries) == expected
Exemplo n.º 2
0
def test_extend_usage_docopt():
    command_summaries = [
        ('first', 'first summary'),
        ('second', ' second summary '),
        ('third', 'third summary\n')
    ]

    expected = """
\tfirst          \tfirst summary
\tsecond         \tsecond summary
\tthird          \tthird summary"""

    assert options.make_command_summary_string(command_summaries) == expected
Exemplo n.º 3
0
def _help(show_info):
    if show_info:
        emitter.publish(__doc__.split('\n')[0])
        return 0

    directory = util.dcos_path()
    logger.debug("DCOS Path: {!r}".format(directory))

    paths = subcommand.list_paths()
    with ThreadPoolExecutor(max_workers=len(paths)) as executor:
        results = executor.map(subcommand.documentation, paths)
        commands_message = options.make_command_summary_string(sorted(results))

    emitter.publish(
        "Command line utility for the Mesosphere Datacenter Operating\n"
        "System (DCOS). The Mesosphere DCOS is a distributed operating\n"
        "system built around Apache Mesos. This utility provides tools\n"
        "for easy management of a DCOS installation.\n")
    emitter.publish("Available DCOS commands:")
    emitter.publish(commands_message)
    emitter.publish(
        "\nGet detailed command description with 'dcos <command> --help'.")

    return 0