Merged revisions 1034-1035 via svnmerge from
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Sun, 15 Jul 2007 23:58:36 +0000 (23:58 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Sun, 15 Jul 2007 23:58:36 +0000 (23:58 +0000)
commit5908cf10ce41a7db08f170d8a35d9c8347954388
tree5d54ed7d1e6bfafa49615114f7427b30b86e822d
parent83da9a8a0f683552275b210b4e2e08e162e2588c
Merged revisions 1034-1035 via svnmerge from
svn://svn.open-ils.org/OpenSRF/trunk

........
  r1035 | miker | 2007-07-14 22:18:41 -0400 (Sat, 14 Jul 2007) | 30 lines

  Patch from Scott McKellar to clean up srfsh's user interface:

  1. srfsh exits the main loop in two circumstances.  The first is when
  it sees the "quit" or "exit" command.  The second is when it sees
  end-of-file, either because it reads the end of a script or because
  the user enters the associated keystrokes (typically Control-D).

  In the case of end-of-file, srfsh exits without issuing another
  newline.  As a result, the next shell prompt shows up concatenated
  to the srfsh prompt.  This result is harmless but annoying.

  I tweaked the code to detect this situation and issue an extra
  newline, so that the next shell prompt show up on a line by itself.

  2. I strip off leading whitespace before processing the input
  command.

  As a result, srfsh will now recognize "quit", "exit", or a leading
  exclamation point, even when preceded by whitespace.  Other commands
  are not affected because strtok() already strips off leading
  blanks.  Tab characters don't matter because readline() removes them.

  3. I also strip off trailing whitespace.  This measure affects only
  the "quit" and "exit" commands.

  4. I ignore input lines whose first non-whitespace character is an
  octothorpe ('#', also known as hash, pound, or tic-tac-toe).  In
  other words, scripts can now have comments.
........

git-svn-id: svn://svn.open-ils.org/OpenSRF/branches/new-json2@1036 9efc2488-bf62-4759-914b-345cdb29e865
src/srfsh/srfsh.c