[SERVER-21764] "\n" appears in listCommands help text Created: 03/Dec/15  Updated: 11/Dec/15  Resolved: 11/Dec/15

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 3.2.0-rc6
Fix Version/s: None

Type: Bug Priority: Trivial - P5
Reporter: Randolph Tan Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

example:

"copydb" : {
    "help" : "copy a database from another host to this host\nusage: {copydb: 1, fromhost: <connection string>, fromdb: <db>, todb: <db>[, slaveOk: <bool>, username: <username>, nonce: <nonce>, key: <key>]}",
    "slaveOk" : false,
    "adminOnly" : true
},



 Comments   
Comment by Sam Kleinman (Inactive) [ 11/Dec/15 ]

I concur that this is expected.

Additionally the, db.listCommands() helper in the shell, prints properly.

I'm going to go ahead and close this, but feel free to reopen if I'm missing something.

Comment by J Rassi [ 03/Dec/15 ]

This seems expected, to me. When printing an object with a string value, the shell does not interpret escape codes contained in the string. In contrast, when printing a string, the shell does interpret escape codes that the string contains.

> db.runCommand("listCommands").commands.copydb
{
	"help" : "copy a database from another host to this host\nusage: {copydb: 1, fromhost: <connection string>, fromdb: <db>, todb: <db>[, slaveOk: <bool>, username: <username>, nonce: <nonce>, key: <key>]}",
	"slaveOk" : false,
	"adminOnly" : true
}
> db.runCommand("listCommands").commands.copydb.help
copy a database from another host to this host
usage: {copydb: 1, fromhost: <connection string>, fromdb: <db>, todb: <db>[, slaveOk: <bool>, username: <username>, nonce: <nonce>, key: <key>]}

Generated at Thu Feb 08 03:58:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.