diff --git a/src/composer/cli/blueprints.py b/src/composer/cli/blueprints.py index 5bf647bd..c622f81e 100644 --- a/src/composer/cli/blueprints.py +++ b/src/composer/cli/blueprints.py @@ -21,6 +21,7 @@ import os import json from composer import http_client as client +from composer.cli.help import blueprints_help from composer.cli.utilities import argify, frozen_toml_filename, toml_filename, handle_api_result from composer.cli.utilities import packageNEVRA @@ -48,7 +49,10 @@ def blueprints_cmd(opts): "undo": blueprints_undo, "workspace": blueprints_workspace } - if opts.args[1] not in cmd_map: + if opts.args[1] == "help" or opts.args[1] == "--help": + print(blueprints_help) + return 0 + elif opts.args[1] not in cmd_map: log.error("Unknown blueprints command: %s", opts.args[1]) return 1 diff --git a/src/composer/cli/compose.py b/src/composer/cli/compose.py index d8fdd9fb..b343e248 100644 --- a/src/composer/cli/compose.py +++ b/src/composer/cli/compose.py @@ -21,6 +21,7 @@ import sys import json from composer import http_client as client +from composer.cli.help import compose_help from composer.cli.utilities import argify, handle_api_result, packageNEVRA def compose_cmd(opts): @@ -46,7 +47,10 @@ def compose_cmd(opts): "logs": compose_logs, "image": compose_image, } - if opts.args[1] not in cmd_map: + if opts.args == "help" or opts.args == "--help": + print(compose_help) + return 0 + elif opts.args[1] not in cmd_map: log.error("Unknown compose command: %s", opts.args[1]) return 1 diff --git a/src/composer/cli/modules.py b/src/composer/cli/modules.py index 972f32f8..25ad1e04 100644 --- a/src/composer/cli/modules.py +++ b/src/composer/cli/modules.py @@ -20,6 +20,7 @@ log = logging.getLogger("composer-cli") import json from composer import http_client as client +from composer.cli.help import modules_help def modules_cmd(opts): """Process modules commands @@ -29,7 +30,10 @@ def modules_cmd(opts): :returns: Value to return from sys.exit() :rtype: int """ - if opts.args[1] != "list": + if opts.args[1] == "help" or opts.args[1] == "--help": + print(modules_help) + return 0 + elif opts.args[1] != "list": log.error("Unknown modules command: %s", opts.args[1]) return 1 diff --git a/src/composer/cli/projects.py b/src/composer/cli/projects.py index 779fc82f..31b20418 100644 --- a/src/composer/cli/projects.py +++ b/src/composer/cli/projects.py @@ -21,6 +21,7 @@ import json import textwrap from composer import http_client as client +from composer.cli.help import projects_help def projects_cmd(opts): """Process projects commands @@ -34,7 +35,10 @@ def projects_cmd(opts): "list": projects_list, "info": projects_info, } - if opts.args[1] not in cmd_map: + if opts.args[1] == "help" or opts.args[1] == "--help": + print(projects_help) + return 0 + elif opts.args[1] not in cmd_map: log.error("Unknown projects command: %s", opts.args[1]) return 1 diff --git a/src/composer/cli/sources.py b/src/composer/cli/sources.py index c8ba3baa..6ebe0877 100644 --- a/src/composer/cli/sources.py +++ b/src/composer/cli/sources.py @@ -21,6 +21,7 @@ import os import json from composer import http_client as client +from composer.cli.help import sources_help from composer.cli.utilities import argify, handle_api_result def sources_cmd(opts): @@ -38,7 +39,10 @@ def sources_cmd(opts): "change": sources_add, "delete": sources_delete, } - if opts.args[1] not in cmd_map: + if opts.args[1] == "help" or opts.args[1] == "--help": + print(sources_help) + return 0 + elif opts.args[1] not in cmd_map: log.error("Unknown sources command: %s", opts.args[1]) return 1