Skip to content

Commit

Permalink
ensure plugins take precedence over core commands
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed Oct 10, 2024
1 parent 143b412 commit 76ca368
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions dlt/cli/_dlt.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,13 @@ def main() -> int:

m = plugins.manager()
commands = cast(List[Type[SupportsCliCommand]], m.hook.plug_cli())
# NOTE: plugin commands are added in reverse order so that the last added command (coming from external plugin)
# overwrites internal commands
commands.reverse()

# install available commands
installed_commands: Dict[str, SupportsCliCommand] = {}
for c in commands:
command = c()
if command.command in installed_commands.keys():
continue
command_parser = subparsers.add_parser(command.command, help=command.help_string)
command.configure_parser(command_parser)
installed_commands[command.command] = command
Expand Down

0 comments on commit 76ca368

Please sign in to comment.