Skip to content

Conflicting commands in different modules #55

@DavidMertz

Description

@DavidMertz

Since modules are intended to function together within Zimagi, the collision of commands feels like a problem. Resolving choice of command based on priority is deterministic (modulo "what happens for a tie"), but seems unsatisfactory.

For example, suppose that module-this-data and module-that-data each define import commands. The names of commands are likely to use some obvious choices, making the capabilities of one or the other unreachable. For example, suppose both modules implement import all, it becomes not at all obvious what will happen with. Moreover, adding a third module-other-data produced by an entirely different developer can change the behavior and/or make those third-party commands simply unreachable.

This could easily be true for commands less general than import all even. For example:

vagrant@zimagi:~$ zimagi import years --start=2019 --end=2020

That seems like something many modules might intuitively implement.

One could defensively program all commands by essentially namespacing the commands themselves. E.g. zimagi import all-this vs zimagi import all-that. But that reduces the intuitiveness and compactness of commands.

I would suggest that namespacing should be an option for all commands (or at least most/many). For example:

vagrant@zimagi:~$ zimagi import --ns=this-data all
... stuff happens using this module-this-data
vagrant@zimagi:~$ zimagi import --ns=that-data all
... stuff happens using module-that-data

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions