Skip to content

Commit b8e00f6

Browse files
committed
chore: add a comment to explain the shift
1 parent f0d17ca commit b8e00f6

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
@@ -250,6 +250,9 @@ function parseCliConfig(args: string[]): CliOptions {
250250
};
251251

252252
const positionalArguments = parsed._ ?? [];
253+
// if we have a positional argument that matches a connection string
254+
// store it as the connection specifier and remove it from the argument
255+
// list, so it doesn't get misunderstood by the mongosh args-parser
253256
if (!parsed.nodb && isConnectionSpecifier(positionalArguments[0])) {
254257
parsed.connectionSpecifier = positionalArguments.shift();
255258
}

0 commit comments

Comments
 (0)