spring-shell
spring-shell copied to clipboard
Add `getCommand` method to withTarget function context
An alias can be set when the command is registered, so I want to distinguish which command the user is using for more detailed prompts and statistics.
The version I am currently using is 3.0.1
We have a support for command aliases but it's a bit unclear what you are asking? Would you mind giving more details, possible with command output examples.
Sorry if my description confused you.
Does the image below express my question more clearly
I hope you can add a method in the withTarget
context to get the command
or raw command entered by the user
Ah right yes I can see how this would be more convenient for a user to know more about how things got resolved.
CommandContext
has getRawArgs
method but indeed you are not directly given access to a command itself(we obviously know that internally). Might also be nice to have a flag if it was resolved from an alias as those are usually used for backward compatibility and maybe user needs to get notified about it or whatever shell implementation could use it for.