From f88d72d94e47fcff44f3efa6c994eeb4620946f2 Mon Sep 17 00:00:00 2001 From: Sunil Shah Date: Fri, 20 Feb 2015 13:35:18 -0800 Subject: [PATCH] DCOS-308 Make help more useful --- dcos/cli/app/main.py | 2 +- dcos/cli/help/main.py | 11 +++++++++-- integrations/cli/test_app.py | 2 +- integrations/cli/test_help.py | 11 ++++++++--- tests/data/Dcos.toml | 9 +++------ 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/dcos/cli/app/main.py b/dcos/cli/app/main.py index ccd44c2..3166bc9 100644 --- a/dcos/cli/app/main.py +++ b/dcos/cli/app/main.py @@ -133,7 +133,7 @@ def _info(): :rtype: int """ - emitter.publish('Deploy and manage applications on Apache Mesos') + emitter.publish('Deploy and manage applications on the DCOS') return 0 diff --git a/dcos/cli/help/main.py b/dcos/cli/help/main.py index 406a3a5..c6161a9 100644 --- a/dcos/cli/help/main.py +++ b/dcos/cli/help/main.py @@ -31,8 +31,15 @@ def main(): if args['help'] and args['info']: emitter.publish('Display usage information') - # Note: this covers --all. When --all is different, + # Note: this covers --all also. + # Eventually we will only show commonly used commands for help + # and use --all to show, well, all commands. elif args['help']: + emitter.publish( + "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.\n") directory = _binary_directory(os.environ[constants.DCOS_PATH_ENV]) emitter.publish("Available DCOS commands in '{}':".format(directory)) emitter.publish( @@ -41,7 +48,7 @@ def main(): _extract_subcommands( _list_subcommand_programs(directory))))) emitter.publish( - "\nGet detail command description with 'dcos --help'.") + "\nGet detailed command description with 'dcos --help'.") return 0 else: diff --git a/integrations/cli/test_app.py b/integrations/cli/test_app.py index 83db135..3556d37 100644 --- a/integrations/cli/test_app.py +++ b/integrations/cli/test_app.py @@ -60,7 +60,7 @@ def test_info(): returncode, stdout, stderr = exec_command(['dcos', 'app', 'info']) assert returncode == 0 - assert stdout == b'Deploy and manage applications on Apache Mesos\n' + assert stdout == b'Deploy and manage applications on the DCOS\n' assert stderr == b'' diff --git a/integrations/cli/test_help.py b/integrations/cli/test_help.py index dc7fe1d..9c91a41 100644 --- a/integrations/cli/test_help.py +++ b/integrations/cli/test_help.py @@ -39,14 +39,19 @@ def test_list_all(): returncode, stdout, stderr = exec_command(['dcos', 'help', '--all']) assert returncode == 0 - assert stdout == """Available DCOS commands in '{}': + 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. -\tapp \tDeploy and manage applications on Apache Mesos +Available DCOS commands in '{}': + +\tapp \tDeploy and manage applications on the DCOS \tconfig \tGet and set DCOS command line options \thelp \tDisplay usage information \tmarathon \tDeploy and manage applications on Apache Mesos \tpackage \tInstall and manage DCOS software packages -Get detail command description with 'dcos --help'. +Get detailed command description with 'dcos --help'. """.format(os.path.join(os.environ['DCOS_PATH'], 'bin')).encode('utf-8') assert stderr == b'' diff --git a/tests/data/Dcos.toml b/tests/data/Dcos.toml index 7c7bb56..669f83e 100644 --- a/tests/data/Dcos.toml +++ b/tests/data/Dcos.toml @@ -1,9 +1,6 @@ -[package] -cache = "tmp/cache" -sources = [ - "git://github.com/mesosphere/universe.git", - "https://github.com/mesosphere/universe/archive/master.zip" -] [marathon] host = "localhost" port = 8080 +[package] +sources = [ "git://github.com/mesosphere/universe.git", "https://github.com/mesosphere/universe/archive/master.zip",] +cache = "tmp/cache"