VPP-46 Fix cut-and-paste in the debug CLI 56/1056/2
authorChris Luke <chrisy@flirble.org>
Tue, 10 May 2016 14:45:10 +0000 (10:45 -0400)
committerChris Luke <chrisy@flirble.org>
Tue, 10 May 2016 17:37:03 +0000 (13:37 -0400)
commit93dcd1d743db3c0a131ecb0eddfe9c6cb1a7e441
treeffa3222f98890078d12d4984f62032f9ec0965dd
parent716d9593497388c48593f818748faf705ac7169e
VPP-46 Fix cut-and-paste in the debug CLI

Since the move to line-mode the debug CLI was eating everything in the
input_vector but only processing upto the first newline. Cut-and-paste
type operations generally send a large block of input with multiple
newlines and thus all but the very first line were simply ignored.

This patch fixes that and also cleans up the difference between
input_vector and current_command which in turn removes a lot of cruft
from the keystroke parser.

Previously current_command was just the character accumulator inside the
char-by-char keystroke parser; complete commands were copied back to
input_vector (overwriting anything already in there).

Now, in char-by-char mode:
- input_vector is the stream of incoming bytes yet to be processed
- current_command is the accumulated characters of the next command to
  be executed; once newline is found, it is the complete command to be
  executed.

In line mode:
- input_vector and current_command are the same thing.

Change-Id: I72d21f0f3508b413879071ab186a71cef1124a2b
Signed-off-by: Chris Luke <chrisy@flirble.org>
vlib/vlib/unix/cli.c