Skip to content
Snippets Groups Projects
Commit 08788aa3 authored by David Douard's avatar David Douard
Browse files

Do not automagically add click cmd from swh.cli.subcommands

the idea is now to be a bit more explicit, and expect thoses commands
to have the main `swh` click group as parent.

Then the swh.cli.subcommands entrypoint hooks only have to load the
declared cli modules.

So we now expect to:

- use swh.core.cli.swh as parent group when declaring
  sub-groups/commands in a swh package.
- the swh.cli.subcommand entrypoint to only refer the module rather than
  the click group/command, ie. have:

  '''
    [swh.cli.subcommands]
    name = swh.path.to.cli_module
  '''

  instead of:

  '''
    [swh.cli.subcommands]
    name = swh.path.to.cli_module:click_command
  '''

A backward compatilibility mech is provided: if the loaded entrypoint
object is indeed a click command, auto add it to the main swh group.
parent 56d505f3
No related branches found
No related tags found
1 merge request!157Do not automagically add click cmd from swh.cli.subcommands
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment