From 7eca382cb3949a9ab906421203e6fa5680c46f26 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Mon, 12 Apr 2021 20:02:45 +0200 Subject: [PATCH] Added help messages to cli commands --- src/cpl_cli/command/add_service.py | 6 ++++++ src/cpl_cli/command/build_service.py | 2 ++ src/cpl_cli/command/help_service.py | 5 +++++ src/cpl_cli/command/install_service.py | 5 +++++ src/cpl_cli/command/new_service.py | 10 ++++++++++ src/cpl_cli/command/publish_service.py | 2 ++ src/cpl_cli/command/remove_service.py | 5 +++++ src/cpl_cli/command/start_service.py | 2 ++ src/cpl_cli/command/uninstall_service.py | 5 +++++ src/cpl_cli/command/update_service.py | 2 ++ src/cpl_cli/command/version_service.py | 2 ++ 11 files changed, 46 insertions(+) diff --git a/src/cpl_cli/command/add_service.py b/src/cpl_cli/command/add_service.py index 612038a0..c13daee2 100644 --- a/src/cpl_cli/command/add_service.py +++ b/src/cpl_cli/command/add_service.py @@ -28,6 +28,12 @@ class AddService(CommandABC): @property def help_message(self) -> str: return textwrap.dedent("""\ + Adds a project reference to given project. + usage: cpl add + + arguments: + source-project: Name of the project to which the reference has to be + target-project: Name of the project to be referenced """) @staticmethod diff --git a/src/cpl_cli/command/build_service.py b/src/cpl_cli/command/build_service.py index 703b54ac..31eab2b7 100644 --- a/src/cpl_cli/command/build_service.py +++ b/src/cpl_cli/command/build_service.py @@ -18,6 +18,8 @@ class BuildService(CommandABC): @property def help_message(self) -> str: return textwrap.dedent("""\ + Copies an python app into an output directory named build/ at the given output path. Must be executed within a CPL workspace or project directory + usage: cpl build """) def run(self, args: list[str]): diff --git a/src/cpl_cli/command/help_service.py b/src/cpl_cli/command/help_service.py index a93f8de2..6eb77411 100644 --- a/src/cpl_cli/command/help_service.py +++ b/src/cpl_cli/command/help_service.py @@ -22,6 +22,11 @@ class HelpService(CommandABC): @property def help_message(self) -> str: return textwrap.dedent("""\ + Lists available command and their short descriptions. + usage: cpl help + + Arguments: + command The command to display the help message for """) def run(self, args: list[str]): diff --git a/src/cpl_cli/command/install_service.py b/src/cpl_cli/command/install_service.py index 282d0562..32c558ab 100644 --- a/src/cpl_cli/command/install_service.py +++ b/src/cpl_cli/command/install_service.py @@ -43,6 +43,11 @@ class InstallService(CommandABC): @property def help_message(self) -> str: return textwrap.dedent("""\ + Installs given package via pip + usage: cpl install + + Arguments: + package The package to install """) def _install_project(self): diff --git a/src/cpl_cli/command/new_service.py b/src/cpl_cli/command/new_service.py index 9a7c9b19..792f4a62 100644 --- a/src/cpl_cli/command/new_service.py +++ b/src/cpl_cli/command/new_service.py @@ -50,6 +50,16 @@ class NewService(CommandABC): @property def help_message(self) -> str: return textwrap.dedent("""\ + Generates a workspace and initial project or add a project to workspace. + usage: cpl new + + Arguments: + type The project type of the initial project + name Name of the workspace or the project + + Types: + console + library """) @staticmethod diff --git a/src/cpl_cli/command/publish_service.py b/src/cpl_cli/command/publish_service.py index 6f1e2c5f..e4706df2 100644 --- a/src/cpl_cli/command/publish_service.py +++ b/src/cpl_cli/command/publish_service.py @@ -18,6 +18,8 @@ class PublishService(CommandABC): @property def help_message(self) -> str: return textwrap.dedent("""\ + Prepares files for publish into an output directory named dist/ at the given output path and executes setup.py. + usage: cpl publish """) def run(self, args: list[str]): diff --git a/src/cpl_cli/command/remove_service.py b/src/cpl_cli/command/remove_service.py index 378237d5..8d5c9f31 100644 --- a/src/cpl_cli/command/remove_service.py +++ b/src/cpl_cli/command/remove_service.py @@ -29,6 +29,11 @@ class RemoveService(CommandABC): @property def help_message(self) -> str: return textwrap.dedent("""\ + Removes a project from workspace. + usage: cpl add + + Arguments: + project The name of the project to delete """) @staticmethod diff --git a/src/cpl_cli/command/start_service.py b/src/cpl_cli/command/start_service.py index 4e42fea6..2572b2bb 100644 --- a/src/cpl_cli/command/start_service.py +++ b/src/cpl_cli/command/start_service.py @@ -18,6 +18,8 @@ class StartService(CommandABC): @property def help_message(self) -> str: return textwrap.dedent("""\ + Starts your application, restarting on file changes. + usage: cpl start """) def run(self, args: list[str]): diff --git a/src/cpl_cli/command/uninstall_service.py b/src/cpl_cli/command/uninstall_service.py index ade17dd6..82a12444 100644 --- a/src/cpl_cli/command/uninstall_service.py +++ b/src/cpl_cli/command/uninstall_service.py @@ -35,6 +35,11 @@ class UninstallService(CommandABC): @property def help_message(self) -> str: return textwrap.dedent("""\ + Uninstalls given package via pip + usage: cpl uninstall + + Arguments: + package The package to uninstall """) def run(self, args: list[str]): diff --git a/src/cpl_cli/command/update_service.py b/src/cpl_cli/command/update_service.py index c5a31ba4..c5842ad1 100644 --- a/src/cpl_cli/command/update_service.py +++ b/src/cpl_cli/command/update_service.py @@ -42,6 +42,8 @@ class UpdateService(CommandABC): @property def help_message(self) -> str: return textwrap.dedent("""\ + Updates the CPL and project dependencies. + usage: cpl update """) def _collect_project_dependencies(self) -> list[tuple]: diff --git a/src/cpl_cli/command/version_service.py b/src/cpl_cli/command/version_service.py index cde683e9..776f3746 100644 --- a/src/cpl_cli/command/version_service.py +++ b/src/cpl_cli/command/version_service.py @@ -22,6 +22,8 @@ class VersionService(CommandABC): @property def help_message(self) -> str: return textwrap.dedent("""\ + Lists the version of CPL, CPL CLI and all installed packages from pip. + usage: cpl version """) def run(self, args: list[str]):