Search code examples
springcommand-line-interfacespring-shell

How to customize a parser for options in spring shell?


I'm using Spring shell to develop command shell for my project.

the problem is as i described below: i need to have some functionality like method overloading in shell. in other words i need to have two commands with same name but different options. I googled it and found some ideas like overriding parser interface, but i did not find any samples over internet.

any suggestions will be helpful.

Thank for your help.


Solution

  • You need to implement org.springframework.shell.core.Converter and add @Component to it.