Can CRaSH be used as a CLI interpreter for a main method in a custom application?

27 views
Skip to first unread message

Steve Storck

unread,
Apr 18, 2016, 8:00:43 PM4/18/16
to CRaSH User Group
Hello all!  I would like to use CRaSH for an interactive shell in my application, but I would like to know if I can use it to parse command line arguments to my custom application as well.  Currently, I am using commons-cli for that purpose, and Spring Shell for my application's shell.  It would be great to be able to switch over to CRaSH for both purposes.  I see that there is a CRaSH minimal jar that interests me quite a bit.  I see plenty of examples of using CRaSH for an interactive shell, but I have not seen anything that indicates how appropriate it could be for a main method's command arguments.  Could someone point me to an example if any exist?  Thanks in advance.

Cheers,
Steve

Julien Viet

unread,
Apr 19, 2016, 8:57:35 AM4/19/16
to crash...@googlegroups.com
yes you can do that, here is how it is done by default for CRaSH:


the commandClass should be your annotated command class.




--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "CRaSH User Group".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse crash-users...@googlegroups.com.
Pour obtenir davantage d'options, consultez la page https://groups.google.com/d/optout.

Steve Storck

unread,
Apr 19, 2016, 9:48:32 AM4/19/16
to CRaSH User Group
Thank you very much, Julien!  And I appreciate your timely reply.
Reply all
Reply to author
Forward
0 new messages