Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bc346cf

Browse files
committed
chore: add a comment to explain the shift
1 parent 4c421c2 commit bc346cf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎src/common/config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ function parseCliConfig(args: string[]): CliOptions {
240240
};
241241

242242
const positionalArguments = parsed._ ?? [];
243+
// if we have a positional argument that matches a connection string
244+
// store it as the connection specifier and remove it from the argument
245+
// list, so it doesn't get misunderstood by the mongosh args-parser
243246
if (!parsed.nodb && isConnectionSpecifier(positionalArguments[0])) {
244247
parsed.connectionSpecifier = positionalArguments.shift();
245248
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /