We have just released CRaSH 1.0.0 Beta 8 on Google Code forge, in that release we have worked on two usability aspects of the shell:

  • The capability for a command to prompt a value with or without echo of the value entered by the user. It is mainly used by the connect command to prompt the password when it is not entered via the -p option.
  • The second feature is the up/down arrow associated to recalling previously entered commands.

The prompt command implementation required a refactor of the CRaSH architecture, the main challenge coming from the following facts:

  • the shell is invoked by a term and the term has blocking IO
  • the execution of a command needs to be interruptible

The refactoring was quite fun to do, and lead to a few improvements in the architecture that consisted mostly in decoupling the various systems, now we can distinguish:

  1. The Shell that executes the commands and returns a result. The current implementation is connected to JCR to execute Groovy commands.
  2. The Shell Connector, a state machine executing commands in a synchronous or asynchronous manner, it depends on its configuration. The execution of a command can be cancelled.
  3. The Term: a state machine that translates IO into actions, managing also the command history.
  4. The TermIO: the input/output of the Term, that is implemented using Apache SSHD and Wimpi TelnetD

At the moment I am quite satisfied by the current features. I think it is still missing the command completion and I don’t have a clue if it is easy or complex to do and which system should manage it, I’ll leave it for later fun. Maybe it will be easy to do, or it could require some new important refactor to make it possible to happen, who knows?

blog comments powered by Disqus


27 May 2010