Skip to content

Commit e4bbe05

Browse files
committed
chore(arg-parser): move parseCliArgs into arg-parser
This is preparation for its usage of MCP and further changes in #2589
1 parent f215cf7 commit e4bbe05

File tree

6 files changed

+9
-5
lines changed

6 files changed

+9
-5
lines changed

package-lock.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/arg-parser/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"depcheck": "^1.4.7",
4848
"eslint": "^7.25.0",
4949
"mongodb": "^6.19.0",
50-
"prettier": "^2.8.8"
50+
"prettier": "^2.8.8",
51+
"strip-ansi": "^6.0.0"
5152
}
5253
}

packages/cli-repl/src/arg-parser.ts renamed to packages/arg-parser/src/arg-parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { CommonErrors, MongoshUnimplementedError } from '@mongosh/errors';
22
import i18n from '@mongosh/i18n';
33
import type { CliOptions } from '@mongosh/arg-parser';
44
import parser from 'yargs-parser';
5-
import { colorizeForStderr as clr } from './clr';
6-
import { USAGE } from './constants';
5+
import { colorizeForStderr as clr } from '../../cli-repl/src/clr';
6+
import { USAGE } from '../../cli-repl/src/constants';
77

88
/**
99
* Unknown translation key.

packages/arg-parser/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ export function generateConnectionInfoFromCliArgs(
1919
const connectionString = generateUri(options);
2020
return mapCliToDriver(options, { connectionString, driverOptions: {} });
2121
}
22+
23+
export { parseCliArgs } from './arg-parser';

packages/cli-repl/src/run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ enableFipsIfRequested();
1515

1616
import { markTime } from './startup-timing';
1717
import { CliRepl } from './cli-repl';
18-
import { parseCliArgs } from './arg-parser';
18+
import { parseCliArgs } from '@mongosh/arg-parser';
1919
import { runSmokeTests } from './smoke-tests';
2020
import { USAGE } from './constants';
2121
import { baseBuildInfo, buildInfo } from './build-info';

0 commit comments

Comments
 (0)