Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose the current Command name to the CommandBuilder instance #440

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

leonardofoderaro
Copy link

Hi,
thank you for this great library.
I'd need the current Command name in the public Command build method.
Since a Command can be invoked by multiple names it could be useful to save the current name used to invoke it in order to make it available to the CommandBuilder, possibly without modify the Command Interface (as it would impact all the existing commands).
Is there a better way to get this information instead of my suggested patch?
Thank you,
Leonardo

@whoschek
Copy link

The AbstractCommand ctor already has a CommandBuilder param and CommandBuilder.names() would give you the names used for this command (although not the actually used name in case there are multiple aliases). Would that work for you?

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.

2 participants