Are custom CLI commands supposed to be shown by the main ckan --help
command?
#6461
-
I'm developing a CKAN extension and have created a simple command to check how this works. It looks like this: # this file is commands.test
import click
@click.command()
def test_ckan_cmd():
click.secho("hi there", fg="green") Then in my plugin definition I'm returning it in the import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from .commands.test import test_ckan_cmd
class MyPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IClick)
def get_commands(self):
return [test_ckan_cmd] This seems to work OK, I can call However, when I do
I don't see my custom command listed in there. I only see the default ckan commands. Is this expected behavior? There is nothing in the docs that says that |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, custom commands from extensions should be displayed in the output of |
Beta Was this translation helpful? Give feedback.
Yes, custom commands from extensions should be displayed in the output of
ckan --help
but they are not in the latest 2.9 version because of a bug that was fixed here: #6135, but unfortunately hasn't been backported to 2.9 yet