cmd/viewcore: interactive mode support

This change implements an interactive mode and restructures the command
line so that the corefile argument is the first argument.

The following command starts an interactive shell for analysis of the
specified core.

  viewcore <corefile>

Providing a command in the following form, the viewcore invokes the
command directly rather than starting the interactive mode.

  viewcore <corefile> <command>

This change uses github.com/chzyer/readline to provide shell-like
functionality. (TODO: vendor the package for reproducible build)

Change-Id: I644566a16e1f5442e668d712187d9841f242f78a
Reviewed-on: https://go-review.googlesource.com/115597
Reviewed-by: Heschi Kreinick <heschi@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
1 file changed