diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2023-04-22 10:05:37 -0400 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2023-04-22 10:06:31 -0400 |
| commit | 2e3274a5a47819ca651bc183bad8443a5c79d3c7 (patch) | |
| tree | 7a3e9f46328620420f676bb57c916affcaa2e454 | |
| parent | Ignore pytest cache (diff) | |
| download | poetry-plugin-taskipy2-2e3274a5a47819ca651bc183bad8443a5c79d3c7.zip | |
Fix argument handling for command
| -rw-r--r-- | poetry_plugin_taskipy/commands.py | 11 | ||||
| -rw-r--r-- | poetry_plugin_taskipy/plugin.py | 3 |
2 files changed, 8 insertions, 6 deletions
diff --git a/poetry_plugin_taskipy/commands.py b/poetry_plugin_taskipy/commands.py index 40381e9..4e80fd8 100644 --- a/poetry_plugin_taskipy/commands.py +++ b/poetry_plugin_taskipy/commands.py @@ -19,12 +19,15 @@ class TaskipyCommand(Command): ] def handle(self) -> int: - args = [] + arguments = [] if self.argument("name"): - args.append(self.argument("name")) + arguments.append(self.argument("name")) if self.argument("args"): - args.extend(self.argument("args")) + arguments.extend(self.argument("args")) - return taskipy.run(args) + if self.option("list"): + arguments.append("--list") + + return taskipy.run(arguments) diff --git a/poetry_plugin_taskipy/plugin.py b/poetry_plugin_taskipy/plugin.py index afd8d67..bb87bd2 100644 --- a/poetry_plugin_taskipy/plugin.py +++ b/poetry_plugin_taskipy/plugin.py @@ -1,4 +1,3 @@ -from poetry.console.commands.command import Command from poetry.plugins.application_plugin import ApplicationPlugin from poetry_plugin_taskipy.commands import TaskipyCommand @@ -6,5 +5,5 @@ from poetry_plugin_taskipy.commands import TaskipyCommand class TaskipyPlugin(ApplicationPlugin): @property - def commands(self) -> list[type[Command]]: + def commands(self): return [TaskipyCommand] |