Skip to content

Commands can now be overloaded.#31

Merged
Odjit merged 3 commits intodev/v0.10.3from
feature/Command_overloading
May 27, 2025
Merged

Commands can now be overloaded.#31
Odjit merged 3 commits intodev/v0.10.3from
feature/Command_overloading

Conversation

@Odjit
Copy link
Collaborator

@Odjit Odjit commented May 4, 2025

With the number of commands in plugins and number of plugins out there it's becoming increasingly difficult to not run into conflicts. This change adds the ability for commands to be overloaded for the same number of parameters by checking the parameters passed against all possible options and seeing which ones will work. If there is only one option that works then that command is executed. If there is multiple options that is worked they are all presented to the user numbered with the user then being able to execute them by using .# with # replaced with the appropriate number. Conflicts can as well be resolved beforehand by specifying the plugin name first before the command though you can still have overloading within a single plugin.

A number of unit tests have been added to try to get decent coverage on all the various ways this can be used. Note had to add assembly to the command metadata in order to be able to properly unit test executing command based on plugin. Simplifies several retrievals of assembly as well as a result.

Don't want to PR this into help by plugin but into main after Help by plugin is finished being PRed

Odjit added 2 commits May 3, 2025 22:50
Added a second level of filtering to .help so you can filter commands with a plugin or second filter for the command search
.help now has commands and plugins sorted
Adds .help-all which functions similar to previous .help except its ordered
Added new unit tests
If there is ambiguity in which command was intended to be called then you will be presented with the options and asked to pick one with .#
Can specify a command for a specific plugin by using the name of it first before the command
@Odjit Odjit requested a review from decaprime May 4, 2025 03:14
Base automatically changed from feature/Help_by_plugin to dev/v0.10.3 May 27, 2025 17:18
@Odjit Odjit marked this pull request as ready for review May 27, 2025 17:18
@Odjit Odjit merged commit a9ba395 into dev/v0.10.3 May 27, 2025
@Odjit Odjit deleted the feature/Command_overloading branch May 27, 2025 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant