diff --git a/cli/dcoscli/main.py b/cli/dcoscli/main.py index be44310..ab5d008 100644 --- a/cli/dcoscli/main.py +++ b/cli/dcoscli/main.py @@ -1,6 +1,6 @@ """ Usage: - dcos [options] [...] + dcos [options] [] [...] Options: --help Show this screen @@ -56,6 +56,9 @@ def main(): command = args[''] + if not command: + command = "help" + executable, err = subcommand.command_executables(command, util.dcos_path()) if err is not None: emitter.publish(err) diff --git a/cli/tests/integrations/cli/test_dcos.py b/cli/tests/integrations/cli/test_dcos.py index b2f65f3..d559596 100644 --- a/cli/tests/integrations/cli/test_dcos.py +++ b/cli/tests/integrations/cli/test_dcos.py @@ -1,16 +1,39 @@ import os -from dcos.api import constants +from dcos.api import constants, util 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 + assert stdout == """Command line utility for \ +the Mesosphere Datacenter Operating 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 '{}': + +\tconfig \tGet and set DCOS command line options +\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') + assert stderr == b'' + + def test_help(): returncode, stdout, stderr = exec_command(['dcos', '--help']) assert returncode == 0 assert stdout == b"""Usage: - dcos [options] [...] + dcos [options] [] [...] Options: --help Show this screen