Tad Marshall
18fb262f9e
SERVER-2837 -- be more friendly to piping in the shell
...
Don't print 'bye' on exit when --quiet is set.
2011-11-28 00:16:36 -05:00
Tad Marshall
2cad4df74d
SERVER-3998 -- enable the shell's edit command in Windows
...
Make the mongo shell's 'edit' command work in Windows. Change
the code to use C file stream functions instead of Unix low level
IO (fopen instead of open), close and reopen the file so there are
fewer OS dependencies, delete (remove()) the file ourselves where
needed. Also, remove #ifdefs are are now constant (USE_LINENOISE,
USE_TABCOMPLETION) and the unused code they supported, and try to
get the entire source file to adhere to the kernel code style.
2011-11-27 09:51:40 -05:00
Tad Marshall
05717037fb
SERVER-3470 -- store multi-line commands in history
...
Convert newlines to spaces and store the entire multi-line command instead
of just the line that began the command. Fix initial cap in error message.
2011-11-18 13:26:05 -05:00
Tad Marshall
8d8b272225
SERVER-4008 -- don't leak memory in the shell
...
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.
2011-11-16 13:07:37 -05:00
Tony Hannan
98314e257e
SERVER-4122: "*" is a valid dbname. make mongodump use "" instead of "*" to represent all dbs -- "" is not a valid dbname. Also make shell "use" command accept "*" or any other special char as dbname
2011-11-03 20:17:56 -04:00
Eliot
751896bafd
Merge pull request #122 from tadmarshall/SERVER-3771-part-1-reissue-2
...
SERVER-3771 -- part 1 (reissue 2) -- don't let 'prompt' become undefined
2011-10-31 21:10:11 -07:00
Brandon Diamond
f9a94a82e8
SERVER-4113: shell validation to avoid "*" db name
2011-10-28 11:39:07 -04:00
Brandon Diamond
b92b87505a
SERVER-4132: shell prompt now includes repset name
2011-10-25 16:00:04 -04:00
Eliot
795c702366
Merge pull request #116 from tadmarshall/SERVER-3991-reissue
...
SERVER-3991 (reissue) -- don't index past end of string
2011-10-14 22:25:37 -07:00
Tad Marshall
862dc0f711
SERVER-3771 -- part 1 (reissue 2) -- don't let 'prompt' become undefined
...
This is a reissue of my earlier fix. I'm trying to break them down into
bite-sized parts to make them easier to pull.
Test the return value from a call to a function prompt (included regex)
and only use it if it is a string. If we have no string prompt, display
the default prompt = sayReplSetMemberState()+"> "; . Edited for style.
2011-10-13 07:54:51 -04:00
Tad Marshall
443ecbfb44
SERVER-3991 (reissue) -- don't index past end of string
...
This is a reissue of my earlier fix. I'm trying to break them down into
bite-sized parts to make them easier to pull.
Break out of the for() loop once we've advanced the counter past the end.
Skip the test for dangling operator (no character to examine, we're inside
a quoted string) and set danglingOp = false.
2011-10-12 15:50:31 -04:00
Tad Marshall
294bec31d9
SERVER-4007 (reissue) -- use .c_str() instead of .data()
...
Use .c_str() instead of .data() if the loop is checking for 0 as terminator.
2011-10-12 14:47:28 -04:00
Spencer T Brody
6d573a9a6e
SERVER-3912: Make .dbshell file on windows be in user directory
...
instead of current directory.
2011-10-11 18:48:51 -04:00
agirbal
11d51d2204
SERVER-3909: Blank lines don't work in the mongo shell starting with 2.0
2011-09-25 18:35:12 -07:00
agirbal
6978f76e22
SERVER-3909: Blank lines don't work in the mongo shell starting with 2.0
2011-09-25 18:35:12 -07:00
Dwight
7399d406b1
indicate in shell prompt when connected to a configsvr.
2011-09-20 16:05:45 -04:00
Mathias Stearn
153d07439b
Delete temp file SERVER-3787
2011-09-14 09:26:05 -04:00
Mathias Stearn
8f8c64bef1
Don't use mkstemps as it isn't available everywhere SERVER-3787
2011-09-14 09:25:47 -04:00
Mathias Stearn
9f4f53c3c7
Handle editor failure and error exit status SERVER-3787
2011-09-14 15:41:51 -04:00
Mathias Stearn
411236f3ab
Add support for 'edit' magic in shell SERVER-3787
2011-09-14 15:41:51 -04:00
dannenberg
9a79fd710b
SERVER-3341 multiline cancels after two blank lines
2011-07-29 11:51:22 -04:00
Eliot Horowitz
f84bf1a41a
support for forced ssl everywhere in client and server
2011-07-27 09:48:35 -04:00
dannenberg
d3d1f32427
SERVER-1687 .mongorc.js file is read from home directory on shell startup
2011-06-24 17:15:22 -04:00
dannenberg
1d19f0498c
fixed white space mistake
2011-06-15 16:37:23 -04:00
dannenberg
a65dd3a524
prompt can be string or function and works with spidermonkey in addition to v8
2011-06-15 16:32:58 -04:00
dannenberg
2fdf334c6b
fixed custom prompt in spidermonkey
2011-06-15 16:27:20 -04:00
dannenberg
1c180c6a60
SERVER-3267 very basic custom prompt added
2011-06-15 13:42:21 -04:00
Eliot Horowitz
94fd6890ec
some rs logging cleaning
2011-06-02 02:07:21 -04:00
agirbal
1725803c20
SERVER-2579: all v8 object creation is now lazy.
...
Correct allocation and freeing of underlying C++ object.
Correct ordering of object properties even when new ones are added within JS.
Supports deletion of properties with lazzy wrapper.
Also removed scope->setThis in favor of passing it in the invoke() command.
2011-05-02 16:08:41 -07:00
Dwight
39c5cbdbf7
indicate in mongo shell prompt if connected to a mongos. goal would be to prevent fat fingers and similar confusion.
2011-04-14 16:47:06 -04:00
Mathias Stearn
ae79f44dd2
Use merged linenoise on windows SERVER-1763
2011-04-11 19:00:15 -04:00
Mathias Stearn
1ecf07317a
reduce windows-specific code
2011-04-06 16:46:53 -04:00
Mathias Stearn
b7817b8986
Make shell killOp on ctrl-c stuff work on windows too SERVER-1451
2011-04-06 16:46:53 -04:00
Mathias Stearn
31970cf322
Consider lines ending in '.' as unfinished SERVER-2811
2011-04-04 16:12:56 -04:00
Mathias Stearn
bfcfc759ea
Revert "for now disable shell history on windows"
...
This reverts commit 25f1581767 .
2011-03-18 15:01:54 -05:00
Mathias Stearn
25f1581767
for now disable shell history on windows
2011-03-18 14:39:33 -05:00
Eliot Horowitz
9dd5c86e5e
don't use tab completions on windows yet
2011-03-18 15:35:18 -04:00
Eliot Horowitz
7cbc2f2d8e
Revert "separate ifdef for history for linenoise"
...
This reverts commit 261d65d693 .
2011-03-18 15:33:39 -04:00
Eliot Horowitz
261d65d693
separate ifdef for history for linenoise
2011-03-18 15:32:10 -04:00
Eliot Horowitz
9711f4d311
try linenoise on windows
2011-03-18 15:19:43 -04:00
Eliot Horowitz
ff767886ee
use linenoise as cpp
2011-03-18 15:17:40 -04:00
Eliot Horowitz
e360d60e2d
fix in compile
2011-03-18 03:27:33 -04:00
Eliot Horowitz
3403b88453
use linenoise instead of readline
2011-03-18 02:48:07 -04:00
Eliot Horowitz
d91ad388be
remove unneed variable
2011-03-18 02:48:07 -04:00
Eliot Horowitz
d85cdcf1b5
verbose option for shell
2011-02-01 11:38:33 -05:00
Eliot Horowitz
b828d21630
ran astyle SERVER-2304
2011-01-04 00:40:41 -05:00
Eliot Horowitz
439881c429
when shell calls replGetStatus don't reset last error
2010-12-27 16:20:11 -05:00
Tony Hannan
b7eaac286e
SERVER-2095: Small enhancement to previous commit
2010-12-06 09:32:17 -05:00
Tony Hannan
1f02e078ca
SERVER-2095: Shell requests another line when user enters a line with a dangling operator. Eg. 'x = 1 +' will request more input
2010-12-06 08:59:35 -05:00
Kristina
4adaffa7b3
make rs shell prompt use readline
2010-12-03 15:55:40 -05:00