Remove the duplicate db.getMongo().setSlaveOk() help line from db.help()
(I kept the one with the more terse text), remove an extraneous space
from the end of db.getProfilingStatus(), sort the lines alphabetically.
Add code to linenoise to do what readline was doing. When tab is
hit, we need to search backwards from the insertion point for a
break character (we're using " =+-/\\*?\"'`&<>;|@{([])}" for now)
and only pass the characters between that point and the cursor
position to the completion routine. When it gives us possible
completions, we need to insert them in place of the string we
extracted, which makes completion work when not at the left margin
and even when inside another expression. Linenoise was passing
the whole input line and substituting the replacement text for the
entire line.
Track the strdup-ed (i.e. malloc-ed) strings returned by linenoise, and
free the memory when we are done with it. Free command line history
memory explicitly when we save the history to a file and stop using it.
Non-Windows versions were freeing this memory using an atexit handler,
but this handler isn't set up for Windows.
Remove the all-on-one-line command line editing in the shell and replace it
with something more in the style of other command lines such as bash. Allow
prompts to exceed the width of the terminal screen and allow newlines in
them. Strip all other control characters from the prompt text before
displaying it so that embedded backspaces, tabs and other controls don't
display badly or require extra code to emulate. This prevents users from
using escape sequences in their prompts to perform highlighting, for now
at least. Allow command line text to exceed the available width following
the prompt by wrapping onto other lines the way they bash does it. Make the
newline character display as a newline instead of as a linefeed or DOS OEM
character. Increase the amount of common code between Windows and
non-Windows versions and make them behave the same way. Don't refresh the
Windows command line when the shift key is pressed.