diff --git a/cli/dcoscli/config/main.py b/cli/dcoscli/config/main.py index 4fb2767..81bd27d 100644 --- a/cli/dcoscli/config/main.py +++ b/cli/dcoscli/config/main.py @@ -1,4 +1,4 @@ -"""Get and set DCOS command line options +"""Get and set DCOS CLI configuration properties Usage: dcos config --info diff --git a/cli/dcoscli/help/main.py b/cli/dcoscli/help/main.py index 30a943c..9f7a1fc 100644 --- a/cli/dcoscli/help/main.py +++ b/cli/dcoscli/help/main.py @@ -15,6 +15,7 @@ import futures from dcos.api import cmds, emitting, options, subcommand, util emitter = emitting.FlatEmitter() +logger = util.get_logger(__name__) def main(): @@ -56,6 +57,7 @@ def _help(show_info): return 0 directory = util.dcos_path() + logger.debug("DCOS Path: {!r}".format(directory)) paths = subcommand.list_paths(directory) with futures.ThreadPoolExecutor(max_workers=len(paths)) as executor: @@ -67,7 +69,7 @@ def _help(show_info): "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 in {!r}:".format(directory)) + emitter.publish("Available DCOS commands:") emitter.publish(commands_message) emitter.publish( "\nGet detailed command description with 'dcos --help'.") diff --git a/cli/dcoscli/main.py b/cli/dcoscli/main.py index 1bf2774..965ad43 100644 --- a/cli/dcoscli/main.py +++ b/cli/dcoscli/main.py @@ -1,4 +1,10 @@ """ +Command line utility for the Mesosphere Datacenter Operating +System (DCOS) + +'dcos help' lists all available subcommands. See 'dcos --help' +to read about a specific subcommand. + Usage: dcos [options] [] [...] @@ -22,8 +28,6 @@ Environment Variables: DCOS_CONFIG This environment variable points to the location of the DCOS configuration file. -'dcos help' lists all available subcommands. See 'dcos --help' -to read about a specific subcommand. """ import os diff --git a/cli/tests/integrations/cli/test_config.py b/cli/tests/integrations/cli/test_config.py index e4b2925..2770c0e 100644 --- a/cli/tests/integrations/cli/test_config.py +++ b/cli/tests/integrations/cli/test_config.py @@ -22,7 +22,7 @@ def test_help(): returncode, stdout, stderr = exec_command(['dcos', 'config', '--help']) assert returncode == 0 - assert stdout == b"""Get and set DCOS command line options + assert stdout == b"""Get and set DCOS CLI configuration properties Usage: dcos config --info @@ -51,7 +51,7 @@ def test_info(): returncode, stdout, stderr = exec_command(['dcos', 'config', '--info']) assert returncode == 0 - assert stdout == b'Get and set DCOS command line options\n' + assert stdout == b'Get and set DCOS CLI configuration properties\n' assert stderr == b'' diff --git a/cli/tests/integrations/cli/test_dcos.py b/cli/tests/integrations/cli/test_dcos.py index 8ad0237..488a496 100644 --- a/cli/tests/integrations/cli/test_dcos.py +++ b/cli/tests/integrations/cli/test_dcos.py @@ -1,12 +1,11 @@ import os -from dcos.api import constants, util +from dcos.api import constants from common import exec_command def test_default(): - dcos_path = os.path.dirname(os.path.dirname(util.which('dcos'))) returncode, stdout, stderr = exec_command(['dcos']) assert returncode == 0 @@ -16,16 +15,16 @@ System (DCOS). The Mesosphere DCOS is a distributed operating system built around Apache Mesos. This utility provides tools for easy management of a DCOS installation. -Available DCOS commands in '{}': +Available DCOS commands: -\tconfig \tGet and set DCOS command line options +\tconfig \tGet and set DCOS CLI configuration properties \thelp \tDisplay command line usage information \tmarathon \tDeploy and manage applications on the DCOS \tpackage \tInstall and manage DCOS software packages \tsubcommand \tInstall and manage DCOS CLI subcommands Get detailed command description with 'dcos --help'. -""".format(dcos_path).encode('utf-8') +""".encode('utf-8') assert stderr == b'' @@ -33,7 +32,14 @@ def test_help(): returncode, stdout, stderr = exec_command(['dcos', '--help']) assert returncode == 0 - assert stdout == b"""Usage: + assert stdout == b"""\ +Command line utility for the Mesosphere Datacenter Operating +System (DCOS) + +'dcos help' lists all available subcommands. See 'dcos --help' +to read about a specific subcommand. + +Usage: dcos [options] [] [...] Options: @@ -55,9 +61,6 @@ Environment Variables: DCOS_CONFIG This environment variable points to the location of the DCOS configuration file. - -'dcos help' lists all available subcommands. See 'dcos --help' -to read about a specific subcommand. """ assert stderr == b'' @@ -102,7 +105,7 @@ def test_log_level_flag(): ['dcos', '--log-level=info', 'config', '--info']) assert returncode == 0 - assert stdout == b"Get and set DCOS command line options\n" + assert stdout == b"Get and set DCOS CLI configuration properties\n" def test_capital_log_level_flag(): @@ -110,7 +113,7 @@ def test_capital_log_level_flag(): ['dcos', '--log-level=INFO', 'config', '--info']) assert returncode == 0 - assert stdout == b"Get and set DCOS command line options\n" + assert stdout == b"Get and set DCOS CLI configuration properties\n" def test_invalid_log_level_flag(): diff --git a/cli/tests/integrations/cli/test_help.py b/cli/tests/integrations/cli/test_help.py index c069b0f..82149a5 100644 --- a/cli/tests/integrations/cli/test_help.py +++ b/cli/tests/integrations/cli/test_help.py @@ -1,7 +1,3 @@ -import os - -from dcos.api import util - from common import exec_command @@ -40,7 +36,6 @@ def test_version(): def test_list(): - dcos_path = os.path.dirname(os.path.dirname(util.which('dcos'))) returncode, stdout, stderr = exec_command(['dcos', 'help']) assert returncode == 0 @@ -50,14 +45,14 @@ System (DCOS). The Mesosphere DCOS is a distributed operating system built around Apache Mesos. This utility provides tools for easy management of a DCOS installation. -Available DCOS commands in '{}': +Available DCOS commands: -\tconfig \tGet and set DCOS command line options +\tconfig \tGet and set DCOS CLI configuration properties \thelp \tDisplay command line usage information \tmarathon \tDeploy and manage applications on the DCOS \tpackage \tInstall and manage DCOS software packages \tsubcommand \tInstall and manage DCOS CLI subcommands Get detailed command description with 'dcos --help'. -""".format(dcos_path).encode('utf-8') +""".encode('utf-8') assert stderr == b''