From: Bernhard B. <ma...@ba...> - 2002-04-30 09:08:21
|
> Dear Bernhard > > First of all - thanks for the great java readline program which i have > used in a java/jdbc based command-line sql client (opensource and free)= =2E > > I wish to know how i can link certain keys to Java methods. e.g. I woul= d > like to specify a key to complete file names, and a key to get only > column names or only table names. With native readline programming, it is possible to bind a key to a speci= al=20 function. Therefore it should be possible to use different keys for=20 completion of column names or table names. The difficult point is, that w= ith=20 standard-readline behaviour, only the TAB-key triggers the completion=20 functions. So you would have to reproduce the complete default behaviour = in=20 your own special function. In the current version of Java-Readline, there is no support for mapping = keys=20 to Java-methods. The best solution would probably be a context-sensitive completer which w= ould=20 offer only filenames, column names or table names when appropriate. But m= y=20 only basic knowledge of SQL already shows me, that this is not possible (= e.g=20 "select from table.column ...." or "select from column ..."). > BTW, I had put up a small GUI based SQLCLient on sourceforge.net (sqlmi= nus) > and hope to put this up there as well. You should also check for HenPlus on sourceforge.net, a JDBC-shell using=20 Java-Readline. > In case you know of any site/book/source of advanced info on writing > command-line/non-GUI programs, would be grateful. I know of nothing special, but I recommend following some standard Unix=20 guidelines: - use getopt for parameter parsing (also available in Java) - use standard options, e.g. -h, -? (help), --version, -v (verbose) etc. - support pipes - exit-code 0 is success >0 is failure Greetings from Munich, Germany Bernhard |