|
From: Dale A. <da...@gr...> - 2012-11-06 21:42:31
|
I wrote dbconsole a few years ago with jline, see http://dbconsole.sourceforge.net/ Feel free to swipe any of the code that you might find useful there. Dale On Tue, Nov 6, 2012 at 7:36 AM, Guillaume Nodet <gn...@gm...> wrote: > > > > On Tue, Nov 6, 2012 at 3:12 PM, Pruteanu Dragos <dra...@ya...>wrote: > >> Hello, >> >> Thank you guys for the great jline library ! From the first feeling is >> really fantastic. >> >> I am working to implement a kind of sql client in command prompt. I am >> looking to use some of the jline features but I don't know how to proceed. >> An advice would be great : >> >> - I want to let the user read sql commands which are written on two >> lines. Unless the phrase is not ended with ';' it should go on two lines. >> I can do this, but than the history will recognize it as two separate >> commands. How can I change this ? >> > > We've implemented that in Karaf. The way we've done that is quite simple: > > * print the full prompt > * read a line > * if the line is not complete (a heuristic need to be used) > - print a simple prompt such as > > - read another line and concatenate > - loop > That seems to work well enough. The limitation is that you can't edit the > first line when you're on the second one, but that's actually the exact > same behavior that the one in usual shells such as bash. > > >> >> - After the user has executed a sql, I want to let him view ( like less ) >> the result. This can be larger than one page ( both in width and height ) . >> How may I enter this mode ? >> > > We have a more command in karaf. > > https://github.com/apache/karaf/blob/trunk/shell/commands/src/main/java/org/apache/karaf/shell/commands/impl/MoreAction.java > It will have to be slightly adapted, but you can grab the code at adapt it > to suit your needs. > > > > >> >> - is it possible to keep always showing on the bottom some commands like >> 'ctrl-S - save', etc. ? >> > > I've never done that, so not really sure. You'd have to enter full mode, > such as in vi for example. > > >> >> Thank you very much, >> Dragos Pruteanu >> > > > > -- > ------------------------ > Guillaume Nodet > ------------------------ > Blog: http://gnodet.blogspot.com/ > ------------------------ > FuseSource, Integration everywhere > http://fusesource.com > > > ------------------------------------------------------------------------------ > LogMeIn Central: Instant, anywhere, Remote PC access and management. > Stay in control, update software, and manage PCs from one command center > Diagnose problems and improve visibility into emerging IT issues > Automate, monitor and manage. Do more in less time with Central > http://p.sf.net/sfu/logmein12331_d2d > _______________________________________________ > Jline-users mailing list > Jli...@li... > https://lists.sourceforge.net/lists/listinfo/jline-users > > |