Skip to content

Commit

Permalink
feat: add documentation of options to the InitCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
tnotheis committed Feb 14, 2025
1 parent 8a94ef9 commit 718aa77
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cman init --db-connection-string <connection_string> --base-url <base_url> --cli

It requires the following parameters:

- `db-connection-string`: A connection string to your existing MongoDB instance. This connection string will be used as a default for all the Connectors you create.
- `db-connection-string`: The connection string to your existing MongoDB instance. This connection string will be used as a default for all the Connectors you create.
You can find the syntax of a connection string in the [official MongoDB documentation](https://www.mongodb.com/docs/manual/reference/connection-string/#srv-connection-format).
- `base-url`: The base URL of the Backbone the Connector should connect to. You can obtain this URL from the operator of the Backbone.
- `client-id`: The client ID of the OAuth2 client that should be used to authenticate the Connector on the Backbone. You can obtain it from the operator of the Backbone.
Expand Down
26 changes: 22 additions & 4 deletions src/commands/InitCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,28 @@ export interface InitCommandArgs {
export class InitCommand extends BaseCommand<InitCommandArgs> {
public static builder: yargs.BuilderCallback<any, InitCommandArgs> = (yargs: yargs.Argv) =>
yargs
.option("db-connection-string", { type: "string", demandOption: true })
.option("base-url", { type: "string", demandOption: true })
.option("client-id", { type: "string", demandOption: true })
.option("client-secret", { type: "string", demandOption: true })
.option("db-connection-string", {
type: "string",
demandOption: true,
description:
"The connection string to your existing MongoDB instance. This connection string will be used as a default for all the Connectors you create. You can find the syntax of a connection string in the official MongoDB documentation: https://www.mongodb.com/docs/manual/reference/connection-string/#srv-connection-format.",
})
.option("base-url", {
type: "string",
demandOption: true,
description: "The base URL of the Backbone the Connector should connect to. You can obtain this URL from the operator of the Backbone.",
})
.option("client-id", {
type: "string",
demandOption: true,
description: "The client ID of the OAuth2 client that should be used to authenticate the Connector on the Backbone. You can obtain it from the operator of the Backbone.",
})
.option("client-secret", {
type: "string",
demandOption: true,
description:
"The client secret of the OAuth2 client that should be used to authenticate the Connector on the Backbone. You can obtain it from the operator of the Backbone.",
})

protected async runInternal(args: InitCommandArgs): Promise<void> {
this._config.dbConnectionString = args.dbConnectionString
Expand Down

0 comments on commit 718aa77

Please sign in to comment.